
Object & Array Big O of object ๊ฐ์ฒด๋ฅผ ์ฌ์ฉํ๊ธฐ ์ข์ ๋๋ ๋ค์๊ณผ ๊ฐ๋ค. ์ ๋ ฌํ ํ์๊ฐ ์์ ๋ ๋น ๋ฅธ ์ ๊ทผ / ์ฝ์ / ์ญ์ ๊ฐ ํ์ํ ๋ ๊ฐ์ฒด์ Big O ํ์ - O(N) ์ฝ์ - O(1) ์ญ์ - O(1) ์ ๊ทผ - O(1) ํ์์ด O(N)์ ๋ฐ๋ฅด๋ ์ด์ ๋ ํน์ ํ ์ ๋ณด๊ฐ ์ด๋ค ๊ฐ์ ์๋์ง ํ์ธํ๊ธฐ ๋๋ฌธ์ด๋ค. const information = { name: 'Shoupeach', isApeach: true, favoriteNumbers: [4, 8] }; information์ด๋ ๊ฐ์ฒด๊ฐ ์กด์ฌํ ๋ ์ฌ๊ธฐ์ true๋ผ๋ ๊ฐ์ด information์์ ์ด๋์ ์ ์ฅ๋์ด ์๋์ง ์๊ธฐ ์ํด์ ๋จผ์ name์ ํ์ธํ๊ณ ๊ฐ์ ํ์ธํ๋ค. name์ ๊ฐ์ Shoupeach์ด๊ธฐ ๋๋ฌธ์ ํต๊ณผํ ๋ค i..

Big O Notation Need for Big O Notation "๋ฌธ์์ด์ ๋ฐ์์ ์ด๋ฅผ ๋ค์ง์ด ์ถ๋ ฅํ๋ ํจ์๋ฅผ ์์ฑํ์์ค." for๋ฌธ์ ์ฌ์ฉํ๋ ๊ฒฝ์ฐ, ๋ด์ฅ ๋ฌธ์์ด ๋ฉ์๋๋ฅผ ์ฌ์ฉํ๋ ๊ฒฝ์ฐ ๋ฑ๋ฑ ์ด์ ๋ํ ํด๊ฒฐ์ฑ ๋ง 10๊ฐ์ง๊ฐ ๋๋๋ค... ๐ซ ์ด ์ค์ ๊ฐ์ฅ best์ธ ๋ฐฉ๋ฒ์ ๋ฌด์์ผ๊น? ์ฌ๋ฌ ์ฝ๋๋ฅผ ๋น๊ตํ๊ณ ์ฑ๋ฅ์ ํ๊ฐํ ์ ์๋ ๋ฐฉ๋ฒ์ด ์๋ค๋ฉด ์ข์ง ์์๊น? What is Big O Notation? 1๋ถํฐ n๊น์ง ๋ํ๋ ํจ์๊ฐ ์๋ค๊ณ ํ ๋, 2๊ฐ์ง ๊ฒฝ์ฐ๋ฅผ ์๊ฐํด ๋ณผ ์ ์๋ค. function add1(n) { let result = 0; for (let i = 1; i = 0; j--) { console.log(j); } } ์ด 2๊ฐ์ for๋ฌธ์ด ์๊ธฐ ๋๋ฌธ์ O(N) + O(N)์ผ๋ก ๊ฒฐ๊ตญ O(N)์ธ..