A list is ordered from smaller to largest when a sort is
called. Which sort would take the shortest time to execute?
Answers were Sorted based on User's Feedback
Answer / sourav naskar
quick sort cant be the answer as this methods works best
when the list is completely unsorted.In this the method
would have worked best if it is descendingly sorted.As it
is completely sorted the answer is insertion sort which
takes O(n).
| Is This Answer Correct ? | 1 Yes | 2 No |
Answer / sarvesh
insertion is answer....as there is no case of swapping as
no. are in ordered pair..so less time will will be taken
| Is This Answer Correct ? | 1 Yes | 2 No |
Answer / gautam
heap sort is the correct answer because it requires log(n)
time where n is the number of nodes
| Is This Answer Correct ? | 0 Yes | 1 No |
Tell me why can't constant values be used to define an array's initial size
Which is better hashmap or hashtable?
Why is data structure important?
simple algorithm for bubble sort?
What is the impact of signed numbers on the memory?
What is meant by binary tree?
Which interfaces are implemented by printerstatereasons?
What are the main differences between the linked list and linear array?
How do you insert a new item in a binary search tree?
How to sort 1 million floating point numbers?
Which is the parent class of hashmap class?
What is the heap in data structures?