Google
Information Storage and Retrieval: Puzzles

Pages

Showing posts with label Puzzles. Show all posts
Showing posts with label Puzzles. Show all posts

Thursday, October 11, 2007

Optimize Your Time Wisely......

There are 4 computer jobs which have to be run on 3 processors.Each job requires a certain amount of processor time, but is migratable i.e it can be started on one processor, suspended, continued on another processor, etc., as long as the total time it gets on processors is sufficient.
If the times required by these 4 jobs is 20 secs, 20 secs, 21 secs and 100 secs respectively , find out the maximum possible time for which all 3 processors can be kept busy with optimal scheduling. Also provide a general solution for this problem for 'n' processors where 'p' jobs have to be run which takes p1,p2,p3..... times to finish.

Tuesday, October 9, 2007

Who is wearing what?

There are few people in a meeting-room and each one of them wears a blue or a grey shirt. Every person counts the number of people wearing blue shirts. You are given a single dimensional array where these counts are recorded. Find out the total number of people wearing the blue shirts? If the given array is invalid, then print "Invalid". Some of these arrays can be:
1. Count[]={2,1,1}
2. Count[]={2,2,2,2,2,2}
3. Count[]={2,10}

Monday, October 8, 2007

Search in the Sequence

There is an infinite sequence of numbers as follows :

1,2,2,3,3,3,4,4,4,4,5,5,5,5,5......(the 'i' number appears i times) . If you are given a number 'k', write a program that will return the kth number in the sequence given above.

e.g if k=4 then answer will be 3.

Friday, September 21, 2007

Who will have the last laugh??

Lets get our thinking caps on:
There are 2000 persons in a hall.Everyone is named in numbers such as 1 to 2000(including 1 and 2000).They are arranged in the ascending order.A gun is given to the person 1.Person 1 will shoot the one next to him and give it to the person who is surviving next to the dead person.(i.e)1 will kill 2 and give it to 3,3 will kill 4 and give it to 5,and so on.This process is repeated continuously until there are two persons left.Who are the two people left in the end? (All are Standing in a circle).
Waiting for your answers!!!! (Write a program also to generalize your solution)