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 / ronak & sandip

In this case, both insertion and bubble sort will work exactly same as the time complexity of both method is O(n). But you have to mention one condition to check any swap has been made inside or not...if no swap has been made, it will come out of loop after executing it n times.

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is sequential mapping in data structure?

898


Is data structure a data type?

912


Questions related to arrays, such as given a 2 integer array, find the common elements.

885


Why quicksort is better than merge sort?

876


What is long data type?

900


Can you sort a hashset?

878


How to excel in data structures and algorithms?

919


Tell me what should be done in the base case for this recursive problem?

849


what is the difference between singly and doubly linked lists?

932


What is the difference between dictionary and hashtable?

968


What is difference between rb tree and avl tree?

852


How does max heap work?

862


What is the difference between a stack and an array?

1012


Define a set?

902


Which is faster binary or linear search?

850