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
What is 'bus error'?
What is the benefit of using const for declaring constants?
What is the difference between fread and fwrite function?
Explain how can you determine the size of an allocated portion of memory?
What is a pointer in c?
Why static is used in c?
What does *p++ do? What does it point to?
Is there anything like an ifdef for typedefs?
What is sorting in c plus plus?
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);
What is variables in c?
What is the use of the function in c?
What is line in c preprocessor?
"%u" unsigned integer print the a) address of variable b) value of variable c) name of a variable d) none of the above
Write a program to generate a pulse width frequency of your choise,which can be variable by using the digital port of your processor