(a) You are running a library catalog. You know that the books in your collection are almost in sorted ascending order by title, with the exception of one book which is in the wrong place. You want the catalog to be completely sorted in ascending order. 1. Insertion Sort 2. Merge Sort 3. Radix Sort 4. Quick Sort 5. Counting Sort (b) You are working on an embedded device (an ATM) that only has 4KB (4,096 bytes) of free memory, and you wish to sort the 2,000,000 transactions withdrawal history by the amount of money withdrawn (discarding the original order of transactions). 1. Insertion Sort 2. Merge Sort 3. Radix Sort 4. Quick Sort 5. Counting Sort
Added by Salvador H.
Close
Step 1
Insertion Sort is efficient for small data sets and performs well when the data is already partially sorted. Since most of the books are already in the correct order, Insertion Sort would require minimal comparisons and swaps to sort the entire catalog. Show more…
Show all steps
Your feedback will help us improve your experience
Rashmi Sinha and 52 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
Select the correct alternative from the given choices. Linked list are not suitable for implementing (A) Insertion sort (B) Binary search (C) Radix sort (D) Polvnomial manipulation
Programming and Data Structures
Linked Lists, Stacks and Queues
Sort these lists using the selection sort. $\begin{array}{ll}{\text { a) } 3,5,4,1,2} & {\text { b) } 4,3,2,1} \\ {\text { c) } 1,2,3,4,5}\end{array}$
Algorithms
Akash M.
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
Transcript
Watch the video solution with this free unlock.
EMAIL
PASSWORD