StackList<T>.fromList constructor
StackList<T>.fromList (
- List<
T> initialStack
Creates a stack from initialStack
by pushing each element of the list
onto the stack from first to last.
Implementation
StackList.fromList(List<T> initialStack) {
initialStack.forEach(push);
}