์ฝ˜ํ…์ธ ๋กœ ์ด๋™

๊ณต๋ถ€ ๋ชฉ๋ก

GitHub - yukina1418/javascript-algorithms: ๐Ÿ“ Algorithms and data structures implemented in JavaScript with explanations and links to further readings

coding-interview-university/README-ko.md at main ยท jwasham/coding-interview-university ยท GitHub

์•Œ๊ณ ๋ฆฌ์ฆ˜ ๋ณต์žก๋„ / Big-O / ์ ๊ทผ์  ๋ถ„์„ยถ

์ž๋ฃŒ๊ตฌ์กฐยถ

๋ฐฐ์—ดยถ

  • ์ž๋™ ๋ฆฌ์‚ฌ์ด์ง• ๋ฒกํ„ฐ ๊ตฌํ˜„ํ•˜๊ธฐ
  • ์„ค๋ช…:
  • ๋ฒกํ„ฐ ๊ตฌํ˜„ํ•˜๊ธฐ (์ž๋™ ๋ฆฌ์‚ฌ์ด์ง•์„ ํฌํ•จํ•œ ๋™์  ๋ฐฐ์—ด):
    • ๋ฐฐ์—ด, ํฌ์ธํ„ฐ ๋ฐ ์ธ๋ฑ์‹ฑ ๋Œ€์‹ ํ•˜์—ฌ ํŠน์ • ์ธ๋ฑ์Šค์— ์ ‘๊ทผํ•˜๋Š” ํฌ์ธํ„ฐ ์—ฐ์‚ฐ์„ ํ†ตํ•œ ์ฝ”๋”ฉ ์—ฐ์Šต
    • ๋ฉ”๋ชจ๋ฆฌ ํ• ๋‹น์„ ํฌํ•จํ•œ ์ƒˆ ๋ฐฐ์—ด
    • ๋ฐฐ์—ด ๋ฉ”์†Œ๋“œ ๋“ฑ์˜ ๊ธฐ๋Šฅ์„ ํ™œ์šฉํ•˜์ง€ ์•Š์œผ๋ฉด์„œ ์ •์ˆ˜ ๋ฐฐ์—ด์— ๋ฉ”๋ชจ๋ฆฌ๋ฅผ ํ• ๋‹นํ•  ์ˆ˜ ์žˆ์–ด์•ผ ํ•จ
    • 16์œผ๋กœ ์‹œ์ž‘ํ•˜๊ฑฐ๋‚˜ ์‹œ์ž‘ํ•˜๋Š” ์ˆซ์ž๊ฐ€ ํฌ๋‹ค๋ฉด 2์˜ ์ œ๊ณฑ์ˆ˜(16, 32, 64, 128)๋กœ ์‹œ์ž‘
    • size() - ํ•ญ๋ชฉ์˜ ๊ฐœ์ˆ˜
    • capacity() - ๋“ค์–ด๊ฐˆ ์ˆ˜ ์žˆ๋Š” ํ•ญ๋ชฉ์˜ ์ตœ๋Œ€ ๊ฐœ์ˆ˜
    • is_empty()
    • at(index) - ์ธ๋ฑ์Šค์— ์žˆ๋Š” ํ•ญ๋ชฉ์„ ๋Œ๋ ค์ฃผ๊ณ , ์ธ๋ฑ์Šค๊ฐ€ ๋ฒ”์œ„ ๋ฐ–์ด๋ฉด ์—๋Ÿฌ๋ฅผ ๋ƒ„
    • push(item)
    • insert(index, item) - index์— item์„ ์‚ฝ์ž…ํ•˜๊ณ  ๊ธฐ์กด ์ธ๋ฑ์Šค์˜ ๊ฐ’๋ถ€ํ„ฐ ์ญ‰ ์˜ค๋ฅธ์ชฝ์œผ๋กœ ์‰ฌํ”„ํŠธ
    • prepend(item) - ๋งจ ์•ž์— ์›์†Œ๋ฅผ ์‚ฝ์ž…
    • pop() - ๋งˆ์ง€๋ง‰ ์›์†Œ๋ฅผ ์‚ญ์ œํ•˜๊ณ  ๊ฐ’์„ ๋Œ๋ ค์ค€๋‹ค
    • delete(index) - delete item at index, shifting all trailing elements left
    • remove(item) - looks for value and removes index holding it (even if in multiple places)
    • find(item) - looks for value and returns first index with that value, -1 if not found
    • resize(new_capacity) // private ํ•จ์ˆ˜
    • ์šฉ๋Ÿ‰์ด ๊ฝ‰ ์ฐจ๋ฉด, ๊ทธ ๋‘๋ฐฐ๋กœ ํฌ๊ธฐ๋ฅผ ์กฐ์ •ํ•œ๋‹ค.
    • item์„ ํ•˜๋‚˜ ๊บผ๋‚ผ ๋•Œ, ์šฉ๋Ÿ‰์ด 1/4์ด๋ผ๋ฉด, ์šฉ๋Ÿ‰์„ ์ ˆ๋ฐ˜์œผ๋กœ ์ค„์ธ๋‹ค.
  • ์‹œ๊ฐ„ ๋ณต์žก๋„
    • ์ ‘๊ทผ, ์ˆ˜์ •, ๋์— ์ถ”๊ฐ€/์‚ญ์ œํ•˜๋Š” ๋ฐ O(1)
    • ๋‹ค๋ฅธ ๊ณณ์— ์ถ”๊ฐ€/์‚ญ์ œํ•˜๋Š” ๋ฐ O(n)
  • ๊ณต๊ฐ„ ๋ณต์žก๋„
    • ๋ฉ”๋ชจ๋ฆฌ์— ์—ฐ์†์ ์œผ๋กœ ์žˆ์–ด์„œ, ๊ทผ์ ‘์„ฑ์ด ์„ฑ๋Šฅ์„ ํ–ฅ์ƒ์‹œํ‚จ๋‹ค.
    • ํ•„์š”ํ•œ ๊ณต๊ฐ„ = (n ์ด์ƒ์ธ ๋ฐฐ์—ด์˜ ์šฉ๋Ÿ‰) * item์˜ ํฌ๊ธฐ, ํ•˜์ง€๋งŒ 2n ํฌ๊ธฐ์—์„œ๋Š” ์—ฌ์ „ํžˆ O(n)

