added frontend
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
class GlobalStack<T> {
|
||||
final _list = <T>[];
|
||||
|
||||
void push(T value) => _list.add(value);
|
||||
|
||||
T pop() => _list.removeLast();
|
||||
|
||||
T peek() => _list.last;
|
||||
|
||||
bool get isEmpty => _list.isEmpty;
|
||||
|
||||
bool get isNotEmpty => _list.isNotEmpty;
|
||||
|
||||
@override
|
||||
String toString() => _list.toString();
|
||||
}
|
||||
Reference in New Issue
Block a user