A set of step-by-step instructions a computer follows to solve a problem.
A set of instructions to arrange a list of items into a specific order.
Compares adjacent items and swaps them if they are in the wrong order, repeating until the list is sorted.
Picks a 'pivot' element and partitions the other elements into two sub-arrays, according to whether they are less than or greater than the pivot.
Builds the final sorted list one item at a time, by taking one item and inserting it into its correct position in the already sorted part.
A method used to find a specific item within a collection of data.
Checks each item in a list one by one, from the beginning, until a match is found or the end of the list is reached.
Repeatedly divides the search interval in half to find an item. It only works on a sorted list.
A data structure that follows the Last-In, First-Out (LIFO) principle.
A data structure that follows the First-In, First-Out (FIFO) principle.
Stands for Last-In, First-Out. The last item added is the first item to be removed.
Stands for First-In, First-Out. The first item added is the first item to be removed.
The element chosen in the Quick Sort algorithm to help partition the list.
The list of data must already be sorted.
A stack of plates - you take the top one off first.
A line of people waiting - the first person in line is the first person served.
Sorting and Searching.
The process of checking if data entered by a user meets certain criteria before it is processed.
An algorithm to count how many times a specific item appears in a list.
Items are added to the back (end) of the queue.
Items are removed from the front of the queue.
Known as 'Pushing'. Items are added to the top of the stack.
Known as 'Popping'. Items are removed from the top of the stack.
It is simple to understand but not very efficient for large lists.
Very efficient for searching large, sorted lists because it halves the search area with each step.