Fiveable
Fiveable

Sorting

Definition

Sorting refers to arranging a collection of items in a specific order, such as ascending or descending order, based on certain criteria.

Analogy

Imagine you have a deck of cards that are all mixed up. Sorting them would mean arranging them in numerical order from Ace to King for each suit.

Related terms

Algorithm: An algorithm is a step-by-step procedure used to solve problems or perform operations, such as sorting.

Comparison Operator: A comparison operator is used to compare two values and determine their relationship (e.g., greater than, less than).

Stable Sort: A stable sort algorithm maintains the relative order of equal elements during sorting.

"Sorting" appears in:



© 2024 Fiveable Inc. All rights reserved.

AP® and SAT® are trademarks registered by the College Board, which is not affiliated with, and does not endorse this website.


© 2024 Fiveable Inc. All rights reserved.

AP® and SAT® are trademarks registered by the College Board, which is not affiliated with, and does not endorse this website.