看板 Grad-ProbAsk 關於我們 聯絡資訊
想請問2題 1.A list is sorted from smallest to largest when a sort is called. Which of the following sorts would take the shortest time in time complexity to sort the list? (1) Quick Sort (2) Bubble Sort (3) Selection Sort (4) Heap Sort 2.Recording an array of pointers to list elements, rather than sorting the elements themselves, is a good idea when (1)The number of elements is very large. (2)The individual elements are large in size. (3)The sort is recursive. (4)There are multiple keys on which to sort the elements. 想請問這二題的答案是4、1嗎? 不大確定 感謝回應^^ -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 220.134.38.221
privatewind:我選 1,2 01/20 08:39
privatewind:1如果是說sort前 list尚未排序,則1 01/20 08:40
privatewind: 如果sort前 已經排好了 則選2 01/20 08:40
privatewind:第二題, swap pointer比a large object簡單 01/20 08:41
alex817:感謝你的回答 01/27 22:47