資料結構›Ch5 樹狀結構
第 20 題/共 48 題
◀ DS 20/48
20. Binary Search Tree、NULL Pointers
#DS-05-020易Binary Search TreeNULL Pointers
  1. (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 TT. 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 TT contains a single node X, then X.p, X.lc, X.rc are NULL. There are 3 NULL pointers in TT. Show that there are n+2n+2 NULL pointers in TT, where TT is an nn-node binary search tree.

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