Data Structure:
Show that if k is the smallest integer greater than or equal to n+ (log2n)-2, k comparisons are necessary and sufficient to find the largest and second largest elements of a set of n distinct elements. (k comparisons are required to find what you are looking for, but no more than that are needed)


No Answer is Posted For this Question
Be the First to Post Answer

Post New Answer

More Programming Languages AllOther Interview Questions

you have an unlimited supply of $3 and $7 poker chips. What is the largest integer value that you cannot make by combining different numbers of chips?

2 Answers  


19. Given a system that is described with the following equation, X=A+(B.(A̅+C)+C)+A.B.(D̅+E̅) a) Simplify the equation using Boolean Algebra. b) Implement the original and then the simplified equation with a digital circuit. c) Implement the original and then the simplified equation in ladder logic.

0 Answers   Bajak Paint,


How do i find out the number of parameters passed into function?

0 Answers  


Where do we need Operator overloading?

0 Answers   BirlaSoft,


Q1.Write a C program which asks the user for a number between 1 to 9 and shows the  number. If the user inputs a number out of the specified range, the program should  show an error and prompt the user for a valid input.

0 Answers  






Hi All, Can any one please send me the difference between informatica 7i and 8i versions, Thanks in advance. vinod

0 Answers  


can any method return type may be constructor , or that method name allow

0 Answers   HCL,


what is web service in java? have u use before.

0 Answers  


What is the difference between COM and CORBA?

0 Answers   Yahoo,


How to create a new dataset only duplicate observations in proc sort procedure?

0 Answers   Accenture,


Write a pascal program to calculate the sum of the first 100 even number and odd number

0 Answers  


what is integration testing in real time applications?

0 Answers   CTS,


Categories