StackList<T>.fromList constructor

StackList<T>.fromList(
  1. 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);
}