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

How many types of searching are there in data structure?

887


What are the operations that can be performed on a stack?

956


What happens if an array goes out-of-bounds?

1124


Can we put null key in hashmap?

961


Is priority queue sorted?

1013


Tell me why might quick sort might be better than merge sort?

975


Is red black tree balanced?

945


How will you free the memory that is allocated at run time?

1023


What is the difference between data type and data structure?

916


What is subtree?

951


What is worst case complexity algorithm?

960


Can we use Generics with the array?

1124


Define heap?

1156


Can you store different types in an array?

980


Explain what is a spanning tree?

1046