๋งํฌ๋“œ ๋ฆฌ์ŠคํŠธยถ

  • ์„ค๋ช…:
  • C Code (video)
    - ์ „์ฒด ์˜์ƒ์€ ์•„๋‹ˆ๊ณ , ๋…ธ๋“œ ๊ตฌ์กฐ์™€ ๋ฉ”๋ชจ๋ฆฌ ํ• ๋‹น์— ๋Œ€ํ•œ ๋ถ€๋ถ„์ž…๋‹ˆ๋‹ค.
  • ์—ฐ๊ฒฐ ๋ฆฌ์ŠคํŠธ vs ๋ฐฐ์—ด:
  • ์™œ ์—ฐ๊ฒฐ ๋ฆฌ์ŠคํŠธ๋ฅผ ๊ธฐํ”ผํ•ด์•ผ ํ•˜๋Š”์ง€ (์˜์ƒ)
  • ์งš๊ณ ๊ฐ€๊ธฐ: ์ด์ค‘ ํฌ์ธํ„ฐ์— ๋Œ€ํ•œ ์ง€์‹์ด ํ•„์š”ํ•˜๋‹ค๋ฉด:
    (for when you pass a pointer to a function that may change the address where that pointer points)
    ์ด ํŽ˜์ด์ง€๋Š” ํฌ์ธํ„ฐ๊ฐ€ ํฌ์ธํ„ฐ๋ฅผ ๊ฐ€๋ฆฌํ‚ค๋Š” ๊ฒƒ์„ ํŒŒ์•…ํ•˜๋Š” ์ •๋„์ž…๋‹ˆ๋‹ค. ์ €๋Š” ์•„๋ž˜ ๋ชฉ๋ก์„ ์ˆœ์„œ๋Œ€๋กœ ์ฝ์ง€ ์•Š๊ธฐ๋ฅผ ๊ถŒ์žฅํ•ฉ๋‹ˆ๋‹ค. ๊ฐ€๋…์„ฑ๊ณผ ์œ ์ง€ ๋ณด์ˆ˜์„ฑ์ด ๋” ์ข‹๊ธฐ ๋•Œ๋ฌธ์ž…๋‹ˆ๋‹ค.
  • ๊ตฌํ˜„ (์ €๋Š” tail ํฌ์ธํ„ฐ๊ฐ€ ์žˆ๋Š” ๊ฒƒ๊ณผ ์—†๋Š” ๊ฒƒ ๋ชจ๋‘ ๊ตฌํ˜„ํ–ˆ์—ˆ์Šต๋‹ˆ๋‹ค.):
    • size() - ๋ฆฌ์ŠคํŠธ ์•ˆ์˜ ๋ฐ์ดํ„ฐ ๊ฐœ์ˆ˜๋ฅผ ๋ฐ˜ํ™˜ํ•œ๋‹ค.
    • empty() - ๋ฆฌ์ŠคํŠธ๊ฐ€ ๋น„์–ด์žˆ๋‹ค๋ฉด true๋ฅผ ๋ฐ˜ํ™˜ํ•œ๋‹ค.
    • value_at(index) - index๋ฒˆ์งธ ์œ„์น˜์˜ value์„ ๋ฐ˜ํ™˜ํ•œ๋‹ค. (๊ฐ€์žฅ ์•ž์€ 0๋ถ€ํ„ฐ ์‹œ์ž‘ํ•œ๋‹ค.)
    • push_front(value) - ๊ฐ€์žฅ ์•ž์— value๋ฅผ ์ถ”๊ฐ€ํ•œ๋‹ค.
    • pop_front() - ๊ฐ€์žฅ ์•ž์— ์žˆ๋Š” ๊ฒƒ์„ ์ œ๊ฑฐํ•˜๊ณ , ๊ทธ value๋ฅผ ๋ฐ˜ํ™˜ํ•œ๋‹ค.
    • push_back(value) - ๊ฐ€์žฅ ๋์— value์„ ์ถ”๊ฐ€ํ•œ๋‹ค.
    • pop_back() - ๊ฐ€์žฅ ๋์— ์žˆ๋Š” ๊ฒƒ์„ ์ œ๊ฑฐํ•˜๊ณ , ๊ทธ value๋ฅผ ๋ฐ˜ํ™˜ํ•œ๋‹ค.
    • front() - ๊ฐ€์žฅ ์•ž์— ์žˆ๋Š” ๊ฒƒ์˜ value๋ฅผ ๊ฐ€์ ธ์˜จ๋‹ค.
    • back() - ๊ฐ€์žฅ ๋์— ์žˆ๋Š” ๊ฒƒ์˜ value๋ฅผ ๊ฐ€์ ธ์˜จ๋‹ค.
    • insert(index, value) - index๋ฒˆ์งธ ์œ„์น˜์— value๋ฅผ ์ถ”๊ฐ€ํ•œ๋‹ค. ์ฆ‰, index๋ฒˆ์งธ์— ์ƒˆ๋กœ ์ถ”๊ฐ€๋œ ๊ฒƒ์ด ๊ธฐ์กด์˜ index๋ฒˆ์งธ์— ์žˆ๋˜ ๊ฒƒ์„ ๊ฐ€๋ฆฌํ‚จ๋‹ค.
    • erase(index) - index๋ฒˆ์งธ์— ์žˆ๋Š” ๋…ธ๋“œ๋ฅผ ์‚ญ์ œํ•œ๋‹ค.
    • value_n_from_end(n) - ๋’ค์—์„œ๋ถ€ํ„ฐ n๋ฒˆ์งธ์— ์žˆ๋Š” ๋…ธ๋“œ์˜ value๋ฅผ ๋ฐ˜ํ™˜ํ•œ๋‹ค.
    • reverse() - ๋ฆฌ์ŠคํŠธ๋ฅผ ๋’ค์ง‘๋Š”๋‹ค.
    • remove_value(value) - value์™€ ๊ฐ™์€ ๊ฐ’์„ ๊ฐ€์ง€๋Š” ์ฒซ ๋ฒˆ์งธ ๋…ธ๋“œ๋ฅผ ์ œ๊ฑฐํ•œ๋‹ค.
  • ์ด์ค‘ ์—ฐ๊ฒฐ ๋ฆฌ์ŠคํŠธ

