
- Create an implementation of each LinkedList, Queue Stack interface provided
- For each implementation create a tester to verify the implementation of that
data structure performs as expected
Your task is to:
- Implement the provided Stack interface ( fill out the implementation shell)
- Put your implementation through its paces by exercising each of the methods in a test harness.
- Add to your ‘StagBusClient’ the following functionality using your Stack -
- Create (push) 6 riders by name
- Iterate over the stack, print all riders
- Peek at the stack / print the result
- Remove (pop) the top of the stack
- Iterate over the stack, print all riders
- Peek at the stack / print the result
- Add two more riders to the stack
- Peek at the stack & print the result
- Remove all riders from the stack
- Verify the stack is now empty ( print that result )
Implementation of the provided interfaces
Functioning test harness. Each of these will have a main() & a series of method calls helping you vet if your respective component does what you expect.
StagBusClient.java
package app;
import stack.Stack;
import stack.StackImpl;
public class StagBusClient {
public static void main(String[] args) {
// create implementation, then
//StackRunTestMethod...
System.out.println("----S T A C K T E S T-------");
}
}
Stack.java
package stack;
public interface Stack {
public void push(String s);
public String pop();
public Boolean isEmpty();
public Boolean isFull();
public int size();
public String peek();
public void setCapacity(int size);
public void display();
}
StackImpl.java
package stack;
public class StackImpl implements Stack {
}
StackTester.java
package stack;
public class StackTester {
public static void main(String[] args) {
}
public static void runTests(Stack stack) {
}
}

Step by stepSolved in 3 steps with 1 images

- Create an implementation of each LinkedList, Queue Stack interface provided For each implementation create a tester to verify the implementation of thatdata structure performs as expected Your task is to: Implement the LinkedList interface ( fill out the implementation shell). Put your implementation through its paces by exercising each of the methods in the test harness Create a client ( a class with a main ) ‘StagBusClient’ which builds a bus route by performing the following operations on your linked list: Create (insert) 4 stations List the stations Check if a station is in the list (print result) Check for a station that exists, and one that doesn’t Remove a station List the stations Add a station before another station. List the stations Add a station after another station. Print the stations StagBusClient.java package app; import linkedList.LinkedList; import linkedList.LinkedListImpl; public class StagBusClient { public static void main(String[] args) { // create…arrow_forwardWrite a C code for the structure types of a dynamic linked list implementation of a stack. Each node of the stack will have the following members: Name: char type array ID: integer type number Grade: double type number Link: pointer/link to next nodeWrite functions to add and remove the nodes of the stack and use printf() to show that the code is working properly.arrow_forwardThe ADT stack lets you peek at its top entry without removing it. For some applications of stacks, you also need to peek at the entry beneath the top entry without removing it. We will call such an operation peek2. If the stack has more than one entry, peek2 returns the second entry from the top without altering the stack. If the stack has fewer than two entries, peek2 throws an exception. Write a linked implementation of a stack class call First_Last_LinkStack.java that includes a method peek2arrow_forward
- In Java and in C++ the best way to implement a Stack is by deriving from any implementation of the ADT List. For instance: class Queue : public DoublelinkedList { }; True Falsearrow_forwardProject Overview: This project is for testing the use and understanding of stacks. In this assignment, you will be writing a program that reads in a stream of text and tests for mismatched delimiters. First, you will create a stack class that stores, in each node, a character (char), a line number (int) and a character count (int). This can either be based on a dynamic stack or a static stack from the book, modified according to these requirements. I suggest using a stack of structs that have the char, line number and character count as members, but you can do this separately if you wish.Second, your program should start reading in lines of text from the user. This reading in of lines of text (using getline) should only end when it receives the line “DONE”.While the text is being read, you will use this stack to test for matching “blocks”. That is, the text coming in will have the delimiters to bracket information into blocks, the braces {}, parentheses (), and brackets [ ]. A string…arrow_forwardThere is a data structure called a drop-out stack that behaveslike a stack in every respect except that if the stack size is n,then when the n+1 element is pushed, the first element is lost.Implement a drop-out stack using linksarrow_forward
- Write a push method for a stack implemented as a linked structure. You may assume that the implementation has the top element of the stack referenced by a LinearNode reference top and that an integer variable count keeps track of the number of elements in the stack. Hint: LinearNode class has a method called setNext which allows to reference a LinearNode object.arrow_forwardSimple JAVA linkedlist code implementation please help and complete any part you can - Without using the java collections interface (ie do not import java.util.List,LinkedList, Stack, Queue...)- Create an implementation of LinkedList interface- For the implementation create a tester to verify the implementation of thatdata structure performs as expected Build Bus Route – Linked List- Your task is to:o Implement the LinkedList interface (fill out the implementation shell)o Put your implementation through its paces by exercising each of themethods in the test harnesso Create a client (a class with a main) ‘BusClient’ which builds a busroute by performing the following operations on your linked list:o§ Create (insert) 4 stations§ List the stations§ Check if a station is in the list (print result)• Check for a station that exists, and onethat doesn’t§ Remove a station§ List the stations§ Add a station before another station§ List the stations§ Add a station after another station§ Print the…arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education





