What is sorting?
Sorting rearranges items into a specified order, such as ascending numerical order or alphabetical order.
Study 9 Sorting Algorithms with 12 free online flashcards. Review key terms, definitions, and concepts with this interactive flashcard deck.
What is sorting?
Sorting rearranges items into a specified order, such as ascending numerical order or alphabetical order.
What lower bound applies to comparison sorting?
Comparison-based algorithms cannot guarantee a worst-case running time better than Ω(nlogn) for n arbitrary items.
What does sorting stability mean?
A stable sort preserves the original relative order of records with equal keys.
How does bubble sort move elements?
Bubble sort repeatedly compares adjacent elements and swaps them when they are out of order.
When is bubble sort linear?
With an early-exit test, bubble sort has a best-case time of O(n) when a pass makes no swaps.
What is selection sort’s central operation?
Selection sort repeatedly finds the smallest item in the unsorted portion and swaps it into the first unsorted position.
Why choose selection sort?
Selection sort is useful when minimizing swaps matters, because it performs only about n swaps despite making O(n2) comparisons.
How does insertion sort build order?
Insertion sort builds a sorted prefix by shifting larger elements right and inserting the next value into the gap.
What is an inversion?
An inversion is a pair of elements that appears in the opposite order from the desired ordering.
When is insertion sort a strong choice?
Insertion sort is often effective for small or nearly sorted arrays because its best-case time is O(n).
What are merge sort’s three stages?
Merge sort divides the array, recursively sorts both halves, and merges the two sorted halves.
What is merge sort’s time complexity?
Merge sort runs in O(nlogn) time in the best, average, and worst cases.
A progressive guide to how computers encode numbers, text, images, and sound as binary data, including the trade-offs and limits of digital representation.
A focused set of flashcards covering Python variables, data types, expressions, control flow, functions, input, output, and common programming practices.
Learn how Boolean expressions, logical operators, and conditional structures let programs make reliable decisions, including how to handle boundaries, branch order, and testing.
A structured guide to the main data structures, their operations, efficiency trade-offs, representations, and practical selection criteria.
A progressive guide to tree structure, binary-tree traversals, binary search tree operations, deletion, balancing, and the way tree height determines time and space costs.
A progression through how data is organized, searched, exposed through software interfaces, and managed through abstraction layers in modern computer systems.
A medium-difficulty quiz on integrating problem definition, representation, algorithms, complexity analysis, testing, correctness, ethical evaluation, and documentation in a computer science capstone.
A practical guide to integrating problem definition, data representation, modular programming, algorithms, complexity analysis, testing, correctness, and ethical evaluation into a responsible computer science capstone.
This quiz covers process management, context switching and scheduling, multitasking, traps and interrupts, and RISC-V privilege transitions.