์Šคํƒยถ

  • Stacks (video)
  • Will not implement. Implementing with array is trivial.

ํยถ

  • Queue (video)
  • Circular buffer/FIFO05_04-priorityQueuesAndDeques.mp4)
  • tail ํฌ์ธํ„ฐ๊ฐ€ ์žˆ๋Š” ์—ฐ๊ฒฐ ๋ฆฌ์ŠคํŠธ๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ๊ตฌํ˜„ํ•˜๊ธฐ:
    • enqueue(value) - tail์ด ๊ฐ€๋ฆฌํ‚ค๋Š” ๊ณณ์— value๋ฅผ ์ถ”๊ฐ€ํ•œ๋‹ค
    • dequeue() - value๋ฅผ ๋ฐ˜ํ™˜ํ•˜๊ณ  ๊ฐ€์žฅ ์ตœ๊ทผ์— ์ถ”๊ฐ€๋œ ์›์†Œ(front)๋ฅผ ์ œ๊ฑฐํ•œ๋‹ค.
    • empty()
  • ๊ณ ์ • ๊ธธ์ด ๋ฐฐ์—ด์„ ์‚ฌ์šฉํ•˜์—ฌ ๊ตฌํ˜„ํ•˜๊ธฐ:
    • enqueue(value) - ์‚ฌ์šฉ ๊ฐ€๋Šฅํ•œ ์ €์žฅ ๊ณต๊ฐ„์˜ ๋์— item์„ ์ถ”๊ฐ€ํ•œ๋‹ค.
    • dequeue() - value๋ฅผ ๋ฐ˜ํ™˜ํ•˜๊ณ  ๊ฐ€์žฅ ์ตœ๊ทผ์— ์ถ”๊ฐ€๋œ ์›์†Œ๋ฅผ ์ œ๊ฑฐํ•œ๋‹ค.
    • empty()
    • full()
  • ๋น„์šฉ:
    • a bad implementation using linked list where you enqueue at head and dequeue at tail would be O(n)
      because youโ€™d need the next to last element, causing a full traversal each dequeue
    • enqueue: O(1) (amortized, linked list and array [probing])
    • dequeue: O(1) (linked list and array)
    • empty: O(1) (linked list and array)

