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

Why do we need linked lists?

930


Which sorting has less time complexity?

925


Differentiate between list and set.

1072


Can sets contain duplicates?

831


What does the dummy header in the linked list contain?

1162


What are the disadvantages of representing a stack or queue by a linked list?

928


Give us a program to reverse a linked list.

976


Why do we need to use computers to help us sort lists?

931


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

1037


How do we find duplicate elements in an array?

966


What are examples of data structures?

932


Why is an array homogeneous?

863


How do you declare A pointer to array of three chars

1058


What is the difference between array and stack?

1064


What is the need for path compression?

1089