Lecture 60: Queues in C++ [STL + Implementation + Types of Queues ]

preview_player
Показать описание
In this Video, we are going to learn about Queue Data Structure and its types.

There is a lot to learn, Keep in mind “ Mnn bhot karega k chor yrr apne se nahi hoga ya maza nahi aara, Just ask 1 question “ Why I started ? “

Questions Links:

Do provide you feedback in the comments, we are going to make it best collectively.

Connect with me here:

Telegram Group Link: Love Babbar CODE HELP

Intro Sequence: We have bought all the required Licenses of the Audio, Video & Animation used.

Timestamps:

00:00 - Introduction to Queue
04:24 - Promotion
05:15 - Operations in Queue
05:47 - STL Queue
08:20 - STL Coding
11:50 - Implementing Queue using arrays
19:35 - Code
24:45 - Circular Queue
31:15 - Code
42:55 - Input Restricted Queue
43:52 - Output Restricted Queue
44:00 - Doubly Ended Queue
52:49 - STL Code
56:00 - Implementation Deque Code

#DSABusted #LoveBabbar
Рекомендации по теме
Комментарии
Автор

I am a working professional and the way that you teach all these problems and DSA, I don't think anyone can do a better job than this. Thank you for your efforts

alokkumar-bpsg
Автор

हिन्दी मीडियम वालों के लिए ये सीरीज वरदान से कम नहीं है।

KD_MEENA
Автор

In a circular queue, the condition (r + 1) % size == f is used to check if the queue is full. This condition ensures that the next position to enqueue is equal to the front position f when the queue is full.

If you change the condition to r = (f-1) % (size-1), you are attempting to calculate the new rear position differently. However, this calculation doesn't correctly determine the circular nature of the queue because it doesn't handle wrap-around properly. Using (r + 1) % size is the correct way to calculate the next rear position, ensuring that the queue wraps around when it reaches the end of the array.

LivewithPawan
Автор

bhai log
ye video ko like karo yaar
banda itni mehnat se banaya hamare itna toh krsakte ho na tumlog
brother really kitne kam likes hai....itne ache content pe

rookie
Автор

Thank you so much for all your efforts
## TODO
- [x] Concept of Queue
- [x] Implementation of Queue using Array
- [x] Implementation of Circular Queue
- [x] Implementation of Deque
- [x] Practice Deque using STL
- [ ] Implementaiton of Queue using Linked List

abhyaskanaujia
Автор

From Pointers To LinkedList to Stacks, from stacks to queues everything shows an awesome hardwork from you bhaiya

harshidashaily
Автор

Completed Bhaiya 😊
Deque was really good, bhaiya I realise ki coding krne se pehle agar thoda paper work ho jata h toh cheeze bhut easy ho jaati h, the biggest mistake I was doing ki pehle coding krne m hi lag zata tha instead paper work...😊

iEntertainmentFunShorts
Автор

Present sir!!! Thanks for working so hard and offering such a consistency 💯💯

ritikamehta
Автор

Can't believe that I am on 60th video of this course and I have learned Queue as well🥺❤❤

lalitbisht
Автор

#include <bits/stdc++.h>

class node{
public:
int data;
node* next;

node(int d){
data = d;
next = NULL;
}
};

class Queue {

node* Front;
node* rear;


public:
Queue() {
// Implement the Constructor
Front = NULL;
rear = NULL;
}

Public Functions of Queue

bool isEmpty() {
// Implement the isEmpty() function
if(Front == NULL)
return true;
else return false;
}

void enqueue(int data) {
// Implement the enqueue() function
node* temp = new node(data);

if(rear == NULL){
rear = temp;
Front = temp;
}
else{
rear->next = temp;
rear = temp;
}

}

int dequeue() {
// Implement the dequeue() function
if(Front == NULL)
return -1;

int val = Front->data;
node* temp = Front;
Front = Front->next;;
if(Front == NULL){
rear = NULL;
}
free(temp);
return val;
}

int front() {
// Implement the front() function
if(Front == NULL)
return -1;

return Front->data;
}
};

ajazahmed
Автор

dil se respect, for making such kind of extraordinary series

GoodWasteOfTime
Автор

My coding is improved after watching your videos thanks 😊

sadaf_r
Автор

In the circular queue in condition of full why did we divided by size-1
Rear== (fromt -1)%(size -1)

sahilrao
Автор

Thank you so much bhaiya for this DSA course, its really very helpful❤️

ishikapoptani
Автор

at 34:04, bhaiya, u could have used only else { rear = (rear +1)%10} everything is just amazing ...thank you soo much bhaiya ❤

shripandey
Автор

Love you love babber bhai....
Thank you for this placement series ❤❤❤❤

codewithnewthinking
Автор

Bhaiya in case of enque operation for incrementing the rear we can do like:
rear = (rear+1)%size;
as well in case of deque we can do like:
front=(front+1)%size;

ek_bangali_engineer
Автор

nice bhaiyaa sub kuch samaj aya ..ekdum bdhiya tarike se ...love u bhiyaa..keep it up!!!

prashantbirajdar
Автор

STL k sath questions ka approach aise hi batate rahe aage ki vdo's me 💎🙏🏻🙏🏻

aman
Автор

Yes bhaiya, someone commented for notes, yes please. Those would be really helpful.
Please, try providing us with notes as well please

hopes_alive-