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's the difference between a hashtable and a hashmap?

903


How does a heap sort work?

893


What is a list of lists?

927


What is array simple?

924


Is a hashset ordered?

986


Differentiate between hashset and treeset.

996


What are the tasks performed during inorder traversal?

966


“int a[] = new int[3]{1, 2, 3}” – This a legal way of defining the arrays?

1193


What is data structure and why we need it?

903


What is data structure and why we need them?

875


What is an algorithm in coding?

861


What is 2 dimensional linked list?

1002


What is the complexity of selection sort?

834


Which is the simplest file structure?

998


How do you get placements?

847