Stacks and Queues — BaseCS Video Series

"Stack level too deep!"

Stacks and queues are all around us. In this video we break down what they are, how they work, and their place in every day software development.

For more on Stacks and queues, check out this post:

If you have questions or comments, please feel free to share below.

SparkPost Logo

This video series is sponsored by SparkPost. There's never been a better way for developers to send email.

Really great videos! Even though I'm well familiar with these concepts, it was a good reminder, and I have half a page of notes for expanding and improving my company's high-efficiency implementations.

Wonderful episode. Welcome back Vaidehi!

Loving this series! I'm a visual learner so this style is just perfect for me!

Great video, really appreciated the illustrations 👌🏾

I took CS in university, but I'm really enjoying this series. It's so well done. I love your drawings. They really help the concepts sink in for viewers. Looking forward to the next one. Keep up the great work Vaidehi!

Thanks 🙏 vaidehi joshi ...really appreciating for helping to learn and giving confident on understanding i can do it👩🏻‍🎓☺️

Hey, when you say an Array is a static Data Structure, I understand, coz in Java an array is created with an initial size. But in javaScript, arrays are dynamic. So can't see implement a stack using arrays in JavaScript.

You can easily do it with arrays. A small example:

class Stack {
    constructor() {
        this.stack = [];
    push(element) {
    top() {
        return this.stack[this.stack.length - 1];

    pop() {
        return this.stack.pop();

    toArray() {
        return Array.from(this.stack);

    isEmpty() {
        return this.stack.length === 0;

You could tune it a bit to check for a maximum size or stuff like that :)

Thanks. But in this way, the stack can never get filled up, coz the array ain't static. I think different languages, have their different implementation of abstract structures. In java, you can't implement a stack with an array coz its fixed

You can always "fix" the array if you want by adding a size to the constructor. Then you check if the size is met whenever you push a new value to the stack. So yeah, the language can give you other constructs and other ways to do something, but it's totally possible to do it in JavaScript

Classic DEV Post from Sep 8 '17

What's your favorite useless repo/package/website/etc?

So I'm trying to remedy my carpal tunnel by considering making the decision to ...

Follow @andy to see more of their posts in your feed.