Write a program with class that implements a deque

Assignment Help Data Structure & Algorithms
Reference no: EM132095122

Question 1

A deque (pronounced "deck") is a list-based collection that allows additions and removals to take place at both ends. A deque supports the operations addFront (x), removeFront( ), addRear (x), removeRear( ), size( ), and empty( ). Write a program with class that implements a deque that stores strings using a doubly-linked list that you code yourself.

Demonstrate your class with a graphical user interface that allows users to manipulate the deque by typing appropriate commands in a JTextField component, and see the current state of the deque displayed in a JTextArea component. Consult the documentation for the JTextArea class for methods you can use to display each item in the deque on its own line.

Question 2

You are given a file that contains data describing a binary tree whose nodes are strings. The file begins with an integer N, the number of nodes in the tree, on a line by itself. This first line is followed by N additional lines where each line specifies child information for a node in the tree.

The line for a node X starts with X itself followed by a list of the children of X. Names of nodes are separated by whitespace. For example, the data set:

5

Al Bob Carol

Bob Debby Elaine

Carol

Debby

Elaine

represents a binary tree in which Al has two children named Bob and Carol; Bob has two children named Debby and Elaine; and Carol, Debby, and Elaine have no children. Write a program that reads in data from such a file and displays it in a JTree component

Reference no: EM132095122

Questions Cloud

Prepare an aggregate plan : Prepare an aggregate plan for the next 3 years for the increased manufacturing of private jets in regards to buildings
Write a python script that reads the child mortality data : ICT702 : Write a Python script that reads and analyses the child mortality data file (WHOSIS_MDG_000003.csv) and produce at least FIVE.
Generate a conceptual model for an emergency : Use the tool to generate a conceptual model for an emergency room. Keep in mind that you are not modeling a process
Hawk electronics case : Review the case and provide an analysis of the case using the following case questions prompts for guidance. Your paper should be no less than
Write a program with class that implements a deque : Write a program with class that implements a deque that stores strings using a doubly-linked list that you code yourself.
Describe the impact of access control methods : Describe the impact of access control methods and models in obtaining evidence of sufficient quality to be accepted by a court.
Define the function payback : Define the function payback, which consumes a charge amount and computes the corresponding pay-back amount.
Have you considered teaching project management : Have you considered teaching project management as a part-time or full-time career? Do you want to know what goes on behind
Print the weighted moving average of all the trades : You are given a series of trades. Each trade has a key, a value, a quantity, and a sequence number.

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

  Implement an open hash table

In this programming assignment you will implement an open hash table and compare the performance of four hash functions using various prime table sizes.

  Use a search tree to find the solution

Explain how will use a search tree to find the solution.

  How to access virtualised applications through unicore

How to access virtualised applications through UNICORE

  Recursive tree algorithms

Write a recursive function to determine if a binary tree is a binary search tree.

  Determine the mean salary as well as the number of salaries

Determine the mean salary as well as the number of salaries.

  Currency conversion development

Currency Conversion Development

  Cloud computing assignment

WSDL service that receives a request for a stock market quote and returns the quote

  Design a gui and implement tic tac toe game in java

Design a GUI and implement Tic Tac Toe game in java

  Recursive implementation of euclids algorithm

Write a recursive implementation of Euclid's algorithm for finding the greatest common divisor (GCD) of two integers

  Data structures for a single algorithm

Data structures for a single algorithm

  Write the selection sort algorithm

Write the selection sort algorithm

  Design of sample and hold amplifiers for 100 msps by using n

The report is divided into four main parts. The introduction about sample, hold amplifier and design, bootstrap switch design followed by simulation results.

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