ํ•ด์‹œ ํ…Œ์ด๋ธ”ยถ

์ถ”๊ฐ€ ์ง€์‹ยถ

์ด์ง„ ํƒ์ƒ‰ยถ

๋น„ํŠธ ์—ฐ์‚ฐยถ

ํŠธ๋ฆฌยถ

ํŠธ๋ฆฌ - ๋ฐฐ๊ฒฝ ์ง€์‹ยถ

  • Series: Trees (video)
  • ํŠธ๋ฆฌ ๊ธฐ์ดˆ ํ˜•ํƒœ ๋งŒ๋“ค๊ธฐ
  • ์ˆœํšŒ
  • ์•Œ๊ณ ๋ฆฌ์ฆ˜ ๋‹ค๋ฃจ๊ธฐ
  • BFS(๋„ˆ๋น„-์šฐ์„  ํƒ์ƒ‰;breadth-first search) and DFS(๊นŠ์ด-์šฐ์„  ํƒ์ƒ‰;depth-first search)
    • BFS ๋…ธํŠธ:
    • level order (BFS, ํ ์‚ฌ์šฉ)
    • ์‹œ๊ฐ„ ๋ณต์žก๋„: O(n)
    • ๊ณต๊ฐ„ ๋ณต์žก๋„:
      ์ตœ๊ณ : O(1)
      ์ตœ์•…: O(n/2)=O(n)
    • DFS ๋…ธํŠธ:
    • ์‹œ๊ฐ„ ๋ณต์žก๋„: O(n)
    • ๊ณต๊ฐ„ ๋ณต์žก๋„:
      ์ตœ๊ณ : O(log n) - ํ‰๊ท ์ ์œผ๋กœ, ํŠธ๋ฆฌ์˜ ๋†’์ด์ด๋‹ค.
      ์ตœ์•…: O(n)
    • ์ค‘์œ„(inorder) (DFS: ์™ผ์ชฝ, ์ž์‹ , ์˜ค๋ฅธ์ชฝ)
    • ํ›„์œ„(postorder) (DFS: ์™ผ์ชฝ, ์˜ค๋ฅธ์ชฝ, ์ž์‹ )
    • ์ „์œ„(preorder) (DFS: ์ž์‹ , ์™ผ์ชฝ, ์˜ค๋ฅธ์ชฝ)

