From the course: Data Structures in JavaScript: BSTs, Queues, and Stacks

Unlock this course with a free trial

Join today to access over 24,800 courses taught by industry experts.

Difference between JavaScript data structures

Difference between JavaScript data structures - JavaScript Tutorial

From the course: Data Structures in JavaScript: BSTs, Queues, and Stacks

Difference between JavaScript data structures

- [Instructor] So you've already reviewed the basics about objects and arrays. You still have to deep dive into BSTs, queues, and stacks. So this module will just be an overview based on what you know right now on how these five data structures are alike and how they differ in some ways. First, it may be easier to compare apples to apples. Now, stacks and queues can be created in JavaScript using arrays. So, in other words, both can possibly be a arrays. If the developer chooses to use a different data structure, such as a linked list, then the initiation will be different. Arrays are a built-in data structure, and like shown in the previous module, an array can be simply declared and assigned a variable. This would be the same if using an array to create a stack or a queue. For this course, you will use arrays to create stacks and queues. You reviewed arrays earlier in this course, and hopefully, you are comfortable with this basic data structure. However, to compare and contrast…

Contents