Stack Bash - Master data structures and algorithms

Implement a Queue using a linked list

Easy
Implement a queue using a linked list by finishing the class blueprint below.
Recall that a queue is a First in First out data structure.
Your queue has to implement the following methods:
  1. dequeue which will pop the next item from the queue
  2. enqueue which will add an item to the queue
  3. peek returns the item at the front of the queue.

Try it first

Solution

6 Essential Stacks & Queues Coding Interview Problems

Master Stacks & Queues by trying the coding challenges below.
  1. 1.Implement StackEasy
  2. 2.Implement QueueEasy
  3. 3.Valid stack sequenceMedium
  4. 4.Max StackMedium
  5. 5.Valid ParenthesesMedium
  6. 6.Simplify PathMedium