Computer Science/Algorithm

[Algorithm] Sorting algorithm

LeeJaeJun 2023. 12. 26. 23:12
728x90
반응형

Sorting Algorithms

 

Sorting Algorithms Animations

www.toptal.com

  • Sorting has been commonly used as the pre-processed method for searching and matching.
    • Sorting is also used as the basic solution for many other complex problem.
    • In most organization, more than 25% of computing time is spent on sorting.
  • No best algorithm for any situation: initial ordering and size of list.
    • That why we need to know several techniques.
    • The analysis of lower bound is good for understanding basic skill for algorithm analysis.
  • Comparison sort vs Non-comparison sort
    • Comparative sorting algorithm determines the order of two element through a comparison operator.
    • Comparison sorting algorithms:
      • Selection sort, Bubble sort, Insertion sort, Quick sort and so on.
    • Non-comparison sorting algorithms:
      • Radix sort, Bucket sort, Counting sort
    • Non-comparison sort is also called a linear sorting method.
  • Internal sort vs External sort
    • Internal sorting technique is for the case where the list is small enough to sort entirely in main memory.
      • Minimizing the number of comparisons.
      • Heap sort
    • External sorting technique is used when the list is too big to fit into main memory (e.g., disk and SSD)
      • The alignment of the entire data is done in the auxiliary memory. 
      • Minimizing the number of I/O accesses.
      • Balanced sort, Cascade Sort, Polyphase Sort
  • Stability of Sorting Algorithms
    • Stable sorting algorithms maintain the relative order of records with equal keys.
    • The initial order of records with eqaul keys does not changed.

 

728x90
반응형

'Computer Science > Algorithm' 카테고리의 다른 글

[Algorithm] Shell sort  (0) 2023.12.26
[Algorithm] Bubble sort  (0) 2023.12.26
[Algorithm] Selection sort  (0) 2023.12.26
[Algorithm] Graph traversal(DFS, BFS)  (0) 2023.12.26
[Algorithm] Priority Queue and Heap  (1) 2023.12.26