資料結構›Ch5 樹狀結構
第 40 題/共 48 題
◀ DS 40/48
40. Binary Tree、遞迴、Traversal
#DS-05-040易Binary Tree遞迴Traversal
題組題幹(本題:(i),共 2 小題)點擊展開
  1. [2%, 2%] The following data structure represents a binary tree, and it contains a function named "unknown".
struct node{
    int data;
    struct node *left, *right;
};

void unknown(struct node *p) {
    struct node *q;
    if (p->left != NULL) unknown(p->left);
    if (p->right != NULL) unknown(p->right);
    q = p->left;
    p->left = p->right;
    p->right = q;
}

(i) Which of the order does the function perform?

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