The sort usually performs fewer exchanges than the sort bu

The _________ sort usually performs fewer exchanges than the __________ sort. bubble, selection selection, bubble binary, linear linear, binary linear, bubble A search can be performed on an array of integers. strings. Objects. All of these. integers and strings, but not objects. To locate a value in an ordered array of 100 items, binary search must examine at most _________ values. 7 10 50 100 101

Solution

Ans 13>

The Selection sort usually perform fewer exchanges than the Bubble sort.

Reason:

Selection sort:

First scan the entire list before locating the exact pair of numbers to swap. So swapping is O(n).

Bubble sort:

we compare two consecutive elements and then swap those elements if they are are out of order.

So swapping is O(n^2).

We can clearly seen that selection sort perform lesser exchange then bubble sort.

Ans 14>

All of the above

We can search integer, string and object also.

Ans 15>

To locate a value in an ordered array of 100 items. Binary search must examine at most 7 values.

To calculate : The complexity of binary search is log(N) values. So, binary search examine at most log(N) values. Therefore,

log(100) is approx 7 , which means binary search examines at most 7 values.

 The _________ sort usually performs fewer exchanges than the __________ sort. bubble, selection selection, bubble binary, linear linear, binary linear, bubble

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site