์ด์ง„ ํƒ์ƒ‰ ํŠธ๋ฆฌ (BST)ยถ

ํž™ / ์šฐ์„ ์ˆœ์œ„ ํ / ์ด์ง„ ํž™ยถ

์ •๋ ฌยถ

๊ฐœ๋žต์ ์œผ๋กœ ๋ณด์ž๋ฉด, ์—ฌ๊ธฐ์— ์‹œ๊ฐ์ ์œผ๋กœ ๋‚˜ํƒ€๋‚ธ 15๊ฐ€์ง€ ์ •๋ ฌ ์•Œ๊ณ ๋ฆฌ์ฆ˜๋“ค์„ ๋ณด์„ธ์š”.
์ด ์ฃผ์ œ์— ๋Œ€ํ•ด์„œ ๋” ์ž์„ธํžˆ ์•Œ๊ณ  ์‹ถ๋‹ค๋ฉด, ๋ช‡๋ช‡ ์ฃผ์ œ์— ๋Œ€ํ•œ ์„ธ๋ถ€์‚ฌํ•ญ์—์„œ โ€œ์ •๋ ฌโ€ ์„น์…˜๋ฅผ ๋ณด์„ธ์š”.

๊ทธ๋ž˜ํ”„ยถ

๊ทธ๋ž˜ํ”„๋Š” ์ปดํ“จํ„ฐ ๊ณผํ•™์˜ ์—ฌ๋Ÿฌ ๋ฌธ์ œ๋“ค์„ ํ‘œํ˜„ํ•˜๋Š” ๋ฐ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋‹ค. ๋•Œ๋ฌธ์— ์ด ์„น์…˜์€ ํŠธ๋ฆฌ๋‚˜ ์ •๋ ฌ ์„น์…˜์ฒ˜๋Ÿผ ๊ธธ๋‹ค.

Skiena์˜ ์ฑ…(์•„๋ž˜์˜ ์ฑ… ์„น์…˜ ์ฐธ์กฐ)๊ณผ ์ธํ„ฐ๋ทฐ ์ฑ…์—์„œ ๋” ๋งŽ์€ ๊ทธ๋ž˜ํ”„ ์‹ค์Šต์„ ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

๋” ๋งŽ์€ ์ง€์‹ยถ

์žฌ๊ท€ (recursion)ยถ

๋™์  ํ”„๋กœ๊ทธ๋ž˜๋ฐ (Dynamic Programming)ยถ

๋””์ž์ธ ํŒจํ„ดยถ

์กฐํ•ฉ๊ณผ ํ™•๋ฅ ยถ

NP, NP-์™„์ „, ๊ทผ์‚ฌ ์•Œ๊ณ ๋ฆฌ์ฆ˜ยถ

์ปดํ“จํ„ฐ๊ฐ€ ํ”„๋กœ๊ทธ๋žจ์„ ์ฒ˜๋ฆฌํ•˜๋Š” ๋ฐฉ์‹ยถ

์บ์‹œยถ

ํ”„๋กœ์„ธ์Šค์™€ ์“ฐ๋ ˆ๋“œยถ

ํ…Œ์ŠคํŠธยถ

๋ฌธ์ž์—ด ๊ฒ€์ƒ‰ & ์กฐ์ž‘ยถ

ํŠธ๋ผ์ดยถ

๋ถ€๋™ ์†Œ์ˆ˜์ ยถ

์œ ๋‹ˆ์ฝ”๋“œยถ

Endiannessยถ

๋„คํŠธ์›Œํฌยถ

