Stack<T> class
Complexity of each operation
operation | complexity size | O(1) isEmpty | O(1) peek | O(1) push | O(1) pop | O(n) Implementation of Stack using a SinglyLinkedList
Constructors
- Stack()
Properties
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
peek(
) → T? - Displays the element on the top of the stack. This method returns null if the stack is empty.
-
pop(
) → T? - Pops an element from the top of the stack. This method returns the popped element or returns null if the stack is empty.
-
push(
T obj) → void - Pushes an element to the top of the stack.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited