Question: Q5 Answer the following questions. (Marks 12) If array elements are 8, 22, 7, 9, 31, 5, 13, what will be the total number of
Q5
Answer the following questions. (Marks 12)
- If array elements are 8, 22, 7, 9, 31, 5, 13, what will be the total number of swaps needed to sort the numbers by using bubble sort sorting algorithm?
- What is time complexity of bubble sort when array is already sorted?
- What is similarity between efficiency of selection sort and bubble sort as long as the time complexity is concerned?
- If array elements are 14, 33, 27, 35, 10, what will be the order of elements?
- Let suppose swap operation is very costly in a particular situation. Which sorting algorithm should be used such that the number of swaps are reduced? Support your answer using appropriate example. You may use pseudo code representation.
- Consider insertion sort, selection sort, merge sort and quick sort algorithms. Arrange them in order with respect to their time Complexity in the best case?
please answers all these short question dont leave anyone.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
