freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

datastructureinc樹狀結構-文庫吧在線文庫

2025-11-14 21:45上一頁面

下一頁面
  

【正文】 ode, 39。)。 re_nodellink != NULL) re_node = re_nodellink。 } /* 調(diào)整二元搜尋樹的鏈結, link為 r表示處理右鏈結,為 l表處理左鏈結, 為 m則將鏈結指向 NULL */ void connect(struct student *node, char link) { struct student *parent。 else /* link為 m */ parentllink = NULL。 } /* 搜尋 node的父節(jié)點 */ struct student *search_p(struct student *node) { struct student *parent。若是由大而小,則先將結果置於 stack中,以後再相反輸出 35 引線二元樹 ? 引線二元樹 (threaded binary tree) ? 一般二元樹中有一半以上的 link field是 null link,為便利儲存及節(jié)省 link欄位的浪費,將空的 link換成一種叫引線 (thread)的指標 ? 引線二元樹的資料結構 LB IT R B ITR LINKDATALL INK1. 當 LBIT=1時, LLINK是正常指標 2. 當 LBIT=0時, LLINK是引線 3. 當 RBIT=1時, RLINK是正常指標 4. 當 RBIT=0時, RLINK是引線 1 1─LBIT LL INK DA TA RLINK RBIT1 1A1 1B 1 1C1 1D 0 0E 1 1F 0 0G0 0H0 0I 0 0J 0 0K開頭節(jié)點 (不放置任何資料 ) 37 引線二元樹 (續(xù) ) ? 特性: ? 引線樹在做中序追蹤時不必使用 stack, 對任何一個節(jié)點平均只執(zhí)行一次 ? 在引線樹中毋需追蹤整個樹,可以由任何節(jié)點找到它中序次序的前一個或後一個節(jié)點 ? 對於加入或刪除一個節(jié)點則引線樹較慢,這是因為牽涉到引線的重排 38 引線二元樹 (續(xù) ) ? 引線二元樹的加入 1324S1324S5T1325S4T加T節(jié) 點於S節(jié) 點之右方 加T節(jié) 點於S節(jié) 點之左方void insert_right( struct tbintree *node_parent,struct tbintree *node) { struct tbintree *w。 wlchild = node。 if ( nodelbit == 1 ) /*node 底下還有 tree*/ { w = inpred( node )。 ptrrbit == 0 ) { if ( ptr_parent == root ) /*刪除第一個節(jié)點 */ { ptr_parentlchild = root。amp。 ptr_predrchild = root。 if(last_index = MAX) /* 資料數(shù)超過上限,顯示錯誤訊息 */ { printf(\n Login members are more than %d!!\n, MAX)。 /* 將資料新增於最後 */ adjust_u(heap_tree, last_index)。 *id1 = *id2。 del_index = search(id_temp)。 /* 找到則回傳資料在陣列中之 INDEX */ return 0。 id_temp = temp[index1]。 } } temp[index_temp/2] = id_temp。 (temp[index_temp] temp[index_temp+1])) index_temp++。amp。 } } } int search(int id_temp) /* 尋找陣列中 ID_TEMP所在 */ { int c_index。 printf( Please check again!!\n)。temp[index/2])。id_temp)。 } } else { if ( ptrnumber ptr_parentnumber ) ptr_parentlchild = ptrlchild。 ptr_parentlchild = ptrlchild。 } else /*刪除右節(jié)點 */ { ptr_parentrchild = ptrrchild。1321324pr evthispr ev l child = thislchil d。 noderchild = node_parent。 nodelbit = 0。 else if(strcmp(nodename, parentrlinkname) == 0) return parent。 else if(link == 39。) /* link為 r */ parentllink = noderlink。 while(re_node != NULL amp。 } /* 搜尋右子樹替代節(jié)點 */ struct student *search_re_r(struct student *node) { struct student *re_node。l39。 free(del_node)。 } 26 二元搜尋樹 (續(xù) ) ? 二元搜尋樹的刪除 ? 若刪除的是樹葉節(jié)點,則直接刪除之 ? 若刪除的不是樹葉節(jié)點,則在 左子樹找一最大的節(jié)點 或在 右子樹找一最小的節(jié)點 ,取代將被刪除的節(jié)點 27 二元搜尋樹 (續(xù) ) 5045654030 60456540306045654030 60取右子樹最小的節(jié)點 取左子樹最大的節(jié)點 /* 將資料從二元搜尋樹中移除 */ void removing(char name[]) { struct student *del_node。 } if(strcmp(ptrname, prevname) 0) prevllink = ptr。 strcpy(ptrname, name)。 preorder(treerlink)。 typedef struct node { int data。 inorder(treerlink)。 if(search(name)
點擊復制文檔內(nèi)容
教學課件相關推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1