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

hashCode int
The hash code for this object.
no setterinherited
isEmpty bool
Returns true if the stack is empty.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
size int
Returns the size of the stack.
no setter

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