Question: Lab 7 : Stack Objective ( s ) Stack implementation using arrays Stack implementation using Linked List Tool ( s ) / Software Java programming
Lab : Stack
Objectives
Stack implementation using arrays
Stack implementation using Linked List
ToolsSoftware
Java programming language with NetBeans IDE.
Description
Stack Implementation in Java Using Array
public class StackArray
int top;
int Stack;
public StackArrayint capacity
Stack new int capacity;
top ;
STACK BASIC FUNCTIONS:
isEmpty: Examines whether the stack is empty or not
isFull: Examines whether the stack is full or not
Pushint value: Add a value at the top of the stack
Toppeek: ReturnRead the value at the top of the stack
Pop: Remove the value from the top of the stack
Display: Displays all the elements in the stack
makeEmpty: Delete all elements from stack
size: Return the number of elements in the stack
TasksAssignmentss
Create StackArray class in Java that implements Stack using Array and implement all the methods for the following stack operations: push, pop, top, size, isEmpty, isFull, display and makeEmpty.
In the main, create object S from StackArray, push some values and print the top after each push operation.
Create StackLinkedList class in Java that implements Stack using Singly Linked List and implement all the methods for the following stack operations: push, pop, top, size, isEmpty, display and makeEmpty.
In the main, create object S from StackLinkedList, pop all elements from stack and push them into
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
