Java Stack
Jakob Jenkov
The Java Stack class represents a classic stack as you know it from an algorithms and data structures class. The Java Stack class thus works similarly to a stack of plates, where you can add plates to the top of the stack, and also remove plates from the top of the stack. This Java Stack tutorial explains the basics of how to use the Java Stack class. Note: You can also use a Java Deque as a stack. See links below to my Java Deque tutorial.
stack.push() : Add an element to the top of the stack stack.pop() : Remove an element from the top of the stack
Chapters 0:00 Java Stack introduction 1:25 Java Stack is synchronized - consider using a Deque instead 1:56 Java Stack witih generic types 3:15 Peek at top element on a Java Stack 4:10 Search for an element in a Java Stack 5:48 Iterate elements of a Java Stack 8:03 Reverse elements of a Java List using a Java Stack 10:28 Use a Java Deque as a Java Stack
Java Deque tutorial - text http://tutorials.jenkov.com/java-collections/deque.html Java Deque tutorial - video https://www.youtube.com/watch?v=gXZt4P97UW4&list=PLL8woMHwr36HmQfxqqqxns5GexTNmxFqK&index=6
Java Lambda Expressions tutorial - text http://tutorials.jenkov.com/java/lambda-expressions.html Java Lambda Expressions tutorial - video https://www.youtube.com/watch?v=lIXs4Y8sJCk&list=PLL8woMHwr36HQhhPPdV_T8rigbuywMpD7
Java Streams API tutorial - text http://tutorials.jenkov.com/java-functional-programming/streams.html Java Streams API tutorial - video https://www.youtube.com/watch?v=bcrl-GL0vV4&list=PLL8woMHwr36F6ibmwjaJm0bMnsZWwXVWQ&index=2 ... https://www.youtube.com/watch?v=13uQ8dgqbno
33127326 Bytes