Banks often record transactions on an account in order of the times of the transactions, but many people like to receive their bank statements with checks listed in order by check number. People usually write checks in order by check number, and merchants usually cash them with reasonable dispatch. The problem of converting time-of-transaction ordering to check-number ordering is therefore the problem of sorting almost-sorted input. What sorting algorithm would work best for this case? a. Insertion sort algorithm b. Merge-Sort algorithm c. Heap-Sort algorithm d. Quick-Sort algorithm e. Counting-Sort algorithm

Question

I was told the answer is insertion sort, but I am not sure

Banks often record transactions on an account in order of the times of the transactions, but
many people like to receive their bank statements with checks listed in order by check
number. People usually write checks in order by check number, and merchants usually
cash them with reasonable dispatch. The problem of converting time-of-transaction ordering
to check-number ordering is therefore the problem of sorting almost-sorted input. What
sorting algorithm would work best for this case?
a. Insertion sort algorithm
b. Merge-Sort algorithm
c. Heap-Sort algorithm
d. Quick-Sort algorithm
e. Counting-Sort algorithm
Transcribed Image Text:Banks often record transactions on an account in order of the times of the transactions, but many people like to receive their bank statements with checks listed in order by check number. People usually write checks in order by check number, and merchants usually cash them with reasonable dispatch. The problem of converting time-of-transaction ordering to check-number ordering is therefore the problem of sorting almost-sorted input. What sorting algorithm would work best for this case? a. Insertion sort algorithm b. Merge-Sort algorithm c. Heap-Sort algorithm d. Quick-Sort algorithm e. Counting-Sort algorithm
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps

Blurred answer