Algorithms Flashcards
1
Q
Bubble sort
A
A simple comparison-based algorithm where each pair of adjacent elements is compared and swapped if they are in the wrong order. Repeated until the array is sorted
2
Q
Merge sort
A
A divide-and-conquer algorithm that divides the array into halves, recursively sorts each half, and then merge the sorted halves
3
Q
Quick sort
A
Dive and conquer algorithm that selects a pivot, partitions the array around the pivot, and recursively sorts the partitions
4
Q
Linear search
A
Sequentially checks each element of the list until the target value is found or the list ends
5
Q
Binary search
A
Efficiently searches a sorted array by repeatedly dividing the search interval in half