作者NOtWorThy (分子小於64)
看板Grad-ProbAsk
标题Re: [理工] [资结]-台大98-软体设计 对答
时间Tue Feb 16 12:20:02 2010
※ 引述《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