krishnakanth
BAN USERyes, we can. code it using modular programming, without using OOP.
- krishnakanth July 02, 2012ANSWER:: 2
divide the whole in to three sets. each set again containing 3 maples.
now weigh two of the three sets using common balance. [ FIRST WEIGHING. ]
This will tell us the set in which the heavier maple is in. Hence, we are just left with 3 maples.
now, weigh the two maples on a balance with the third one aside. this will tell us the heavier one. [ SECOND WEIGHING.]
he is wrong. what if the best horses are in the first race?? arent you neglecting 2nd n 3rd best by only taking the first horse from the first set of five?
- krishnakanth June 10, 2012take average of some n numbers ( where n is not too large say n=5)
then take average of next n numbers
now take average of these two averages.
now get avg of next n numbers and so on.....
The answer is 12.
first:: 5 5 5 5 5 --- total 5 races and 15 left
second:: 5 5 5 --- total 3 races and 9 left
third:: 5 4 --- total 2 races and 6 left
fourth:: 5 1 -- total 1 race and 4 left (observe that here we only need one race for 5 horses and 0 for 1 horse.)
fifth:: 4 ---total 1 race and 0 left
adding all the races = 5+ 3+ 2+ 1+ 1 = 12
The answer is 12.
first:: 5 5 5 5 5 --- total 5 races and 15 left
second:: 5 5 5 --- total 3 races and 9 left
third:: 5 4 --- total 2 races and 6 left
fourth:: 5 1 -- total 1 race and 4 left (observe that here we only need one race for 5 horses and 0 for 1 horse.)
fifth:: 4 ---total 1 race and 0 left
adding all the races = 5+ 3+ 2+ 1+ 1 = 12
no. binary tree has numbers arbitrarily placed unlike BST.
- krishnakanth August 26, 2012the in-order of a binary SEARCH tree gives a sorted output but the in-order of binary tree does not.