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

Differentiate linear from a nonlinear data structure?

1116


State the different ways of representing expressions?

1251


What is a matrix? Explain its uses with an example

1246


Which sorting is best?

948


Define secondary clustering?

979


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

975


What is complexity of bubble sort?

934


Can treemap have duplicate values?

925


What is a singletonlist?

938


Is null allowed in list?

900


Define general trees?

1122


Calculate the address of a random element present in a 2d array, given base address as ba.

1577


State the difference between primitive and non-primitive data types?

1211


Define threaded binary tree. Explain its common uses

928


How to find if linked list has loop?

1199