Stacks, Queues and Trees Complete Guide 2023 | Data Structures Simplified for Beginners

preview_player
Показать описание

🔹 What are Stacks and Queues in Data Structure and Algorithm?

- Stack is a last in first out (lifo) linear data structure. Imagine stack in DS Algo as a pile of blocks. You can remove the block at the top quite easily. But if you have to remove the block at the end of the pile, you have to remove all the other blocks as well. Elements in Stack can be inserted or deleted only from one side. The insertion of an element into a stack is called push operation and the deletion of an element from the stack is called the pop operation.

- Queue is a first in first out (fifo) linear data structure. Elements in Queue can only be inserted and deleted from opposite sides. The insertion of an element in Queue is called as enqueue operation and the deletion of an element is referred to as an dequeue operation.

🔹 Trees in Data Structures:
A viable addition to a coder's toolkit, Trees are powerful data structures. They help in solving a lot of complex problems. Compared to other data structures such as arrays, linked lists, stacks and queues, a Tree is non-linear in nature and stores data in hierarchy style.

There are primarily 5 different types of Binary Trees: Rooted Binary Tree, Full Tree, Complete Tree, Almost Complete Tree and Skewed Tree.

🔹 Few Advantages and Applications of Binary Trees:
- An effective data structure to represent hierarchies or XML data.
- Variations of trees like B+ Trees are used to implement indexing in databases.
- Binary Search Tree provides efficient insertion and deletion searching operations.

The following topics are covered in this "Stacks, Queues and Trees complete guide" 👇🏼
0:00 - Introduction to Stacks and Queues
1:19 - What is a Stack?
4:50 - Operations on Stacks
9:09 - Applications of Stacks
12:13 - Implementation of Stack
48:40 - Queue in Data Structure
56:53 - Nearest Smaller Element Problem
1:05:36 - Largest Rectangle in Histogram Problem
1:25:18 - Sliding Window Maximum Problem
1:41:26 - Importance of Trees in Data Structures
1:42:22 - Introduction to Trees
1:53:19 - Applications of Trees
1:57:02 - Balanced Binary Tree Problem
2:09:12 - Inorder Traversal of Cartesian Tree
2:31:36 - Identical Binary Trees
2:35:33 - BST Sum Problem
2:42:28 - Max Base Pair Problem

---------------------------------------- About Scaler --------------------------------------------------

We are a tech-focused upskilling and reskilling platform catering to tech enthusiasts in universities and working professionals. There are more Scaler graduates working at Amazon than all of the IITs combined!

📌 Follow us on Social and be a part of an amazing tech community📌

🔔 Hit that bell icon to get notified of all our new videos 🔔

If you liked this video, please don't forget to like and comment. Never miss out on our exclusive videos to help boost your coding career! Subscribe to Scaler now!

#datastructure #stacks #queues #trees
Рекомендации по теме
Комментарии
Автор

Got a question? Feel free to drop them in the comments below! We will make sure all your queries are answered.

SCALER
Автор

If I have a queue, and it's a tasks queue, once that one task is completed I should remove the element from the queue, or just move the pointers?

midhununni