can anyone provide the answer for the puzzle below
There are 25 horses,in each race only 5 horses can
participate.how many races are required to select best 5
horses out of 25.
need answer with detailed explanation
Answer Posted / konstantin
Just got this question during interview.
The only difference was to determine 3 best horses.
The RIGHT answer is 10.
Just abstract your brain from horses and racing track.
This is INSERTION sort algorithm.
You have an array of 25 elements and you need do determine
5 elements that have greater values among others elements.
Divide the array down to 5 non overlapping ranges.
Sort each of those ranges (5 RACES) and as a result you will
have maximum value element for the whole array somewhere
among top value elements of each individual range.
Compare them against each other(+1 RACE). Determine maximal
value element, remove this element and replace it for second
in order for this range.
Perform latest 2 steps for whatever number elements you need.
So, to determine 1 best horse you need 5+1=6 races,
best 2 horses will require 7 races and so on.
Obviously determination of 5 best horses will require
5+5 = 10 races.
| Is This Answer Correct ? | 0 Yes | 5 No |
Post New Answer View All Answers
What is the syllabus for numerical aptitude exam to be held by the United bank of India. Plz inform me through email. Thanking You!
how soon can you travel down to start your new job?
plz send me aptitude test questions on my email id bpraichur@gmail.com
sir i need generalKnowledge previous questions for rrb secunderabad goods guard exam
P pages read in d mins after day p+1 pages read in d+1 mins last day 379 pages done in 317 mins find p+4
Three neighbours are there. 1st one lends 2nd and 3rd that many no.of tractors that then already each had.After few months , 2nd lends to 1st and 3rd that many tractors then they had. After a few months 3rd lends to 1st and 2nd that many tractors then they had.Now each of them got 24. Find howmany they had initially?
There is puzzle with the word "CONSTANTINE" and exactly don't know the question if anybody knows the Q&A plz send it ahmed.basha.munna@gmail.com
Three members are hunting in a forest.While crossing a streem cartridges of two of them gets wetted up.Then the third person decides his cartidges equally. After 4 shots of each person, total cartridges remaining are equal to what each had initially after sharing.How many total cartridges they initially they shared?
Ship is 180 miles away from shore. At that time a plane started from shore to pass some information to the ship with 10 times velocity of ship's velocity. At what distance from shore they will meat?
4_4_4_4=22 use all sign of maths
what three specific job positions do you target from qatar airways group u.k?
sir i need catholic syrian bank previous question papers fully. it will be helpful for me to greater extend .please do the needful to me.
IDear sir, I have had a data containing of 4 numbers on daily basis for which I would like to know what is the next comming 4 numbers. Based on that data I would like to find out the next comming numbers. Support needed. regards chandramohan gudivada 09849974512 cm116_99@yahoo.com Example : 4513, 4132, 1465, 2941, 1762, 1432, 3412, 5283, 7261, 2643, 4751, 2581, 6513 .... and what is the next number in the sequence?
At 6o'clock ,a watch strokes 6 times.The time between first and last is 30secs.At midnight 12o' clock how much time for all strokes?
what job position/s are you currently holding with your current employer?