Tutorials
Courses
Data Structure
Java
Python
HTML
Interview Preparation
DSA
Practice Problems
C
C++
Java
Python
JavaScript
Data Science
Machine Learning
Courses
Linux
DevOps
SQL
Web Development
System Design
Aptitude
GfG Premium
Similar Topics
Web Technologies
37.4K+ articles
DSA
21.3K+ articles
Java
10.0K+ articles
Misc
8.5K+ articles
Java-Functions
4.2K+ articles
Java - util package
1.6K+ articles
Tree
1.4K+ articles
Java-Collections
1.1K+ articles
Linked List
993+ articles
Stack
418+ articles
Java-Stack
56 posts
Recent Articles
Popular Articles
Stack lastElement() method in Java with Example
Last Updated: 24 December 2018
The Java.util.Stack.lastElement() method in Java is used to retrieve or fetch the last element of the Stack. It returns the element present at the last index of the Stack....
read more
Java
Java-Collections
Java - util package
Java-Functions
Java-Stack
Stack lastIndexOf() method in Java with Example
Last Updated: 24 December 2018
The Java.util.Stack.lastIndexOf(Object element) method is used to check and find the occurrence of a particular element in the Stack. If the element is present in the Stac...
read more
Java
Java-Collections
Java - util package
Java-Functions
Java-Stack
Stack lastIndexOf(Object, int) method in Java with Example
Last Updated: 24 December 2018
The Java.util.Stack.lastIndexOf(Object element, int last_index) method is used to the last index of the first occurrence of the specified element in this Stack, searching ...
read more
Java
Java-Collections
Java - util package
Java-Functions
Java-Stack
Stack removeAll() method in Java with Example
Last Updated: 24 December 2018
The Java.util.Stack.removeAll(Collection col) method is used to remove all the elements from the Stack, present in the collection specified.Syntax:Stack.removeAll(Collecti...
read more
Java
Java-Collections
Java - util package
Java-Functions
Java-Stack
Stack retainAll() method in Java with Example
Last Updated: 24 December 2018
The retainAll() method of java.util.Stack class is used to retain from this stack all of its elements that are contained in the specified collection.Syntax:public boolean ...
read more
Java
Java-Collections
Java - util package
Java-Functions
Java-Stack
Stack setElementAt() method in Java with Example
Last Updated: 24 December 2018
The setElementAt() method of Java Stack is used to set the component at the specified index of this vector to be the specified object. The previous component at that posit...
read more
Java
Java-Collections
Java - util package
Java-Functions
Java-Stack
Stack size() method in Java with Example
Last Updated: 24 December 2018
The Java.util.Stack.size() method in Java is used to get the size of the Stack or the number of elements present in the Stack.Syntax:Stack.size()Parameters: The method doe...
read more
Java
Java-Collections
Java - util package
Java-Functions
Java-Stack
Stack toString() method in Java with Example
Last Updated: 24 December 2018
The toString() method of Java Stack is used to return a string representation of the elements of the Collection.The String representation comprises a set representation of...
read more
Java
Java-Collections
Java - util package
Java-Functions
Java-Stack
Stack trimToSize() method in Java with Example
Last Updated: 24 December 2018
The trimToSize() method of Stack in Java trims the capacity of an Stack instance to be the list's current capacity. This method is used to trim an Stack instance to the nu...
read more
Java
Java-Collections
Java - util package
Java-Functions
Java-Stack
Static and Dynamic Data Structures
Last Updated: 06 June 2024
Data structures are the fundamental building blocks of computer programming. They determine how data is organized, stored, and manipulated within a software application. T...
read more
Linked List
Tree
Java
Stack
Queue
Algorithms
Advanced Data Structure
Data Structures
DSA
Arrays
Java-Arrays
java-queue
Java-Stack
Java-Vector
Calculate weight of parenthesis based on the given conditions
Last Updated: 10 June 2021
Given a valid parenthesis string S, the task is to find the weight of the parenthesis based on the following conditions:Weight of "( )" is 1Weight of "AB" = weight of "A" ...
read more
Strings
Stack
Divide and Conquer
Recursion
DSA
interview-preparation
Java-HashMap
Java-Stack
Java Program to Implement Stack API
Last Updated: 27 July 2022
A stack is a linear data structure that follows a particular order in which insertion/deletion operations are performed. The order is either LIFO(Last In First Out) or FIL...
read more
Java
Technical Scripter
Java Programs
Picked
Technical Scripter 2020
Java-Stack
Check If it is Possible to Convert Binary String into Unary String
Last Updated: 11 December 2023
Given a binary string S of length N. You can apply following operation on S any number of times. Choose two adjacent characters, such that both are 1's or 0's. Then invert...
read more
Strings
Stack
Geeks Premier League
DSA
Java-Stack
Geeks Premier League 2023
How to Use Deque as a Stack in Java?
Last Updated: 29 January 2024
The Deque extends the Queue interface and provides additional methods to support operation at both ends. This interface is part of the java.util package. The Deque interfa...
read more
Java
Java Programs
Picked
Java-Collections
java-deque
Java-Stack
Java Examples
Java Program to Implement Stack Data Structure
Last Updated: 26 April 2024
Stack is the fundamental Data Structure that can follow the Last In, First Out(LIFO) principle. It can work that the last element added to the stack will be the first one ...
read more
Java
Picked
Java-Stack
Java-DSA
1
2
3
4
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our
Cookie Policy
&
Privacy Policy
Got It !