Re: [問題] 資結-是非題..

看板Grad-ProbAsk作者 (一路發 圍巾)時間17年前 (2009/04/05 09:15), 編輯推噓0(001)
留言1則, 1人參與, 最新討論串3/3 (看更多)
※ 引述《bernachom (Terry)》之銘言: : 1. For a complete binary tre represented in memory as an array,if there is : a node at index 4i+3 it must be a child of a child (grandchild) of the : node at i. (1) / \ (2) (3) / \ / \ (4) (5) (6) (7) / \ / \ / \ / \ (8) (9)(10)(11) (12)(13)(14)(15) / \ / \ (16)(17)(18)(19) aussume node i is forth, then the children (8) and (9) are 2i and 2i+1, respectively. Also, grandchild (19) is 4i+3. : 2. Searching for a key in a heap takes worst-case time O(n). : 解答寫: 1.T 2.T : 第一題我不太清楚... : 第二題最差的case 不是應該為nlogn才是嗎? : 謝謝 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 61.216.9.112

04/05 14:09, , 1F
謝謝幫忙,我知道了
04/05 14:09, 1F
文章代碼(AID): #19s0Oqap (Grad-ProbAsk)
文章代碼(AID): #19s0Oqap (Grad-ProbAsk)