minimumself, JAVA Programming

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/2/2012 6:03:14 AM | Location : United States







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

Write discussion on minimumself
Your posts are moderated
Related Questions
What is the difference between static and non-static variables? A static variable is associated with the class as a whole rather than with specific instances of a class. Non-st

The project is optional. It is worth at least 7 bonus points beyond overall 100 points of this course. The grading will be on a pass/fail basis. Write a Java application (not ap

Introduction: In this project, you will explore a few sorting algorithms. You will also test their efficiency by both timing how long a given sorting operation takes and count

What is the preferred organizational structure for the organization? The Network Organization is becoming the preferred organizational structure.

Spring - JSF integration is useful when an event handler wishes to explicitly invoke the bean factory to make beans on demand, such as a bean that encapsulates the business logic t

How can I improve the performance of a java application , describe the java optimization techniques?

#questionSmugglers are becoming very smart day by day. Now they have developed a new technique of sending their messages from one smuggler to another. In their new technology, they

Question 1 Explain the data types in Java Question 2 Write a note on StringBuffer Question 3 What is Exception? Question 4 Write a note on stream classes Questi

You are a newly recruited programmer, working for an IT company. This company won a contract to develop a Customer Relationship Management System (CRM) for a major retailer. The CR

A Padovan string P(n) for a natural number n is defined as: P(0)=''X'' P(1)=''Y'' P(2)=''Z'' for a string characters ''X'',''Y'',''Z'' only,and given value of n,write a program th