The aim of this assignment is to perform two tasks by employing the concept of Stack and Queue Data structure in Java. Task-1. Design a class STACK with following requirements and implement to realize the all aspects of a stack. a) Two attributes Top and Size. Top refer to a current value in stack while Size refer to the total number of elements of a stad b) A constructor used to initialize the size of stack. c) Include methods Push and Pop to insert or delete an element from the stack. Task-2. Design a class QUEUE with following requirements and implement to realize the all aspects of a queue. a) Three attributes Rear, Front and Size. b) A constructor used to initialize the size of queue. c) Include methods INSERT and DELETE to insert or delete an element from the queue.

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter18: Stacks And Queues
Section: Chapter Questions
Problem 3PE
icon
Related questions
Question
The aim of this assignment is to perform two tasks by employing the concept of Stack and Queue Data structure in Java.
Task-1.
Design a class STACK with following requirements and implement to realize the all aspects of a stack.
a) Two attributes Top and Size. Top refer to a current value in stack while Size refer to the total number of elements of a stack.
b) A constructor used to initialize the size of stack.
c) Include methods Push and Pop to insert or delete an element from the stack.
Task-2.
Design a class QUEUE with following requirements and implement to realize the all aspects of a queue.
a) Three attributes Rear, Front and Size.
b) A constructor used to initialize the size of queue.
c) Include methods INSERT and DELETE to insert or delete an element from the queue.
Transcribed Image Text:The aim of this assignment is to perform two tasks by employing the concept of Stack and Queue Data structure in Java. Task-1. Design a class STACK with following requirements and implement to realize the all aspects of a stack. a) Two attributes Top and Size. Top refer to a current value in stack while Size refer to the total number of elements of a stack. b) A constructor used to initialize the size of stack. c) Include methods Push and Pop to insert or delete an element from the stack. Task-2. Design a class QUEUE with following requirements and implement to realize the all aspects of a queue. a) Three attributes Rear, Front and Size. b) A constructor used to initialize the size of queue. c) Include methods INSERT and DELETE to insert or delete an element from the queue.
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Stack
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning