Nerd For Tech

NFT is an Educational Media House. Our mission is to bring the invaluable knowledge and experiences…

Member-only story

Implement a Queue using Stacks

Akiko Green
Nerd For Tech
Published in
4 min readFeb 15, 2023

--

A stacked sandwhich from Unsplash by Louis Hansel

I recently deep dived my way to learning implementations of Stacks & Queues. There I learned how to create my own stack & queue classes, while implementing them with arrays and linked list.

Now, I didn’t want to just “learn” what a Stack or Queue was, I wanted to really test myself to see if I understood how to solve an algorithm regarding these implementations. What better way to test my knowledge than with good old Leetcode. Before I show you how I solved this problem, please try your hand in solving it, if you have not already!

How To Implement A Queue With 2 Stacks

--

--

Nerd For Tech
Nerd For Tech

Published in Nerd For Tech

NFT is an Educational Media House. Our mission is to bring the invaluable knowledge and experiences of experts from all over the world to the novice. To know more about us, visit https://www.nerdfortech.org/.

Akiko Green
Akiko Green

Written by Akiko Green

Software Engineer, Novice Blogger, Indoor Climber and Dog sitting expert 🥰

No responses yet