Pranay Arora

Pranay Arora

1 Articles Published

Articles by Pranay Arora

1 articles

Java program to find the maximum and minimum elements in a stack

Pranay Arora
Pranay Arora
Updated on 18-Aug-2024 539 Views

Stacks are basic data structures that follow the Last in First Out principle also termed as LIFO. A stack has many use cases like organizing function calls and undoing actions. Often one might encounter a problem locating the biggest and smallest elements inside a stack, this article will demonstrate multiple methods to accomplish this task using Java. Understanding Stacks A stack is a linear data structure that allows operations at only one end, known as the top. The primary operations include: Push: Adding an element to the top of the stack. ...

Read More
Showing 1–1 of 1 articles
« Prev 1 Next »
Advertisements