Sorting methods Summary

  • A sequential search is O(n) for ordered and unordered lists.
  • A binary search of an ordered list is O(logn) in the worst case.
  • Hash tables can provide constant time searching.
  • A bubble sort, a selection sort, and an insertion sort are O(n2) algorithms.
  • A shell sort improves on the insertion sort by sorting incremental sublists. It falls between O(n) and O(n2).
  • A merge sort is O(nlogn), but requires additional space for the merging process.
  • A quick sort is O(nlogn), but may degrade to O(n2) if the split points are not near the middle of the list. It does not require additional space.
發佈了5 篇原創文章 · 獲贊 3 · 訪問量 9525
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章