One can sort an array a[] as follows. Start by observing that at stage 0, the array segment consisting of the single element a[0] is sorted. Now suppose that at the stage k, the segment a[0..k] is sorted. Take the element a[k+1], and call it X. By moving some of the elements in a[0..k] one place to the right, create a place to put X in so that now a[0..k+1] is sorted. The algorithm that uses this strategy is called
A) bubble sort
B) insertion sort
C) selection sort
D) Quicksort
B) insertion sort
Computer Science & Information Technology
You might also like to view...
The policy allows people to pass tasks and responsibilities to other team members
What will be an ideal response?
Computer Science & Information Technology
What security term describes a program written to collect information and store it on the hard drive?
A) Virus B) Intrusion detection and alerts C) Cookie D) Authentication
Computer Science & Information Technology