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 ? | 16 Yes | 2 No |
Post New Answer View All Answers
Can we extend an array after initialization?
Can you list out the areas in which data structures are applied extensively?
Describe linear probing with an example.
Is hashmap an object?
List the data structures which are used in rdbms, network data modal, and hierarchical data model.
Which time complexity is best?
What are the complexity of binary search?
Write the recursive c function to count the number of nodes present in a binary tree.
What is difference between treeset hashset linkedhashset?
What are the applications of stack?
Why is data structure important?
What do you mean by shortest path?
What are the different binary tree traversal techniques?
How do you assign an address to an element of a pointer array ?
What is merge sort and how it works?