์‹œ์Šคํ…œ ๋””์ž์ธ, ํ™•์žฅ์„ฑ, ๋ฐ์ดํ„ฐ ํ•ธ๋“ค๋งยถ


์ตœ์ข… ๊ฒ€ํ† ยถ

Text Only
์ด ์„น์…˜์—๋Š” ์ค‘์š”ํ•œ ๊ฐœ๋…๋“ค์„ ๋น ๋ฅด๊ฒŒ ๊ฒ€ํ† ํ•  ์ˆ˜ ์žˆ๋Š” ์งง์€ ์˜์ƒ๋“ค์ด ํฌํ•จ๋˜์–ด ์žˆ๋‹ค.  
๋ณต์Šต์„ ํ•˜๊ณ ์ž ํ•œ๋‹ค๋ฉด, ์ด ์˜์ƒ๋“ค์ด ๋„์›€์ด ๋  ๊ฒƒ์ด๋‹ค.

Additional Booksยถ

Text Only
์•„๋ž˜๋Š” ๋‹น์‹ ์ด ํฅ๋ฏธ๋กœ์›Œํ•˜๋Š” ์ฃผ์ œ์— ๋Œ€ํ•ด ๊ณต๋ถ€ํ•  ์ˆ˜ ์žˆ๋Š” ์ž๋ฃŒ๋“ค์ž…๋‹ˆ๋‹ค.
  • The Unix Programming Environment
  • an oldie but a goodie
  • The Linux Command Line: A Complete Introduction
  • a modern option
  • TCP/IP Illustrated Series
  • Head First Design Patterns
  • a gentle introduction to design patterns
  • Design Patterns: Elements of Reusable Object-Orienteโ€ƒd Software
  • aka the โ€œGang Of Fourโ€ book, or GOF
  • the canonical design patterns book
  • UNIX and Linux System Administration Handbook, 5th Edition
  • Algorithm Design Manual (Skiena)
  • As a review and problem recognition
  • The algorithm catalog portion is well beyond the scope of difficulty youโ€™ll get in an interview.
  • This book has 2 parts:
    • class textbook on data structures and algorithms
    • pros:
      • is a good review as any algorithms textbook would be
      • nice stories from his experiences solving problems in industry and academia
      • code examples in C
    • cons:
      • can be as dense or impenetrable as CLRS, and in some cases, CLRS may be a better alternative for some subjects
      • chapters 7, 8, 9 can be painful to try to follow, as some items are not explained well or require more brain than I have
      • donโ€™t get me wrong: I like Skiena, his teaching style, and mannerisms, but I may not be Stony Brook material.
    • algorithm catalog:
    • this is the real reason you buy this book.
    • about to get to this part. Will update here once Iโ€™ve made my way through it.
  • Can rent it on kindle
  • Answers:
  • Errata
  • Write Great Code: Volume 1: Understanding the Machine
  • The book was published in 2004, and is somewhat outdated, but itโ€™s a terrific resource for understanding a computer in brief.
  • The author invented HLA, so take mentions and examples in HLA with a grain of salt. Not widely used, but decent examples of what assembly looks like.
  • These chapters are worth the read to give you a nice foundation:
    • Chapter 2 - Numeric Representation
    • Chapter 3 - Binary Arithmetic and Bit Operations
    • Chapter 4 - Floating-Point Representation
    • Chapter 5 - Character Representation
    • Chapter 6 - Memory Organization and Access
    • Chapter 7 - Composite Data Types and Memory Objects
    • Chapter 9 - CPU Architecture
    • Chapter 10 - Instruction Set Architecture
    • Chapter 11 - Memory Architecture and Organization
  • Introduction to Algorithms
  • Important: Reading this book will only have limited value. This book is a great review of algorithms and data structures, but wonโ€™t teach you how to write good code. You have to be able to code a decent solution efficiently.
  • aka CLR, sometimes CLRS, because Stein was late to the game

  • Computer Architecture, Sixth Edition: A Quantitative Approach

  • For a richer, more up-to-date (2017), but longer treatment

  • Programming Pearls

  • The first couple of chapters present clever solutions to programming problems (some very old using data tape) but
    that is just an intro. This a guidebook on program design and architecture.

