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 / 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


Please Help Members By Posting Answers For Below Questions

How do you sort an arraylist in descending order?

758


Define union-by-weight?

977


Are linked lists considered linear or non-linear data structures?

932


What is sorting an array?

866


What is list data structure?

922


What do you mean by disjoint set adt?

922


Differentiate between iterator and listiterator.

959


What is impact of signed numbers on the memory using data structures?

985


Is quicksort greedy algorithm?

948


How many times is merge sort called?

854


What is the difference between a hashmap and hashtable?

778


What is definition list?

894


Define primary data structures?

924


Is arraylist a collection?

923


Check if duplicates exist in an array of N which has range 1 to N.

929