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

Where is data structure used?

961


What is the time complexity of arraylist and linked list?

922


State the rules to be followed during infix to postfix conversions?

1161


How to excel in data structures and algorithms?

951


What is Jagged Arrays?

967


what are the applications of Linked Lists?

1017


What are the disadvantages of linear list?

913


Why is sorting necessary?

885


Is complete binary tree?

899


Differentiate between arraylist and linkedlist.

1116


Which is faster hashmap or hashtable?

922


Why do we use sorting?

873


Can we add heterogeneous elements into treemap?

962


Explain the difference between a list and array.

962


Why is arraylist not thread safe?

921