資料結構›Ch5 樹狀結構
第 36 題/共 48 題
◀ DS 36/48
36. Binary Search Tree、刪除節點
#DS-05-036易Binary Search Tree刪除節點
題組題幹(本題:(b),共 2 小題)點擊展開

You are given an empty binary search tree (BST).

[Step 1] Please successively insert the data pairs containing the following keys 15, 8, 13, 18, 17, 6, 11, 14, 5 into the tree.

Note: In a tree, each step from top to bottom is called as level of a tree. The level count starts with 1 and increments by 1 at each level or step.

[2%] [Step 2] After Step 1 is executed, please delete the node containing 15 from the BST. To delete a nonleaf node, the pair to be deleted should be replaced by the largest pair in its left subtree or the smallest one in the right subtree. Which of the following keys is a suitable key to replace 15?

📄 成大113
跳轉到第題
▤完整推導請見《WH 資工筆記 · 資料結構》Ch5 樹狀結構
本章題號 · 21–40 / 48