Free Online Flashcard Deck

09 Sorting Algorithms Free Online FlashCards

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

12 cards
01
Front

What makes a sorting result correct?

Back

A correct sort produces an ordered sequence containing exactly the input elements; it changes their arrangement, not the data.

02
Front

What does stability mean in sorting?

Back

Stability preserves the original relative order of records with equal keys.

03
Front

How does selection sort arrange elements?

Back

Selection sort repeatedly finds the smallest element in the unsorted region and swaps it into the next output position.

04
Front

How does insertion sort build a sorted array?

Back

Insertion sort builds a sorted prefix one element at a time, shifting larger elements right to insert the next element.

05
Front

What operation drives bubble sort?

Back

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

06
Front

What is merge sort’s divide-and-conquer strategy?

Back

Merge sort divides the input into halves, recursively sorts each half, and merges the sorted halves.

07
Front

What is the central operation in quicksort?

Back

Quicksort partitions around a pivot, recursively sorts the smaller and larger partitions, and combines them around the pivot.

08
Front

Why can quicksort degrade to quadratic time?

Back

Quicksort has average-case O(nlog⁡n)O(n \log n) time with suitable pivots, but poor repeatedly unbalanced partitions cause O(n2)O(n^2) worst-case time.

09
Front

How does heap sort produce ascending order?

Back

Heap sort builds a max-heap, repeatedly moves the maximum root to the end, and restores the heap property.

10
Front

What is the worst-case lower bound for comparison-based sorting?

Back

A comparison-based sort has a worst-case lower bound of Ω(nlog⁡n)\Omega(n \log n) for arbitrary input. Counting sort and radix sort can avoid this bound by using assumptions about the keys.

11
Front

What does in-place mean for a sorting algorithm?

Back

An in-place algorithm uses only a small amount of extra memory while rearranging the input collection. The standard implementations of selection, insertion, bubble, and heap sort are in-place.

12
Front

What does extra space measure in sorting?

Back

Extra space is the memory required beyond the input collection. For example, an array implementation of merge sort usually requires O(n)O(n) extra space, while standard heap sort uses O(1)O(1).