Create an object of doublestack

Assignment Help Basic Computer Science
Reference no: EM131476398

Q1) Create class ArrayDeque to implement double ended queue (Deque) (modify ArrayQueue ). Deque has the following methods:

isEmpty(), size(), first(), last(), addFirst(), addLast(),  removeFirst(), removeLast(). Test these methods in main  method.

Q2) Create a java class called  DoubleStack to represent a double stack data structure (see figure below). It is like two stacks shared the same array, one from left side and the other one from right side. However, this doesn't mean the array is divided equally between them. It depends on push and pop operations for each one of them. DoubleStack will have: isEmpty1, size1(), push1, top1, pop1, isEmpty2, size2(),  push2, top2, and pop2.

Write a main() function to test all the above functionalities.

1215_Stacks and Queues.png

In the main, create an object of DoubleStack,  test the   methods.

Q3) Write a recursive method searchStack(LinkedStack<E> S, E x) which returns true if the stack S contains the element x, otherwise it return false. (You should not use any extra data structures).

Reference no: EM131476398

Questions Cloud

Draw a relational schema for your 3nf relations : Using the given table/relation, do the following: Draw a dependency diagram to show the functional dependencies in the relation
Provide enhanced advertisement : Facebook has started using Artificial Intelligence bots to answer user questions within the application, provide enhanced advertisement.
What is done on a write during recovery : Many RAID implementations allow on-line repair in which the system continues to operate after a disk failure, while a new empty disk is inserted to replaced.
Consider an interesting topic that is worth further research : Identify two global societal issues from the following list that you would consider researching further for your Week Five Final Argumentative.
Create an object of doublestack : In the main, create an object of DoubleStack, test the methods.
What is maximum frequency at which you could scrub disk : Suppose you are willing to sacrifice no more than 1% of a disk's bandwidth to scrubbing. What is maximum frequency at which you could scrub a 1 TB disk.
Describes the securities in the portfolio : Describes securities in portfolio, including a description of historical information for each firm. Calculates a quarterly and annualized return on portfolio.
Differentiate real-time dsp and non-real-time dsp : Describe the difference between real-time DSP and non-real-time DSP. Give an example of each.
Describe two business risks to msl : HI6026 Audit, Assurance and Compliance Assignment. In relation to the purchasing of equipment and spare parts, describe two business risks to MSL

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Identifies the cost of computer

identifies the cost of computer components to configure a computer system (including all peripheral devices where needed) for use in one of the following four situations:

  Input devices

Compare how the gestures data is generated and represented for interpretation in each of the following input devices. In your comparison, consider the data formats (radio waves, electrical signal, sound, etc.), device drivers, operating systems suppo..

  Cores on computer systems

Assignment : Cores on Computer Systems:  Differentiate between multiprocessor systems and many-core systems in terms of power efficiency, cost benefit analysis, instructions processing efficiency, and packaging form factors.

  Prepare an annual budget in an excel spreadsheet

Prepare working solutions in Excel that will manage the annual budget

  Write a research paper in relation to a software design

Research paper in relation to a Software Design related topic

  Describe the forest, domain, ou, and trust configuration

Describe the forest, domain, OU, and trust configuration for Bluesky. Include a chart or diagram of the current configuration. Currently Bluesky has a single domain and default OU structure.

  Construct a truth table for the boolean expression

Construct a truth table for the Boolean expressions ABC + A'B'C' ABC + AB'C' + A'B'C' A(BC' + B'C)

  Evaluate the cost of materials

Evaluate the cost of materials

  The marie simulator

Depending on how comfortable you are with using the MARIE simulator after reading

  What is the main advantage of using master pages

What is the main advantage of using master pages. Explain the purpose and advantage of using styles.

  Describe the three fundamental models of distributed systems

Explain the two approaches to packet delivery by the network layer in Distributed Systems. Describe the three fundamental models of Distributed Systems

  Distinguish between caching and buffering

Distinguish between caching and buffering The failure model defines the ways in which failure may occur in order to provide an understanding of the effects of failure. Give one type of failure with a brief description of the failure

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