看板 Grad-ProbAsk 關於我們 聯絡資訊
這是洪逸小考的題目,因為上的數位課程沒辦法問老師 https://imgur.com/rSDGMd4 請問這題答案為什麼是False,用中序追蹤印出來花O(n)不正確嗎? https://imgur.com/VOKnOsw 這題答案是False 我想法是說3個n個元素陣列合併後,建立AVL時間只需要O(n)即可嗎? -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 36.238.126.9 ※ 文章網址: https://www.ptt.cc/bbs/Grad-ProbAsk/M.1548351762.A.A10.html
ponponjerry: 上面那題heap不是BST,中序印出來不會是in order 01/25 01:55
nthuscott: 上面那題 https://stackoverflow.com/questions/811084 01/25 02:04
nthuscott: 4/print-a-tree-in-sorted-order-using-heap-propertie 01/25 02:04
nthuscott: s-cormen 01/25 02:04
nthuscott: 縮網址... https://goo.gl/eCtRzP 01/25 02:10
doggying123: 沒看仔細是Heap 一直在注意時間問題 XD感謝樓上兩位 01/25 02:10
doggying123: 大大 想請教第二題 01/25 02:10
rockieloser: 他已經Sorted了 直接Build就O(n) 01/25 02:19
nthuscott: rockie大講出大部分啦 我上網查找到這份文件 第一題就 01/25 02:22
nthuscott: 是 https://goo.gl/qxFQ3a 01/25 02:22
doggying123: 感謝n大的文件 又有題目可以練習xd 01/25 17:09