What this deck covers
This deck focuses on Sorting Algorithms, giving you a quick way to review the definitions, rules, and examples that matter most for AP Computer Science a.
Study Sorting Algorithms in AP Computer Science a with focused flashcards that help you recognize the idea, recall the key rule, and apply it in practice-style prompts.
0% Complete
Find the primary advantage of using Insertion Sort.
Tap card or press Space to flip
Efficient for small or nearly sorted arrays. Low overhead and adaptive behavior for special cases.
How well did you know it?
Card 1 / 72
Space to flip · ← / → to move · once flipped, → Got it · ← Still learning
This deck focuses on Sorting Algorithms, giving you a quick way to review the definitions, rules, and examples that matter most for AP Computer Science a.
Work through these flashcards in short sessions. Try to answer each prompt before flipping the card, then revisit any cards you miss until the explanation feels automatic.
Answer: Efficient for small or nearly sorted arrays. Low overhead and adaptive behavior for special cases.
Answer: O(log n). Recursion depth depends on partition quality.
Answer: Selecting the minimum element. Finds the smallest unsorted element and places it correctly.
Answer: O(log n). Recursion depth depends on partition quality.
Answer: Bubble Sort. Simple logic makes it ideal for teaching sorting concepts.
Answer: O(n2). Compares each adjacent pair multiple times through nested loops.
Answer: O(n log n). Good pivot selection typically yields optimal performance.
Answer: Sorting integers with a known range. Works when the range of values is small and known.
Answer: In-place sorting. Quick Sort uses constant space, while Merge Sort needs O(n) space.
Answer: O(nk). Time depends on number of digits k in the largest number.
Answer: O(n). Requires additional arrays for the merge operation.
Answer: Consistent O(n log n) time complexity. Guarantees optimal performance regardless of input distribution.
Answer: Radix Sort. Sorts by digit position rather than comparing elements directly.
Answer: Efficient for small or nearly sorted arrays. Low overhead and adaptive behavior for special cases.
Answer: O(nk). Time depends on number of digits k in the largest number.
Answer: Hybrid stable sorting algorithm. Combines merge sort stability with insertion sort efficiency.
Answer: Repeatedly swapping adjacent elements. Moves larger elements toward the end through adjacent swaps.
Answer: O(n). Requires additional arrays for the merge operation.
Answer: Repeatedly swapping adjacent elements. Moves larger elements toward the end through adjacent swaps.
Answer: O(k), where k is the range of input. Space grows with the range of input values.
Answer: Counting Sort. Works when input values have a small, known range.
Answer: O(1). Uses the input array itself as the heap structure.
Answer: O(n). Occurs when array is already sorted, no swaps needed.
Answer: O(n). Array is already sorted, requiring minimal shifts.
Answer: O(1). Uses the input array itself as the heap structure.
Answer: Inefficient O(n2) time complexity. Always performs same number of operations regardless of input.
Answer: Merge Sort. No random access needed, only sequential pointer operations.
Answer: Inefficiency for large datasets. Quadratic time complexity makes it impractical for large inputs.
Answer: Bubble Sort. Simple logic makes it ideal for teaching sorting concepts.
Answer: Hybrid stable sorting algorithm. Combines merge sort stability with insertion sort efficiency.
Answer: In-place sorting. Quick Sort uses constant space, while Merge Sort needs O(n) space.
Answer: O(n log n). Divide and conquer approach ensures consistent logarithmic depth.
Answer: Timsort. Adaptive hybrid algorithm optimized for real-world data.
Answer: Divides array into two parts for sorting. Separates elements smaller and larger than the pivot.
Answer: Timsort. Adaptive hybrid algorithm optimized for real-world data.
Answer: Building a max-heap and sorting. Creates heap structure then repeatedly extracts the maximum.
Answer: Sorting integers with a known range. Works when the range of values is small and known.
Answer: Counting Sort. Works when input values have a small, known range.
Answer: Insertion Sort. Insertion Sort has lower overhead for small arrays.
Answer: Merge Sort. Stability and sequential access make it ideal for linked structures.
Answer: Building a max-heap and sorting. Creates heap structure then repeatedly extracts the maximum.
Answer: O(k), where k is the range of input. Space grows with the range of input values.
Answer: O(n2). Occurs when pivot is always the smallest or largest element.
Answer: Merge Sort. Merge Sort preserves relative order of equal elements.
Answer: O(n log n). Good pivot selection typically yields optimal performance.
Answer: Inefficiency for large datasets. Quadratic time complexity makes it impractical for large inputs.
Answer: O(n2). Compares each adjacent pair multiple times through nested loops.
Answer: Timsort. Hybrid algorithm combining merge sort and insertion sort.
Answer: O(n log n). Divide and conquer approach ensures consistent logarithmic depth.
Answer: Merge Sort. Stability and sequential access make it ideal for linked structures.
Answer: Preserve relative order of equal keys. Equal elements maintain their original relative positions.
Answer: Insertion Sort. Insertion Sort has lower overhead for small arrays.
Answer: O(n2). Always performs the same number of comparisons regardless of input.
Answer: Poor worst-case performance. Can degrade to O(n2) with poor pivot selection.
Answer: Selecting the minimum element. Finds the smallest unsorted element and places it correctly.
Answer: Divides array into two parts for sorting. Separates elements smaller and larger than the pivot.
Answer: O(n2). Always performs the same number of comparisons regardless of input.
Answer: Inefficient O(n2) time complexity. Always performs same number of operations regardless of input.
Answer: Merge Sort. Sequential access pattern suits external storage devices.
Answer: Preserve relative order of equal keys. Equal elements maintain their original relative positions.
Answer: O(n). Array is already sorted, requiring minimal shifts.
Answer: Insertion Sort. Adapts well to existing order, requiring fewer operations.
Answer: O(n). Occurs when array is already sorted, no swaps needed.
Answer: Timsort. Hybrid algorithm combining merge sort and insertion sort.
Answer: Poor worst-case performance. Can degrade to O(n2) with poor pivot selection.
Answer: Merge Sort. Merge Sort preserves relative order of equal elements.
Answer: O(n2). Occurs when pivot is always the smallest or largest element.
Answer: Consistent O(n log n) time complexity. Guarantees optimal performance regardless of input distribution.
Answer: Merge Sort. No random access needed, only sequential pointer operations.
Answer: Insertion Sort. Adapts well to existing order, requiring fewer operations.
Answer: Radix Sort. Sorts by digit position rather than comparing elements directly.
Answer: Merge Sort. Sequential access pattern suits external storage devices.