A list is ordered from smaller to largest when a sort is
called. Which sort would take the longest time to execute?
Answer Posted / uma sankar pradhan
selection sort,quick sort,bubble sort
(all will take the same time and its time complexity is of
the order of n^2)
the time complexity for insertion sort when the list is
ordered from smaller to larger is O(n)
the time complexity for merge sort irrespective of the
order of the elements is O(nlogn)
| Is This Answer Correct ? | 17 Yes | 2 No |
Post New Answer View All Answers
Is heap sort adaptive?
List the data structures which are used in rdbms.
Write program for Quick sort ?
Will this code give error if I try to add two heterogeneous elements in the arraylist? And why?
Explain the terms base case, recursive case, binding time, run-time stack and tail recursion.
What is the use of data structure?
Write a program to sum values of given array.
What is the difference between file structure and storage structure?
What is impact of signed numbers on the memory using data structures?
When ArrayIndexOutOfBoundsException occurs?
What is ascending and descending order?
Which interfaces are implemented by hashmap?
Which is the simplest file structure? (a) Sequential (b) Indexed (c) Random (a) Sequential
Can arraylist store primitives?
Can you tell me the differences between Array and ArrayList?