At a shop of marbles, packs of marbles are prepared. Packets
are named A, B, C, D, E …….. All packets are kept in a
VERTICAL SHELF in random order. Any numbers of packets with
these names could be kept in that shelf as in this example:
bottom of shelf ---> [AAAJKRDFDEWAAYFYYKK]-----Top of shelf.
All these packets are to be loaded on cars. The cars are
lined in order, so that the packet could be loaded on them.
The cars are also named [A, B, C, D, E,………….]. Each Car
will load the packet with the same alphabet. So, for
example, car ‘A’ will load all the packets with name ‘A’.
Each particular car will come at the loading point only
once. The cars will come at the loading point in
alphabetical order. So, car ‘B’ will come and take all the
packets with name ‘B’ from the shelf, then car ‘C’ will
come. No matter how deep in the shelf any packet ‘B’ is,
all of the ‘B’ packets will be displaced before the ‘C’ car
arrives. For that purpose, some additional shelves are
provided. The packets which are after the packet B, are kept
in those shelves. Any one of these shelves contains only
packets, having the same name. For example, if any
particular shelf is used and if a packet with name X is in
it, then only the packets having names X will be kept in it.
That shelf will look like [XXXXXXX]. If any shelf is used
once, then it could be used again only if it is vacant.
Packets from the initial shelf could be unloaded from top
only. Write a program that finds the minimum total number
of shelves, including the initial one required for this
loading process.


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

Post New Answer

More C Interview Questions

how to swap 2 numbers in a single statement?

3 Answers  


Explain what does it mean when a pointer is used in an if statement?

0 Answers  


Why is sizeof () an operator and not a function?

0 Answers  


Symmetric technologies interview questions. For Computer science candidates the first round is a objective type written test consisting of 16 questions.It is very easy ,any police man can solve this. And next round is a written test consists of both objective and subjective .Total 40 question related to c,c++ and operating system related questions. And then a technical interview and give some program to solve with computer.The md is adamant person, whatever he says we have to accept that is the condition. And one more thing ,,,these interview is just for a formality..the company will select only innocent guys.. the person's without a backbone only they require.. And u have to submit the certificates this is the most important problem...So if you are not getting any other jobs..then only join with this... It is better to try for other company...And apart from that symmetric do a lot of projects..If a candidate can manage everything u can join and make good career with this company... The Md will normally speak rudely..but he is good person and he will give you a lot of very good chances to improve your career....but with cheap salary....

0 Answers   Symmetric Technologies,


int a=2,b=3,c=4; printf("a=%d,b=%d\n",a,b,c); what is the o/p?

6 Answers   Verifone,






Study the following C program :call_me (myvar)int myvar;{ myvar +- 5; }main(){int myvar;myvar = 3;call_me(myvar);printf("%d ",myvar);What will be printed a) 3 b) 5 c) 8 d) symbol

0 Answers  


Find the output? void main() {float a=2.0; printf("\nSize of a ::%d",sizeof(a)); printf("\nSize of 2.0 ::%d",sizeof(2.0));}

11 Answers   IBM, TCS,


Explain the advantages of using macro in c language?

0 Answers  


What are pragmas and what are they good for?

0 Answers  


What is the purpose of clrscr () printf () and getch ()?

0 Answers  


what is the Output? int a=4 b=3; printf("%d%d%d%d%d%d",a++,++a,a++,a++,++a,a++); printf("%d%d%d%d%d%d",b--,b--,--b,b--,--b,--b);

10 Answers   IBM,


Is c still used in 2019?

1 Answers  


Categories