Searching and Sorting Algorithms (OCR A-Level Computer Science): Flashcards
📚Flashcards
Practise the cards
15 cards from this deck
ShowHide
Practise the cards
15 cards from this deck
Purpose of searching algorithms
Purpose of searching algorithms
Locate specific data within a collection
Purpose of sorting algorithms
Purpose of sorting algorithms
Arrange data in specific order (ascending/descending)
Linear Search pre-condition
Linear Search pre-condition
None - works on sorted & unsorted data
Binary Search pre-condition
Binary Search pre-condition
Data must be sorted in ascending or descending order
Linear Search time complexity
Linear Search time complexity
Binary Search time complexity
Binary Search time complexity
How Linear Search works
How Linear Search works
Searches each element sequentially
How Binary Search works
How Binary Search works
Repeatedly divides search interval in half
How Bubble Sort works
How Bubble Sort works
Repeatedly swaps adjacent elements if in wrong order
Bubble Sort worst case complexity
Bubble Sort worst case complexity
How Insertion Sort works
How Insertion Sort works
Builds sorted list one item at a time
Merge Sort complexity (all cases)
Merge Sort complexity (all cases)
How Merge Sort works
How Merge Sort works
Divides array into halves, sorts each, then merges
Quick Sort worst case complexity
Quick Sort worst case complexity
- due to poor pivot selection
How Quick Sort works
How Quick Sort works
Partitions array around pivot, recursively sorts partitions
