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

Is selection sort greedy?

842


Why do we use arrays?

873


Why is hashmap faster than arraylist?

954


How can you insert a node to the beginning of a singly linked list?

896


Define non-linear data structures?

985


Are hash tables ordered?

857


What are the two traversal strategies used in traversing a graph?

923


Why is quicksort faster than merge sort?

887


What is the structure of an array?

865


What is the best complexity of bubble sort?

864


Explain what is binary search?

914


What is unmodifiable list?

894


What is adt in data structure with example?

984


Why null is not allowed in treemap?

917


When will we get ArrayStoreException?

1119