Java - Stack and Queue, Basic Computer Science

Assignment Help:
Consider a class called Configuration. This class “encapsulates” the configuration management
for any software system. For example, once created, the user can simply ask the configuration
object for value(s) to a certain configuration key. Let’s take a look at a few examples:
String filename = “config.txt”;
Configuration config = new Configuration( new File(filename) );
int numUser = config.getInteger( “num_users” );
String name = config.getString( “player1” );
In the above example, the config object is constructed and its contents are expressed in the file
config.txt. The format of the config.txt file is as followed.
key = value
key2 = value2
## lines with comments begins with the #
The complete Configuration class should implement the following methods:
Class Configuration {
// constructors
Configuration() { … }
Configuration( File file) { … }
Configuration(String filename) { … }
// accessors
int getSize() { … }
String getString( String key ) { … }
int getInteger( String key ) { … }
String[] getKeys() { … } // return all keys
// mutators
void push(String key, String value) { }
String[] pop() { } // returns String array[] = { key, value }
}
Your Configuration class will have two sub classes: (1) ConfigurationQueue and (2)
ConfigurationStack. The push and pop functions will behave differently depending on whether
your class is a Queue or a Stack.
Your App class is given and you should not change this class at all. Your homework will require
creating three files: Configuration.java ConfigurationQueue.java and ConfigurationStack.java.

Related Discussions:- Java - Stack and Queue

Data base software, Data Base Software: Another major type of applicat...

Data Base Software: Another major type of application comes under the heading database software; which allows for the collection of, searching for and manipulation of informat

Describe circuit switching and message switching, Question 1 List the Basi...

Question 1 List the Basic essential components of a computer network Question 2 What are the functions of (i) Routers (ii) Bridges Question 3 What are the advantag

Multithread 1:1 Model, Given an operating system that supports a one – to ...

Given an operating system that supports a one – to –one relationship between user-level threads and kernel – level threads and allows one or more threads from a process to issue b

Rooted tree, Ask qu The figure below shows a rooted tree, 756_Find the hei...

Ask qu The figure below shows a rooted tree, 756_Find the height.png 1.1. Find the height/level of the tree as shown above?estion #Minimum 100 words accepted#

Register array, #queA register is a memory location surrounded by the CPU i...

#queA register is a memory location surrounded by the CPU itself, designed to be rapidly accessed for purposes of fast data retrieval. Processors normally hold a register array, wh

The microprocessor, THE MICROPROCESSOR The three fundamental units, whi...

THE MICROPROCESSOR The three fundamental units, which comprise a CPU, have now been discussed in general terms.  So too has a microprocessor, because a microprocessor can be de

Device drivers, Device Drivers:   Device drivers are shared computer p...

Device Drivers:   Device drivers are shared computer programs that provide an interface between the hardware devices and operating system or other higher level programs.

Computer Networking and configuaration, Ask queYou are hired as a Chief Tec...

Ask queYou are hired as a Chief Technology Officer (CTO) of a startup company, which has two branches; one Los Angeles and one in San Francisco. The company hired employees to begi

Explain the important features of creational patterns, Question 1 Explain ...

Question 1 Explain the role of object oriented designers in developing a software system Question 2 What are the four essential elements of design patterns? Explain Question 3

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd