toStack method
will convert iterable into a Stack data structure
example:
1,2,3,4
.toStack()
stack.pop()
stack.push(5)
Implementation
StackX<T> toStack() {
final stack = StackX<T>();
stack.addAll(this);
return stack;
}
will convert iterable into a Stack data structure
example:
1,2,3,4
.toStack()
stack.pop()
stack.push(5)
StackX<T> toStack() {
final stack = StackX<T>();
stack.addAll(this);
return stack;
}