A list is ordered from smaller to largest when a sort is
called. Which sort would take the shortest time to execute?
Answer Posted / soumitra biswas
modified bubble sort with flag.As the array is already sorted
there will be no swapping in first pass,so no comparison
will take place after first pass and program stops executing.
time complexity =0(n).
| Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
Why do we need linked lists?
Which sorting has less time complexity?
Differentiate between list and set.
Can sets contain duplicates?
What does the dummy header in the linked list contain?
What are the disadvantages of representing a stack or queue by a linked list?
Give us a program to reverse a linked list.
Why do we need to use computers to help us sort lists?
What is impact of signed numbers on the memory using data structures?
How do we find duplicate elements in an array?
What are examples of data structures?
Why is an array homogeneous?
How do you declare A pointer to array of three chars
What is the difference between array and stack?
What is the need for path compression?