看板 Grad-ProbAsk 關於我們 聯絡資訊
※ 引述《taitin (小南)》之銘言: : 這是我自己寫的答案,希望跟大家討論一下 : 附上題目 : http://www.lib.ntu.edu.tw/exam/graduate/98/98404.pdf : 3. : unsorted sorted unsorted sorted : singly singly doubly doubly : linked linked linked linked : search B B B B : INSERT A B A B : DELETE B B A A : SUCCESOR A A A A : PREDECESSOR B B A A : minimum B A B A : maximum B A B A : : : (3) A is suitable : Because B is not suitable when there has negative length. : consider a graph : 4 : ------- : / \ : a---c---b : 5 -1 : start from a : algo B will choose the shortest edge AB : and never look back. : but algo A will check all the edges.so it is suitable : 希望也有寫這分考卷的朋友可以一起討論 : 有錯請不吝指教 不好意思 因為文章太長他不給我貼 所以才砍一部分文章 sorry 想問一下這兩題 其中第3題的9-20格他不是都給ptr了嗎?? 為何還要花O(n)啊?? 還有22 跟 26格不是一個填A另一個就要B嗎 因為假設sort是遞增min就O(1) max不就要O(n)嗎 因為要從第一個一到最後一個ptr 至於最後一提的第3小提 還是不知道要選A or B以及選的理由 煩請解惑 謝謝 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 219.70.227.147