A generic stack class called mystack

Assignment Help Basic Computer Science
Reference no: EM132253137

Data Structures

1. a generic queue class called MyQueueMyQueue will implement the QueueInterface given you. You will be creating MyQueue from scratch (do not use an internal object of the Queue class from java.util)

2. a generic stack class called MyStackMyStack will implement the Stack Interface given you. You will be creating MyStack from scratch (do not use an internal object of the Stack class from java.util)

Utility Class

The Notation class will have a method infixToPostfix to convert infix notation to postfix notation that will take in a string and return a string, a method postfixToInfix to convert postfix notation to infix notation that will take in a string and return a string, and a method to evaluatePostfix to evaluate the postfix expression. It will take in a string and return a double. A method to evaluateInfix to evaluate the infix expression. It will take in a string and return a double. Follow the Javadoc provided for you.

In the infixToPostfix method, you MUST use a queue for the internal structure that holds the postfix solution. Then use the toString method of the Queue to return the solution as a string (this will differ slightly from the algorithm in your book).

For simplicity sake:

a. operands will be single digit numbers

b. the following arithmetic operations will be allowed in an expression:

           +         addition

           -         subtraction

           *         multiplication

           /          division

Exception Classes

Provide the following exception classes:

1. InvalidNotationFormat - occurs when a Notation format is incorrect

2. StackOverflowException - occurs when a top or pop method is called on an empty stack.

3. StackUnderflowException - occurs when a push method is called on a full stack.

4. QueueOverflowException - occurs when a dequeue method is called on an empty queue.

5. QueueUnderflowException - occurs when a enqueue method is called on a full queue.

Reference no: EM132253137

Questions Cloud

Likert scale and the semantic differential scale : Two of the classic approaches to rating scales are the Likert scale and the semantic differential scale.
Business report assignment about samsung company : Briefly describe two to three recent events where your company was in the news and describe how they affected the company.
Write the program that asks the user for a color : Write the program that asks the user for a color, a line width, a line length and a shape. Assume that the user will specify a shape
What business do you want to start : What business do you want to start, and why? Explain your personal connection to this type of business and discuss sources of information about this business.
A generic stack class called mystack : a generic queue class called MyQueue. MyQueue will implement the QueueInterface given you. You will be creating MyQueue from scratch
Calculating the storage location of an element : Convert the formula we derived earlier for calculating the storage location of an element of a two-dimensional array stored
What is the overall themes for the dying christian : What is the overall themes for The Dying Christian to his Soul, I Travelled among unknown Men and My Parents and I?
Challenge for ebay database management : Identify at least three reasons why continuing business growth has been a challenge for eBay database management
What are some of the grievances in the united states : What are some of the grievances in the United States and France? Now that you know the damages of the free market utopia, what could we draw from the backlash.

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Replace the natural joins in the following expressions

Replace the natural joins in the following expressions by equivalent theta-joins and projections. Tell whether the resulting theta-joins form a commutative and associative group.

  What is the equilibrium price quantity and profit for firm

Chuckie B Corp. is considering implementing a proprietary technology with a one-time sunk cost of $200. Once this investment is made, marginal cost will be reduced to $40. Gene Gene has no access to this or any other cost saving technology, and it..

  Is your computer connected to a surge protector

1. List 2 environmental hazards that could damage your computer and how you should protect your device against those hazards.

  Generate a sequence of thirty random integers

Then print out a count of how many times each number between 0 and 9 appeared in the sequence. No using if statements.

  How did you decide what price to charge for your services

How did you decide what price to charge for your services? Did you think the price was worth more than the effort you put into it?

  Describe the difference between an inner join

Describe the difference between an INNER JOIN, a RIGHT JOIN, and a LEFT JOIN. Provide a business example where you would want to use each type of join.

  Disadvantage of your current household status ie single

Any economic advantage/disadvantage of your current household status ie single, roommate, married? Can we really study Marriage as an "economic" preference?

  Load in erlangs on this trunk connection

What's the traffic volume/load in erlangs on this trunk connection?

  Different organizational culture and local culture

Discuss what you believe would be the different organizational culture and local culture aspects that you would have to take into consideration

  Compare and contrast strayer university''

Compare and contrast Strayer University's identity management system (which students are required to use to access their classes, grades, course schedules, registration, etc.) to the Oracle Identity Manager 11g. Determine which one you prefer and exp..

  Design a recursive linear-time algorithm

1. Design a recursive linear-time algorithm that tests whether a binary tree satis?es the search tree order property at every node. 2. Write a recursive function that takes a pointer to the root node of a tree T and returns a pointer to the root node..

  Examine the function called uartcharsavail

Examine the TM4C Peripheral Driver LibraryLinks to an external site.

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