A list is ordered from smaller to largest when a sort is
called. Which sort would take the shortest time to execute?

Answer Posted / rohit

Bubble sort with a flag variable to check if comparisons
occur or not. If it is already sorted then in just 1
iteration it will show that the array is sorted which is
not possible in any other sort.THUS JUST 1 ITERATIION IS
REQUIRED IN THIS CASE.

Is This Answer Correct ?    27 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do you create a tree diagram?

708


What is difference between hashmap and linkedhashmap?

628


What is the minimum number of queues that can be used to implement a priority queue?

688


How do you use merge sort?

640


Is hashmap fail safe?

708


What are the 3 types of measurement?

711


What are the advantages of binary search over linear search?

834


What are hashmaps good for?

680


Which is faster treemap or hashmap?

664


what is the difference between singly and doubly linked lists?

723


Give the example of validating the parenthesis of expression using stack.

768


Does treeset allow null?

644


What is the idea behind splaying?

1484


What is an ordered list?

738


How do you find the index of an element in an arraylist?

615