五、請於下方標示之【待填入程式區塊】中,以 6 行內為限填入虛擬程式碼(pseudo-code),實 現將二元樹(以鏈結串列方式儲存)中每一節點的左子樹、右子樹皆調換之功能(示意如下, 交換前二元樹如【圖 1】,交換後二元樹如【圖 2】,以 t 表示父節點之指標,t→leftchild 表示 t 的左子節點指標,t→rightchild 表示 t 的右子節點指標)。(15 分)
詳解 (共 7 筆)
葉佩
詳解 #4388556
treetr p; p=t->l...
(共 144 字,隱藏中)
前往觀看
111考生
詳解 #5623848
pointer temp; \\宣告temp指標
temp = t->leftchild;
t->leftchile = t->rightchild; \\交換左右子樹
rightchild->temp;
Swaptree(t->leftchild);
Swaptree(t->rightchild);
蔡明勳
詳解 #5640308
使用遞迴(Recursion)的方式來實...
(共 375 字,隱藏中)
前往觀看
Lin Jin
詳解 #6118381
piano2489
詳解 #4635720
BFS版本queue que; //因為...
(共 316 字,隱藏中)
前往觀看
BRUMBY
詳解 #5185823
swap(t->leftchild...
(共 237 字,隱藏中)
前往觀看
shang
詳解 #6211699
私人筆記 (共 1 筆)
葉佩
私人筆記 #2649159
treetr p; p=t->l...
(共 142 字,隱藏中)
前往觀看