BrianHook1183 / DSA-Data_Structures_Stacks-and-Queues

bootcamp assignment

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Tasks

Complete the following tasks to pass the tests and this assignment. Just like in the checkpoint, you will use a linked list in your implementation.

  1. In the src/Stack.js file:
  • Complete the push() method to insert a node into the stack. The method should accept an argument data that represents the data to be stored in the node. Use the provided _Node class to create new node instances.

  • Complete the pop() method to remove a node from a stack. The method should return the data stored in the deleted node.

  1. In the src/Queue.js file:
  • Complete the enqueue() method to insert a node into a queue. The method should accept an argument data that represents the data to be stored in the node. Use the provided _Node class to create new node instances.

  • Complete the dequeue() method to remove a node from a queue. The method should return the data stored in the deleted node. If the queue is already empty, then the method should return undefined.

About

bootcamp assignment


Languages

Language:JavaScript 100.0%