Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

LinkedListADT: Implement linked list ADT using the pacudo code covered in class You should have all the operations in the pscudo code Write test program

image text in transcribed
LinkedListADT: Implement linked list ADT using the pacudo code covered in class You should have all the operations in the pscudo code Write test program with main method creating an instance of the Linked List and calling all the operations to demonstrate they work correctly. You must implement a class called LinkedListADT and TestLinkedList class in a scparate file b) MiddleList: Write an algorithm, implemented as a method that takes a LinkedListADT object (using the above class) and integer k as parameters and prints middle element +K elements' data in the LinkedList. Evaluate and repont the time and space complexity of your algorithm. Main method should create and populate the LinkedListADT instance with some clements, call the maddlelist method with some K to print values. You must have a class called Middlelist with the algorithm (method middleList) and main method For example I (odd number of elements Linked list elements: 1 2 3 4567 89 K-2 Output: 567 For example 1 (even number of clements) Linked list elements: 1 2 345678 K 2 Output: 456 c) StackADT: Implement raw array Stack ADT to include operations for create empty stackisEmpty.?????, push, pop, and size usang the pseudo code covered in class. You should not have any other operations. Write main mcthod to demonstrate the correct working of each operation in a separate test program. Youa must implement a class called StackADT and TestStack class in a separate file d QueueADT: Implement Queue ADT using the LinkedistADT from previous exercise to include operations for create empty queue, isEmpty, isFull, enQueue, and deQueue, and size using the pseudo code covered in class. You should not have any other operations. Write main method to demonstrate the cormect working of cach operation in a separate test program You must implement a class called QuCueADT and TestQucue class in a separate file. e) QueueReverse: Write an al gorithm, implemented as a method reverseK that takes as input an instance of Queue (use the above implementation of QueueADT) and integer K. Then it uses Stack and/or Queue (use the above implementation of StackADT and QueueADT) to reverse the order of the K elements in the Queue instance. You can only use the Stack operations and Queue operations listed ahove to implement the solution and you cannot use recursion. Main method should create and populate a Queue instance, call the reversek algorithm, and display the changod Queue contents. You must implement a single class called QueucReverseK with the method reverseK and main method. The program should use the QueueADT and StackADT classes. Evaluate and report the time and space complexity of your algorithm. For example K-4 Original Queue Conten12 3 65 523 12 36 e 36 12 23

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Relational Database Design A Practical Approach

Authors: Marilyn Campbell

1st Edition

1587193175, 978-1587193170

More Books

Students also viewed these Databases questions