Additional Learningยถ

Text Only
๋‘๋ฃจ ๊ฐ–์ถ˜ ์†Œํ”„ํŠธ์›จ์–ด ์—”์ง€๋‹ˆ์–ด๊ฐ€ ๋˜๋Š”๋ฐ ๋„์›€์ด ๋ ๋งŒํ•œ ๊ฒƒ๋“ค์„ ์ถ”๊ฐ€ํ–ˆ์Šต๋‹ˆ๋‹ค. ์ด๋ฅผ ํ†ตํ•ด ๋” ํฐ ๋„๊ตฌ๋“ค์„ ๋‹ค๋ฃจ์‹ค ์ˆ˜ ์žˆ๊ฒŒ ๋˜์‹ค ๊ฒ๋‹ˆ๋‹ค.

AVL treesยถ

  • In practice:
    From what I can tell, these arenโ€™t used much in practice, but I could see where they would be:
    The AVL tree is another structure supporting O(log n) search, insertion, and removal. It is more rigidly
    balanced than redโ€“black trees, leading to slower insertion and removal but faster retrieval. This makes it
    attractive for data structures that may be built once and loaded without reconstruction, such as language
    dictionaries (or program dictionaries, such as the opcodes of an assembler or interpreter).
  • MIT AVL Trees / AVL Sort (video)
  • AVL Trees (video)
  • AVL Tree Implementation (video)
  • Split And Merge

Splay treesยถ

  • In practice:
    Splay trees are typically used in the implementation of caches, memory allocators, routers, garbage collectors,
    data compression, ropes (replacement of string used for long text strings), in Windows NT (in the virtual memory,
    networking and file system code) etc.
  • CS 61B: Splay Trees (video)
  • MIT Lecture: Splay Trees:
  • Gets very mathy, but watch the last 10 minutes for sure.
  • Video

2-3 search treesยถ


๋ช‡๋ช‡ ์ฃผ์ œ์— ๋Œ€ํ•œ ์„ธ๋ถ€์‚ฌํ•ญยถ

Text Only
์ด๋ฏธ ์–ธ๊ธ‰ํ•œ ๋ช‡๋ช‡์˜ ๊ฐœ๋…์— ๋Œ€ํ•œ ์„ค๋ช…์„ ์ข€ ๋” ๋ณด๊ฐ•ํ•˜๊ธฐ ์œ„ํ•ด์„œ ์ ์—ˆ์Šต๋‹ˆ๋‹ค.  
ํ•˜์ง€๋งŒ ๋”ํ•˜๊ธธ ์›ํ•˜์ง€ ์•Š์•˜์–ด์š”. ์™œ๋ƒ๋ฉด ๊ทธ ์–‘์ด ๋„ˆ๋ฌด๋‚˜ ๋ฐฉ๋Œ€ํ•˜๊ธฐ ๋•Œ๋ฌธ์ด์ง€์š”.   
ํ•˜๋‚˜์˜ ์ฃผ์ œ์— ๋Œ€ํ•˜์—ฌ ์ง€๋‚˜์น˜๊ฒŒ ๊นŠ๊ฒŒ ํŒŒ๊ณ ๋“œ๋Š” ๊ฒƒ์€ ์‰ฌ์šด ์ผ์ž…๋‹ˆ๋‹ค.  
์ด๋ฒˆ ์„ธ๊ธฐ์— ์ง์žฅ์„ ๊ตฌํ•˜๊ณ  ์‹ถ์œผ์‹œ์ž–์•„์š”, ๋งž์ฃ ?

Video Seriesยถ

ํŽธํ•˜๊ฒŒ ๋ณด์„ธ์š”. โ€œNetflix and skillโ€์ด๋ผ๋‹ˆ๊นŒ์š” :P

์ปดํ“จํ„ฐ ๊ณผํ•™ ๊ฐ•์˜๋“คยถ

ํ•™์ˆ  ์ž๋ฃŒ๋“คยถ


๋งˆ์ง€๋ง‰ ์—…๋ฐ์ดํŠธ : 2025๋…„ 4์›” 23์ผ
์ž‘์„ฑ์ผ : 2023๋…„ 4์›” 2์ผ