The sort usually performs fewer exchanges than the sort bu
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.
