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
Write a program to replace n bits from the position p of the bit representation of an inputted character x with the one's complement. Method invertBit takes 3 parameters x as input character, p as position and n as the number of positions from p. Replace n bits from pth position in 8 bit character x. Then return the characters by inverting the bits.
What does the function toupper() do?
What does struct node * mean?
Which header file is used for clrscr?
What language is c written?
what is ur strangth & weekness
The program will first compute the tax you owe based on your income. User is prompted to enter income. Program will compute the total amount of tax owed based on the following: Income Tax 0 - $45,000 = 0.15 x income $45,001 - $90,000 = 6750 + 0.20 x (income – 45000) $90,001 - $140,000 = 15750 + 0.26 x (income – 90000) $140,001 - $200,000 = 28750 + 0.29 x (income – 140000) Greater than $200,000 = 46150 + 0.33 x (income – 200000) Dollar amounts should be in dollars and cents (float point numbers with two decimals shown). Tax is displayed on the screen.
in multiple branching construct "default" case is a) optional b) compulsarily c) it is not include in this construct d) none of the above
Can we change the value of constant variable in c?
Can a pointer point to null?
What is unary operator?
What is FIFO?
What are the properties of union in c?
How to check whether string is a palindrome, WITHOUT USING STRING FUNCTIONS?
Do you know the difference between malloc() and calloc() function?