Introduction to Queue Data Structure | C++ Placement Course | Lecture 24.1

Поделиться
HTML-код
  • Опубликовано: 2 авг 2024
  • Complete C++ Placement Course (Data Structures+Algorithm) : • C++ Full Course | C++...
    Telegram: t.me/apnikakshaofficial
    Instagram: / dhattarwalaman
    Notes of this Lecture:drive.google.com/file/d/1LvRC...

Комментарии • 212

  • @aaryeshprakristh5584
    @aaryeshprakristh5584 3 года назад +18

    thank god didi continued from here

  • @hassankamran3480
    @hassankamran3480 2 года назад +5

    I appreciate, ...really helpful.

  • @ashishharakuni2467
    @ashishharakuni2467 2 года назад +1

    This is really amazing! wow........................

  • @JackCoderr
    @JackCoderr Год назад +1

    very nice and precise explaination ,,, thank you so much didi...

  • @studytoon4364
    @studytoon4364 2 года назад +37

    here's the code :)
    #include
    using namespace std;
    #define n 20
    class queue{
    int * arr;int back;
    int front;
    public:
    queue(){
    arr=new int[n];
    front=-1;
    back=-1;
    }
    void Enqueue(int x){
    if (back==n-1){
    cout

    • @Nakul_G
      @Nakul_G 7 месяцев назад

      ooo re bhaiii thankss

  • @DineshSharma-pp3ox
    @DineshSharma-pp3ox 2 года назад +2

    This is very helpful video❤️❤️❤️

  • @rahulkumarsharma4057
    @rahulkumarsharma4057 Год назад +5

    Didi is so busy in shifting from apni kaksha to apna college that in the intro she said "welcome to apni kaksha" instead of apna college.
    Apart from that you are a great teacher

  • @hammadfaiz2283
    @hammadfaiz2283 2 года назад +11

    In pop operation first we have to reset the values of front and rear to -1.After that we have to increment the front otherwise the code will not work perfectly. See this
    int pop()
    {
    int data;
    //check empty or not
    if (empty()) {cout

  • @mudassirshoukat3395
    @mudassirshoukat3395 2 года назад

    Thank you sister. Your lecture helped me.

  • @islamicTv-fx7tx
    @islamicTv-fx7tx 2 месяца назад

    Are yaar aache se samaj aaya hame 😌 apka dhanyavaad ☺

  • @arifazaib1528
    @arifazaib1528 2 месяца назад

    Thanks a lot. You made programming easier for me

  • @raghavpatodiya8429
    @raghavpatodiya8429 Год назад +3

    This code is wrong at soo many levels, the most prominent one being, like here we have fixed length queue of 20, now in main function try to enqueue 15 times, dequeue 10 times, and then again try to enqueue 10 times, then you will understand that even when the queue seems empty it will output queue is full.
    Basically the dequeue functions is wrong, it should be as following -
    void dequeue(){
    if (front==-1 || front>back) {
    cout

  • @lenovox1carbon664
    @lenovox1carbon664 2 года назад +2

    11:41 My man got popcorns even before getting the tickets for the movie XD

  • @hamdaqadeer7950
    @hamdaqadeer7950 Год назад

    Thanku so much for this ♥️

  • @AmanSingh-rz1rj
    @AmanSingh-rz1rj 3 года назад +6

    Thank you so much di
    I need this video

  • @shaileshhacker
    @shaileshhacker 2 года назад +1

    9:31
    //Ninja Technique to write empty() function...
    bool empty()
    {
    return front == -1 || front > back;
    }

  • @medipakpagare
    @medipakpagare 3 года назад +1

    Best content

  • @vivek_1300
    @vivek_1300 Год назад +1

    nice explanation 👍

  • @hassixmalik9071
    @hassixmalik9071 2 года назад +43

    Great way of conveying. One recomendation is that if you replace mic for recording audio then it would be much better because there is a lot of distortion in your mic

    • @mdkaifansari8088
      @mdkaifansari8088 Год назад +2

      Yes

    • @pritamdas7780
      @pritamdas7780 11 месяцев назад +2

      literally ..it's very disturbing..

    • @Nakul_G
      @Nakul_G 7 месяцев назад +1

      me soch ra mera earphone kharab hai🥲

  • @aadityadalal7190
    @aadityadalal7190 3 года назад +2

    Speed of Light ⚡⚡

  • @meharnabeel4392
    @meharnabeel4392 2 года назад

    Impressive 🥀❤️❤️💯

  • @harshaaravala2861
    @harshaaravala2861 Год назад +2

    Goddamn this is good. I was skeptical at first about a free yt video but it fares much better than a lot of paid ones. Only issue was the mic was a bit loud at times and the case of checking if the queue is empty could be elaborated but otherwise it does a really good job of getting across what is necessary.

  • @blazemates
    @blazemates 2 года назад

    Is it better to use return statement in if rather than if else?if y or n how

  • @Tinkalkumar0p
    @Tinkalkumar0p 3 года назад +6

    Thanks didid

  • @AbhishekGupta-lw9tb
    @AbhishekGupta-lw9tb 2 года назад +2

    Ma'am don't know how to thank you ,but Ma'am Really Thank You, literally
    Aaj tak jo cheeg samajh nahi paaya tha wo bhi aapke samjhane se samajh gaya,Dhanyawad Maam
    Aap Aise hi padhati raho,hum padhte rahe aur jaldi jaldi cheezo ko seekh ke aage badhte rahe Ma"am

  • @soumikmukherjee4797
    @soumikmukherjee4797 3 года назад +31

    A random girl named Neha after listening her name again and again on this course be like:
    "Maine kya bigaada tha aapka"

  • @viveksingh_01
    @viveksingh_01 3 года назад +19

    Mam mic issue is super annoying.
    Please take care of that next time.
    Else video is very nice.

  • @hustler516
    @hustler516 2 года назад +121

    Didi said '' welcome to apni kaksha"..... Anybody noticed?

  • @D_A_B_I
    @D_A_B_I 3 года назад +21

    0:01 apni *kaksha* 😑

  • @akshatshahjade6344
    @akshatshahjade6344 Год назад

    What if we set initial starting conditions as
    front =0;
    back =-1;
    then we don't need separate if condition for the beginning

  • @factwithhunny078
    @factwithhunny078 Год назад

    ❤️❤️❤️❤️what a voice

  • @yashchampaneri1972
    @yashchampaneri1972 3 года назад +6

    0:01
    Didi apni kaksha nahi, apna college! 🤨🧐

  • @sohamsamanta
    @sohamsamanta 3 года назад +1

    Apni Kaksha ....

  • @iemmadhav
    @iemmadhav 3 года назад +2

    But bhaiya big big big thanks to you. You are above all ❤️

  • @suhruthvattem1312
    @suhruthvattem1312 3 года назад +2

    Thank you aman bhai🙏✌

  • @sushantphalke6752
    @sushantphalke6752 3 года назад +25

    video is amazing like every video
    your voice is also amazing .
    but what happened with mic its super annoying ear burned

    • @Adityasharma-oe8zp
      @Adityasharma-oe8zp 3 года назад +2

      Mujhe laga naye headphones ka kharcha aa gaya😂😂😂

    • @strokeadda01
      @strokeadda01 3 года назад

      @@Adityasharma-oe8zp 😂😂lol

    • @sumitsharma6738
      @sumitsharma6738 3 года назад +1

      mujhe laga mere hi kharab hai xd

  • @ravikjha07
    @ravikjha07 2 года назад +9

    If we are just using front++ for pop function , then suppose capacity = 3 , we pushed 3 elements 3 , 7 and 8 . so front = 0 and back = 2 . Now , if we are popping them out front will become 3 by the time queue gets empty. SO if we will try to push something back is actually equal to n-1 i.e 2 so queue is full while it should be empty , so it prints Queue Overflow while queue is empty.
    Thank You For The Session....

    • @sahil1053
      @sahil1053 2 года назад +2

      The same question in my brain 🧠

    • @chinmaypimpalgaonkar6949
      @chinmaypimpalgaonkar6949 2 года назад +2

      Means when we full queue and make it empty by pop method, then we cant push element in it?

    • @ravikjha07
      @ravikjha07 2 года назад +1

      @@chinmaypimpalgaonkar6949 Yes , according to the method shared by Sir in this video . Actually Sir has made a mistake that instead of just changing the value of front he should shift entire elements left by 1 , check it out on GeeksForGeeks for better understanding

    • @chinmaypimpalgaonkar6949
      @chinmaypimpalgaonkar6949 2 года назад +1

      @@ravikjha07 yeah

    • @akashrathod2136
      @akashrathod2136 2 года назад +1

      Yes you are saying correct but to handle this situation we have another concept which is called circular queue....
      Here in this video they are explaining the basics/beginners queue concept to make beginners understand what queue actually is...

  • @SahilShaikh-wr7cd
    @SahilShaikh-wr7cd 3 года назад +2

    World no.1. Channel for student ❤❤

  • @abhishekporwal7969
    @abhishekporwal7969 3 года назад

    Aapke discription me jo playlist ki link di hui he usme kuch mistake he
    Not found bta rha he us pr click krne pr

  • @ishikatechworld6739
    @ishikatechworld6739 3 года назад +1

    How many more vedios to complete this course??

  • @Bulbul_2820
    @Bulbul_2820 3 года назад +1

    Ma'am u r tooo gud... Tq .... 🙌🙌🥰🥰mata rani kre ap Bss aise hi pdate rho.

  • @addy_foxer6475
    @addy_foxer6475 3 года назад +1

    why we are using return -1? exactly what it will do ?

    • @taniyasharma4625
      @taniyasharma4625 3 года назад +3

      Coz data type of function is int so we have to return some value so in this case we are returning -1

  • @piyushbansal9716
    @piyushbansal9716 3 года назад +3

    Amazing content
    Keep going :)

  • @patrickbhardwaj007
    @patrickbhardwaj007 3 года назад +11

    Why are you using stack's operations in queue code?

    • @kunalaggarwal1928
      @kunalaggarwal1928 3 года назад +1

      these are not inbuilt fucntions you can make any name if its your own defined.

  • @vanisiddhu3469
    @vanisiddhu3469 3 года назад +2

    👍👍

  • @EventHorizonHub
    @EventHorizonHub 2 года назад

    Mostly yar word hi use hwa is video ma but very informative video 💕💕💕💕

  • @AqeelAshrafF-BSSE-
    @AqeelAshrafF-BSSE- 2 года назад +1

    Mam front-- nhi ho ga jab pop krna ha @ Apna College

  • @mrinalmondal493
    @mrinalmondal493 3 года назад +4

    Thank you didi

  • @55_d_shivamsingh42
    @55_d_shivamsingh42 Год назад

    why did we use 'new' keyword to define the array ?
    why int *arr ?

  • @rishabh9736
    @rishabh9736 3 года назад

    🔥🔥🔥🔥🔥🔥🔥

  • @iemmadhav
    @iemmadhav 3 года назад +1

    Apni kaksha pr

  • @Musicking39921
    @Musicking39921 2 месяца назад

    I saw this video before 3 hours of my exam

  • @sarthaksinha5798
    @sarthaksinha5798 Год назад +2

    #include
    using namespace std;
    struct Queue{
    int *arr;
    int size;
    int r,f;
    Queue(int n){
    size=n;
    f=0;
    r=0;
    arr=new int;
    }
    void capacity(){
    cout

  • @samliger9058
    @samliger9058 5 месяцев назад

    Wrote the exact same code but C++ still needs a type specifier for all declarations

  • @prathameshdeshmukh6753
    @prathameshdeshmukh6753 3 года назад

    Not apni kaksha
    Welcome to apna college

  • @ravikumarsingh6882
    @ravikumarsingh6882 3 года назад

    background music is very attractive........

  • @sparshtaneja
    @sparshtaneja 3 года назад +1

    i guess video apni kaksha ke leye bana rahe the
    0:01/11:41 apni kaksha

  • @adamsapple3070
    @adamsapple3070 3 года назад +3

    Why cant we use #include instead of creating a seperate class queue

    • @shivanshpratap3624
      @shivanshpratap3624 3 года назад +1

      We can, but In interviews you might asked to create a Queue and do some operations.

    • @adamsapple3070
      @adamsapple3070 3 года назад +1

      @@shivanshpratap3624 ahh makes sense.... thanks

  • @soumelee5661
    @soumelee5661 2 года назад

    nice

  • @Kingofbackbenchers
    @Kingofbackbenchers 4 месяца назад +1

    Ye yar yar वाली बीमारी तेजी से बढ़ रही है 😅😂😅😂

  • @shoryarawat9835
    @shoryarawat9835 2 года назад

    mam isme jab hum pop operation karte hai to array me values rehe jaati haina? or har pop operation ke baad array ka size chotta hota jata haina? kyuki apne 20 space ka banaya array, har pop operation ke baad wo ek box aage badhta hai.

    • @vishnusudarsanam5375
      @vishnusudarsanam5375 2 года назад

      We cannot remove poped or dequeued values as we are dealing with an array. We cannot deallocate index 1 while having data in succeeding indices ie.., 2,3,4... If we want to do that we have to copy the whole data from deallocated index up to the end and reallocate it from the deallocated index, where we have to deal with time complexity. Another approach is we can simply replace the data where we want to deallocate, with 0 or another value but all of them are integers so we can't differentiate whether we deallocated it or its originally having 0 or whatever value we use to replace. Another way is we can use the Integer type(in java) which accepts null. So to avoid all these things we usually use a linked list, we can allocate dynamically as well as we can deallocate data in the linked list.

    • @shoryarawat9835
      @shoryarawat9835 2 года назад

      @@vishnusudarsanam5375 thank u sir.

  • @subhamengine1143
    @subhamengine1143 3 года назад

    welcome to apni kaksha hahhahhah

  • @anjalijaiswal7505
    @anjalijaiswal7505 3 года назад +5

    she said front and back are pointers..to un k aage * lagana padega na?? ........
    Aur while doing pop operation front++ kri hai sirf to wo piche element ne jo memory consume kiya tha wo apne aap khali hogayega kya??
    if anyone knows about this please help

    • @arghyadeepmukherjee3484
      @arghyadeepmukherjee3484 3 года назад +5

      Wo pointer yaha pe literally pointer nahi batata hai.... wo yaha pe index ko bata rahi hai didi.... aur pop karte wakt front++ jab karte ho.... tab piche ke memory wahi pe rehte hai...... array mei kya hai kya nahi hai hume matlab nahi....
      Hume matlab hai ki front aur back ke bich mei kya hai.... agar follow kiya hoga apne ...
      arr[front] likhte hai... front aur back yaha normal integers hai... joki hum index ki tarah use kar rahe hai... to access elements from the array....

  • @Adityasharma-oe8zp
    @Adityasharma-oe8zp 3 года назад

    Hulle hullare hulle hulle hulle😎😎😎

  • @rakibmondal3151
    @rakibmondal3151 3 года назад +1

    Mic prblm ?

  • @ankitpatidar7194
    @ankitpatidar7194 2 года назад +1

    why have we created int*arr and not just a int arr[ ]???

    • @MSIS-xo3yr
      @MSIS-xo3yr 2 года назад

      To create dynamic array

  • @indukurisatyasrivarma2658
    @indukurisatyasrivarma2658 5 месяцев назад

    I think the push operation needs to be changed. please see the below scenario
    operation 1.) I declared an array of size 5. I pushed 5 elements to it(array is full). then front= 0 and back= 4.
    operation 2.) I popped one element from the array. then front = 1 and back= 4. (which means the there is one available space in the queue because we popped the element).
    operation 3.) Now again I am pushing an element but as the back= 4 [size-1], the if statement runs and, the program considers the queue is full even though there is one available space.
    Isn't this a bug in the program. I mean even when there is space in the queue, it is still considering the queue is full.
    I request someone who is familiar with this to please reply. Thank you.

  • @nitinchandel4786
    @nitinchandel4786 3 года назад +1

    I love you aman bhai

  • @K-EC-AmanKumar
    @K-EC-AmanKumar 2 года назад

    I am getting error ""queue" is ambiguous"

  • @piyushjaiswal1180
    @piyushjaiswal1180 2 года назад +1

    yaar konsa keyword hai ?? please explain in 5 marks.

  • @prathamrana8433
    @prathamrana8433 3 года назад +4

    Thank you dii ek doubt class k liye Bhi RUclips Mai live class rkh lo plzz,🙏🙏🙏🙏🙏🙏

  • @vishalkumarpal9897
    @vishalkumarpal9897 2 года назад

    new is keyword???
    if yes then when we use this key word (at:-5:40 timing in video)
    please reply me.

    • @shadowmonarch3155
      @shadowmonarch3155 2 года назад

      it is used same as we use malloc and calloc in C...

  • @truptikurve3902
    @truptikurve3902 2 года назад

    Selenium ke bhi video dalo

  • @ashishlal7212
    @ashishlal7212 4 месяца назад

    #include
    #include
    int main() {
    queue q;
    q.push(6);
    q.push(7);
    }
    *yeh bhi show kerdete*

  • @jashanpreetkaur9855
    @jashanpreetkaur9855 2 года назад +1

    I just want to ask that , the circular queue priority queue and queue/stack implementation by linked list .are these concepts not important according to placement point of view because you haven't covered these concepts in your videos

  • @sayyadazeem6156
    @sayyadazeem6156 3 года назад +2

    suppose arr is full, now if we pop( ) one element the arr will remain full, we cannot again add element
    In pop( ) function, we need to swap every element to its preceding element.
    void dequeue()
    {
    if (empty() || front>rear)
    {
    cout

    • @sparshsingh1190
      @sparshsingh1190 2 года назад

      you see even if you that there is no meaning because that is one disadvantage of queue that is waste of memory which you are reffering to because we cannot add elements behind front pointer.

  • @koustavdey5574
    @koustavdey5574 2 года назад +1

    #include
    using namespace std;
    class que{
    int st,en,*a,n;
    public:
    que()
    {
    st=-1;
    en=-1;
    cout

  • @hustlewithVaibhav
    @hustlewithVaibhav 3 года назад

    Thank you

  • @mysticsnippets.
    @mysticsnippets. 2 года назад +1

    Please provide the source code as well at the end of these videos 🙏🏻

    • @YashSharma-dz7uu
      @YashSharma-dz7uu 2 года назад

      #include
      #include
      using namespace std;
      class queue{

      public:
      int* arr;
      int size;
      int front;
      int back;
      queue(int n){
      size=n;
      arr = new int[size];
      front=-1;
      back=-1;
      }
      void inqueue(int val){
      if( back==size-1){
      cout

  • @vishalgupta7522
    @vishalgupta7522 Месяц назад +1

    voice is not clear

  • @FahmidaAlamTasmim
    @FahmidaAlamTasmim 7 месяцев назад

    cracking sounds

  • @anaskaratela6851
    @anaskaratela6851 3 года назад +6

    Upload Tree and graph fast

  • @user-gc6nm2ng6d
    @user-gc6nm2ng6d 7 месяцев назад

    Apni kakhsa was their previous name

  • @sudipc9880
    @sudipc9880 3 года назад

    0:01 apna college

  • @sajjibhai4847
    @sajjibhai4847 2 года назад

    queue ky andar inqueue and dequeue use krty hain

    • @YashSharma-dz7uu
      @YashSharma-dz7uu 2 года назад

      bro we can use any name , here push mean inqueue and pop means dequeue

  • @ritikgoyal7682
    @ritikgoyal7682 3 года назад +1

    Why to initialise front with -1 ? Initialise it with 0 instead and it will be much easier to handle everywhere.

  • @utsavpathak2122
    @utsavpathak2122 2 года назад +1

    did anyone else notice she said apni kaksha rather than apna colg

    • @YashSharma-dz7uu
      @YashSharma-dz7uu 2 года назад

      are you watching this video for this purpose ??

  • @hritik_arora4176
    @hritik_arora4176 3 года назад +3

    🔥🔥on fireee

  • @iemmadhav
    @iemmadhav 3 года назад +1

    Bhot time se kuch upload nahi hua hai

  • @Dev-im4wv
    @Dev-im4wv 3 года назад

    Is anyone getting ambiguous problem when we are declaring the object of the class on the main function....how can I solve this :-/

    • @palashagrawal2343
      @palashagrawal2343 3 года назад

      u would be getting because of bits/c++ header file or queue header file

    • @palashagrawal2343
      @palashagrawal2343 3 года назад

      just remove those header files that error will be gone

    • @Dev-im4wv
      @Dev-im4wv 3 года назад

      @@palashagrawal2343 ok thnx bro.

    • @rxcreativity8441
      @rxcreativity8441 3 года назад

      @@palashagrawal2343 in program n is not declare in the scope

    • @rxcreativity8441
      @rxcreativity8441 3 года назад

      error....

  • @wasiqurrahman1072
    @wasiqurrahman1072 2 года назад

    Didi apne enqueue or dequeue ka use hi nhi kya?????

  • @factsWithfrenzy
    @factsWithfrenzy 3 года назад +2

    yeah NEHA aur RAHUL ko tum logoun nay acha pakra hai😂

  • @krishsingh6122
    @krishsingh6122 Год назад

    Anybody getting ambiguous error??

  • @agamsingh8664
    @agamsingh8664 3 года назад +1

    sir apni kaksha ko bhul gayo ho kya??

  • @swagatpritamsahoo5643
    @swagatpritamsahoo5643 Год назад +1

    Mic problem 🙂

  • @patrickbhardwaj007
    @patrickbhardwaj007 3 года назад +1

    Please invest some money in buying a proper mic also. Audio quality is very low and distorted too.

  • @Sound_Scap01
    @Sound_Scap01 Год назад

    movie dakhyna ka leay phaly neha cheya

  • @amazonbestproducts8745
    @amazonbestproducts8745 3 года назад +1

    Bhaiya please upload maths and chemistry lectures

  • @devanshsomeshwar2176
    @devanshsomeshwar2176 3 года назад

    kaksha ?

  • @hetmoradiya4458
    @hetmoradiya4458 Год назад

    delete to baki hai mam