資料結構›Ch5 樹狀結構第 20 題/共 48 題
20. Binary Search Tree、NULL Pointers
#DS-05-020易Binary Search TreeNULL Pointers
- (a) 4%
class Node {
public int v;
public Node lc;
public Node rc;
public Node p;
}
The above is pseudo-code defining a Node class used in a binary search tree . In the Node, v stores the key value, lc and rc are the pointers to the left child and right child, respectively, and p is the pointer to the parent. If contains a single node X, then X.p, X.lc, X.rc are NULL. There are 3 NULL pointers in . Show that there are NULL pointers in , where is an -node binary search tree.
📄 交大115
▤完整推導請見《WH 資工筆記 · 資料結構》Ch5 樹狀結構