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

  Determining contents of the register a

The hexadecimal form of a 3-byte instruction for SIC/XE is 010030. The opcode in the instruction is LDA. Indicate the contents of the register A in decimal.

  Address the use of software repositories from fedora

Include only those repositories that are used by default in Fedora. Cite the resources that you used for writing this paper in the Chicago Manual of Style format.

  Providing security over data

The CIA triad (confidentiality, integrity, and availability) offers three (3) security tenets that allow data owners the framework to secure data.

  Write a program to read the temperature once every 200 ms

Change the ambient temperature using your hand, hot water in a plastic bag, ice in a plastic bag, and so on, to touch the TC72 and record the temperature reading.

  Outlier payment calculation to determine

The Safe-Cross® guidewire is present on the following claim. Complete an outlier payment calculation to determine whether this claim would qualify for a high cost outlier payment.

  Write an sql query (mysql)

Guest (guestNO, guestName, guestAddress) Question:  How do I write an SQL Query (mysql) that would give me  "the average number of bookings for each type of room?"

  Topic of personal interest and post

Select a topic of personal interest and post the link (and a screenshot, if possible) to a supporting RSS subscription site. Discuss the pros and cons of subscribing to an RSS feed.

  Briefly mention the set of ai-based rules

You are to develop AI behind a generic Tic-Tac-Toe game, where a player can pay against computer. Briefly mention the set of AI-based rules that have to check on either side to decide the next move in a game. How would you determine a winner/cat's..

  How do you solve this problem without maple

Solve the differential equation with Maple and use your solution to determine the unique value of b so that u(0) will exist. How do you solve this problem without Maple? Create a graph of u(x), using your value of b. Explore what happens to soluti..

  Define function and write about its purpose

Answer the questions (i) and (ii) after going through the following class :

  The database developer for a local colleg

Suppose that you are the database developer for a local college. The Chief Information Officer (CIO) has asked you to provide a summary of normalizing database tables that the IT staff will use in the upcoming training session.

  Organization model of the willowbrook school

Create an organization model of the Willowbrook School's paid staff. Make sure you include not only the title/position, but the person's name if known. You can create the chart using Microsoft Word or a similar program.

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