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...

how to find the kth smallest element in the given list of
array elemnts.

Answer Posted / newclient

sorting is not required in this case.u can still use same
technique(not exactly) as mentioned in Cormen.an algorithm
named "QuickSelect" which has an average complexity of
O(nlong(n)).
Anyways to reduce the number of comparisions one can use
tournament algorithm and for kth element we have to
recursively go through the loosers list.

Is This Answer Correct ?    9 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is 'bus error'?

1129


What is the benefit of using const for declaring constants?

1036


What is the difference between fread and fwrite function?

1068


Explain how can you determine the size of an allocated portion of memory?

1096


What is a pointer in c?

1531


Why static is used in c?

1078


What does *p++ do? What does it point to?

1040


Is there anything like an ifdef for typedefs?

1139


What is sorting in c plus plus?

960


What will the code below print when it is executed?   int x = 3, y = 4;         if (x = 4)                 y = 5;         else                 y = 2;         printf ("x=%d, y=%d ",x,y);

1868


What is variables in c?

1034


What is the use of the function in c?

1005


What is line in c preprocessor?

1038


"%u" unsigned integer print the a) address of variable b) value of variable c) name of a variable d) none of the above

1008


Write a program to generate a pulse width frequency of your choise,which can be variable by using the digital port of your processor

3523