โฌ๏ธ Main Note
https://docs.google.com/document/d/1Ce2r1obYEdFcmE1S8LLDWiZJbWWA0V6iE_wj4J9802k/edit
Mostly backend computer takes a big role in searching. Once the frontend computer requsts for searching a word, the backend copmuter responses with the wanted word. then frontend receives it and displays to the screen.
: This database scans the whole thing.
Disk based database
So to make sure the program runs in an efficient way, elastic search database can be used.
Hello
World
Disk based database
Memory based database
Memory based: Temporal saving.
--> Once the computer is shut down, all the data are gone.
--> Fast since it doesn't have to permanently save everything.
(์ผ๋จ ์งฑ๋ฐ์๋๋ ๊ฐ๋
)
Disk based: Permanent saving.
--> Doesn't get deleted even when the computer is shut down.
--> Slow since it has to save the data safely.
(๋์คํฌ ์์ฒด์ ์ ์ฅ)
_
#$%
//์ ํด๋ฆฌ๋ ํธ์ฌ๋ฒ => ์ต๋๊ณต์ฝ์๋ฅผ ๊ตฌํ๊ธฐ ์ํ ์๊ณ ๋ฆฌ์ฆ ๊ณต์
//ํฐ ์๋ฅผ ์์ ์๋ก ๋๋ด์๋ (a๊ฐ ํฐ ์์ด๊ณ b๊ฐ ์์์๋ผ๋ฉด --> a๋ฅผ b๋ก ๋๋๋ค.)
//๋๋จธ์ง ๊ฐ์ด 6์ด ๋๋ฉด ๋๋ด๋ ์์ ์ b๊ฐ ์ต๋๊ณต์ฝ์๊ฐ ๋๋ค
//๋๋จธ์ง ๊ฐ์ด 0์ด ๋ ๋๊น์ง ๊ณ์ ๋ฐ๋ณต
//๋๋จธ์ง๊ฐ 0์ด ๋๋ฉด, ๋๋ด๋ ์์ ์ b๊ฐ ์ต๋๊ณต์ฝ์๊ฐ ๋๋ค
function solution(n, m) {
let a = m; //ํฐ ์๊ฐ ๋ค์ด์จ๋ค
let b = n; //์์ ์๊ฐ ๋ค์ด์จ๋ค
let r = 0; //a๋ฅผ b๋ก ๋๋ด์ ๋์ ๋๋จธ์ง ๊ฐ
while (a % b > 0) {
r = a % b;
a = b; //ํฐ ์์ ์์ ์๋ฅผ ํ ๋น
b = r; //์์ ์์๋ ๋๋จธ์ง ๊ฐ ํ ๋น
}
//์ต์๊ณต๋ฐฐ์: n๊ณผ m์ ๊ณฑํ ๊ฐ์ ์ต๋๊ณต์ฝ์๋ฅผ ๋๋๋ฉด ์ต์๊ณต๋ฐฐ์๊ฐ ๋๋ค
return [b, (n * m) / b];
}