Essay

6791 Words Aug 8th, 2013 28 Pages
Minimum Shelf
Problem Description
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.
…show more content…
All required files will be downloaded to your work directory. Creating additional files is strongly discouraged.
Step 1:
In your Solution File: * Implement your logic in function int shelfCount(char* packet) * char* packet : is the string as packets are kept in the shelf. * You can create more functions if required, but those functions should be in the same file.

Step 2:
Your solution needs to consider the following constraints. 1. In this problem you have to write a program, that finds the minimum total number of shelves, including the initial one, required for this loading process. 2. The packets are named A, B, C, D, E …….. 3. Any numbers of packets with these names could be kept in the shelf, as in this example: [ZZLLAAJKRDFDDUUGGYFYYKK]. 4. All packets are to be loaded on cars. The cars are lined in order, so that the packets could be loaded on them. The cars are also named [A, B, C, D, E,………….]. 5. Each Car will load the packets with the same alphabet. So, for example, car ‘A’ will load all the packets with name ‘A’. 6. Each particular car will come at loading point only once. For example, car A will come only once at the loading point. 7. 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. 8. No matter how deep in the shelf any packet ‘B’ is,

Related Documents