Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

Answer Posted / sathyanarayana

Yes, its insertion sort. For a sorted array, it takes just
O(n) time. iTs mere traversal of an array as it is already
sorted. In the case of quick sort, it boils down to O(n^2)
in the case of sorted array.

Is This Answer Correct ?    5 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain quick sort and merge sort algorithms.

923


What is the similarity between a Structure, Union and enumeration?

957


What is a weighted graph?

977


how to add an item to the beginning of the list?

922


What is array and its types?

922


How would you sort words in a large file?

857


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

976


How to use appendNode() in linkedlist()?

1036


What is a string array?

865


What is circular linked list?

897


Explain about set and their types in a collection?

794


What is static array?

907


What is red black tree in data structure?

845


What are the main differences between the linked list and linear array?

921


What is difference between hashmap and hashtable?

888