hard20 pts · first answer countssorting-and-searching
Insertion sort comparisons on reversed input
Standard insertion sort compares the new item with items to its left until it finds its place. How many comparisons does it make on [5, 4, 3, 2, 1]?
Discussion 0
Join free to post in the discussion.
Related questions
- Bubble sort best case with early exitBackend Developer
- What a stable sort meansBackend Developer
- Merge sort time in every caseBackend Developer
- Best simple sort for nearly sorted dataBackend Developer
- Swaps made by selection sortBackend Developer
- What in-place sorting meansBackend Developer
- Quick sort worst-case timeBackend Developer
- JavaScript default sort on numbersBackend Developer