Free Online Flashcard Deck

9 Sorting Algorithms Free Online FlashCards

Study 9 Sorting Algorithms with 12 free online flashcards. Review key terms, definitions, and concepts with this interactive flashcard deck.

12 cards
01
Front

What is sorting?

Back

Sorting rearranges items into a specified order, such as ascending numerical order or alphabetical order.

02
Front

What lower bound applies to comparison sorting?

Back

Comparison-based algorithms cannot guarantee a worst-case running time better than Ω(nlog⁡n)\Omega(n \log n) for nn arbitrary items.

03
Front

What does sorting stability mean?

Back

A stable sort preserves the original relative order of records with equal keys.

04
Front

How does bubble sort move elements?

Back

Bubble sort repeatedly compares adjacent elements and swaps them when they are out of order.

05
Front

When is bubble sort linear?

Back

With an early-exit test, bubble sort has a best-case time of O(n)O(n) when a pass makes no swaps.

06
Front

What is selection sort’s central operation?

Back

Selection sort repeatedly finds the smallest item in the unsorted portion and swaps it into the first unsorted position.

07
Front

Why choose selection sort?

Back

Selection sort is useful when minimizing swaps matters, because it performs only about nn swaps despite making O(n2)O(n^2) comparisons.

08
Front

How does insertion sort build order?

Back

Insertion sort builds a sorted prefix by shifting larger elements right and inserting the next value into the gap.

09
Front

What is an inversion?

Back

An inversion is a pair of elements that appears in the opposite order from the desired ordering.

10
Front

When is insertion sort a strong choice?

Back

Insertion sort is often effective for small or nearly sorted arrays because its best-case time is O(n)O(n).

11
Front

What are merge sort’s three stages?

Back

Merge sort divides the array, recursively sorts both halves, and merges the two sorted halves.

12
Front

What is merge sort’s time complexity?

Back

Merge sort runs in O(nlog⁡n)O(n \log n) time in the best, average, and worst cases.