c programming, Computer Engineering

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.
Posted Date: 9/3/2012 1:39:41 AM | Location : United States







Related Discussions:- c programming, Assignment Help, Ask Question on c programming, Get Answer, Expert's Help, c programming Discussions

Write discussion on c programming
Your posts are moderated
Related Questions
For JK flip flop with J=1, K=0, the output after clock pulse will be ? Ans. The output will be 1 after clock pulse.

Describe the term- System analyst Design Once analysis has taken place and systems analyst has some idea of the scale of problem and what needs to be done, subsequent stage is

Subtraction 11011-11001 using 2's complement. Ans. 11011 - 11001 = A - B 2's complement of B = 00111 1 1 0 1 1 + 0 0 1 1 1 1 0 0 0 1 0 Ignore carry to get answer as 00010 = 2.

Buses: Execution of 1 instruction need the following 3 steps to be performed by the CPU: I.  Fetch the contents of the memory location pointed at by the computer syst

Write a program to read in a positive integer and check whether it is prime or not? /* Program to check whether a given number is prime or not*/] # include # include

Automatic Stock Control System in a Supermarket -  Bar codes are associated to all goods/items sold by the supermarket as a means of identification -  Every bar code is asso

Artificial Neural Networks: However imagine now in this example as the inputs to our function were arrays of pixels and there actually taken from photographs of vehicles such

What exactly is being serialized when you perform serialization? Serialization is the process of changing an object into stream of bytes. We perform it at the time of transpor

Write a function that will prompt the user individually for a filename and extension and will make and return a string with the form 'filename.ext'.

is a technique of temporarily removing inactive programs from the memory of computer system? Swapping is a technique of temporarily eliminating inactive programs from the memor