Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- export class Frame {
- constructor (value) {
- this.value = value;
- this.next = null;
- }
- }
- export class Stack {
- constructor() {
- this.root = null;
- }
- push(frame) {
- let newFrame;
- let current = this.root;
- if(this.root === null){
- this.root = newFrame;
- }else{
- newFrame.next = this.root;
- this.root = newFrame;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement