์ž๋ฃŒ๊ตฌ์กฐ) Tree - Binary Search Tree, Segment Tree, Binary Indexed Tree

Binary Search Tree (์ด์ง„ ํƒ์ƒ‰ ํŠธ๋ฆฌ) def ๋ชจ๋“  ์›์†Œ๋Š” ์„œ๋กœ๋‹ค๋ฅธ ์œ ์ผํ•œ ๊ฐ’. ์™ผ์ชฝ subtree์˜ ๊ฐ’์€ ๊ทธ root๋ณด๋‹ค ์ž‘๋‹ค. ์˜ค๋ฅธ์ชฝ subtree์˜ ๊ฐ’์€ ๊ทธ root๋ณด๋‹ค ํฌ๋‹ค. ์™ผ/์˜ค๋ฅธ์ชฝ subtree๋„ Binary Search Tree์ด๋‹ค. ํƒ์ƒ‰/์‚ฝ์ž…/์‚ญ์ œ ์ค‘ ์‚ญ์ œ์—ฐ์‚ฐ์ด ๋ฒˆ๊ฑฐ๋กญ๋‹ค. ๋…ธ๋“œ๋ฅผ ์‚ญ์ œํ•œ ํ›„์—๋„ BST๋ฅผ ์œ ์ง€ํ•ด์•ผํ•˜๋ฏ€๋กœ ํ›„์†์กฐ์น˜๊ฐ€ ํ•„์š”ํ•˜๋‹ค. ์‚ญ์ œํ•  ๋…ธ๋“œ๊ฐ€ 1. degree=0(leaf node)์ธ์ง€ 2. degree=1์ธ์ง€ 3. degree=2์ธ์ง€์— ๋”ฐ๋ผ ๋‹ฌ๋ผ์ง. Segment Tree ๊ตฌ๊ฐ„์˜ ์ •๋ณด๋ฅผ ๋น ๋ฅด๊ฒŒ ๊ตฌํ• ์ˆ˜์žˆ๋Š”, Complete Binary Tree ํ˜•ํƒœ์˜ ์ž๋ฃŒ๊ตฌ์กฐ Example) ๊ตฌ๊ฐ„ ์ตœ์†Œ๊ฐ’์„ ๊ตฌํ•˜๋Š” Segment Tree ๊ตฌํ•˜๋ ค๋Š” ๋ฐ์ดํ„ฐ ๋ฐฐ์—ด์„ ์™„์ „์ด์ง„ํŠธ๋ฆฌ์˜ ์ตœํ•˜๋‹จ์—..

Data Structure 2019. 9. 12. 19:20
๊ณต์ง€์‚ฌํ•ญ
์ตœ๊ทผ์— ์˜ฌ๋ผ์˜จ ๊ธ€
์ตœ๊ทผ์— ๋‹ฌ๋ฆฐ ๋Œ“๊ธ€
Total
Today
Yesterday
๋งํฌ
ยซ   2024/11   ยป
์ผ ์›” ํ™” ์ˆ˜ ๋ชฉ ๊ธˆ ํ† 
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
๊ธ€ ๋ณด๊ด€ํ•จ