4.3 Queue Implementation using Linked List in C | Data Structure Tutorials

แชร์
ฝัง
  • เผยแพร่เมื่อ 5 ม.ค. 2025

ความคิดเห็น • 274

  • @PrinceKumar-ux3qm
    @PrinceKumar-ux3qm 5 ปีที่แล้ว +207

    The best thing is that you are making videos on algorithms and data structure, there are lots of channels in youtube they do teach programming languages but not data structure and algorithms.Thanks a lot mam🙏🙏🙏

    • @vishnunolimits
      @vishnunolimits 2 ปีที่แล้ว

      Q1qq

    • @riyajaiswal2137
      @riyajaiswal2137 2 ปีที่แล้ว +1

      I tried this code but its not working ...for linked list and array as well

    • @AnkitSingh-go6qq
      @AnkitSingh-go6qq 2 ปีที่แล้ว

      @@riyajaiswal2137 yes i also check code is not working if we deque element many times

    • @VivekRaj-eb6mk
      @VivekRaj-eb6mk 2 ปีที่แล้ว +2

      @@riyajaiswal2137 that's not code, that the algorithm .

    • @urstrulymadhu6390
      @urstrulymadhu6390 ปีที่แล้ว +1

      At struct datatype after} semicolon is required

  • @suvrajitdatta
    @suvrajitdatta 5 ปีที่แล้ว +65

    Ma'am never stop making videos....teacher like u are needed are needed more and more in our society....ur explanations are supurb

  • @ForgotToExist
    @ForgotToExist 5 ปีที่แล้ว +48

    waking up at 5 am every day. and seeing your face has now become a habit. thank you so much for such lovely explanations and clearing my concept. mam please make two videos on 1. Reverse a circular doubly linked list & 2. Implementation of circular queue using linked list. Thank you mam you are amazing

  • @mabenyjohnson6908
    @mabenyjohnson6908 4 ปีที่แล้ว +16

    Your teaching makes it interesting to listen to you until the end... Because of the clarity and consistency of how you lay out your ideas.

  • @otetumooluwaseun3948
    @otetumooluwaseun3948 7 หลายเดือนก่อน +2

    Thank you very much Jenny. You saved me during my C days and now still saving me learning C#.
    I see double beauties watching your videos.

  • @karthikc8992
    @karthikc8992 5 ปีที่แล้ว +11

    jayanthi ma'am , u r simply superb...
    keep helping us
    best channel for learning DS

  • @asmakhan541
    @asmakhan541 4 ปีที่แล้ว +31

    Mam ur lectures is awesome. To the point,No time wastage!😘😘😘😘😘

  • @NishantSingh-cs2dl
    @NishantSingh-cs2dl 3 ปีที่แล้ว +2

    mam your way of teaching and the things you taught us I is beyond this comment section ......... You are such a great teacher and I have been in love with you and with your teaching........

  • @yaduvanshisuhani
    @yaduvanshisuhani 23 วันที่ผ่านมา

    dil se thanku mam ....apne sare topics bohot ache se padhaye hai ek ek chiz samaj agyi hai mere.....

  • @softmedun6794
    @softmedun6794 ปีที่แล้ว +1

    Wow amazing lecture
    Sabse acche meri pyari ma'am
    On of the best TH-cam channel ❤

  • @sbharathi3394
    @sbharathi3394 3 วันที่ผ่านมา

    After watching this many videos I'm able to write code without watching the pseudocode of yours...thank you!

  • @vaibhavshukla6911
    @vaibhavshukla6911 10 หลายเดือนก่อน +2

    Thank you jenny ma'am for this amazing lecture.

  • @veereshnaik683
    @veereshnaik683 5 ปีที่แล้ว +14

    best youtube tutor mam its uniques and direct point tq :)

  • @shivanshpathak9291
    @shivanshpathak9291 2 ปีที่แล้ว +4

    1M .....Let's Go....Congo Ma'am, you deserve much more !!!!

  • @aalexa5504
    @aalexa5504 3 ปีที่แล้ว +3

    Video not only is good but also teacher which teach,she is very amazing

  • @rashidulislamrasel207
    @rashidulislamrasel207 3 ปีที่แล้ว +2

    Incridible class madam.I have been starting to learn data structure So I was searching good teacher.finally i have gotten your class.I have also subscribed your chanel.Love From Bangladesh.

  • @adarshjadhav8877
    @adarshjadhav8877 4 ปีที่แล้ว +26

    Pyaar ho Jaye ga mam, aise padhayenge toh...❤️❤️
    .
    .
    .
    .
    .
    .
    .
    .
    DS se

  • @PankajPandeyfacts7931
    @PankajPandeyfacts7931 ปีที่แล้ว +2

    I struggles a.lot on this topic
    But I am clear right now
    Thank u mam from the bottom of my heart

  • @maniabedii2574
    @maniabedii2574 หลายเดือนก่อน

    Best video i have seen on DS ever, ty very much

  • @KarthikMakineedi
    @KarthikMakineedi ปีที่แล้ว

    Mam I am improving my basic knowledge on coding I have so many of doubts on coding but your teaching coding is assume I am easier to learn thank you mam😊

  • @cs4u579
    @cs4u579 4 ปีที่แล้ว +3

    I used to smoke weeds but at last when you said "bye,bye take care"
    I quit it,and made my 10 friends too.
    But joke safat it would be a more interactive if you have coded the logic live on IDE ,at last to the point , straight and simple explanation won my heart ♥️♥️

  • @padalabalaji5432
    @padalabalaji5432 ปีที่แล้ว +1

    mam thanks a lot for teaching in such a simple way that can be understood by a new person to coding like me👏👏

  • @cherukurisagarteja151
    @cherukurisagarteja151 3 ปีที่แล้ว +1

    You are the most beautiful lecturer in this century

  • @keya.bitspilani5429
    @keya.bitspilani5429 3 ปีที่แล้ว +14

    How the hell had I not watched such good lectures on data structures..amazing explaination ma'am 😊😊

  • @LEETanjubagri
    @LEETanjubagri 3 ปีที่แล้ว +1

    very nice explanation mam and at last your smile is speechless.......... this motivates me to see the next lecture of u without tiredness.
    thank u for giving us your precious time.

  • @shehaniperera8801
    @shehaniperera8801 4 ปีที่แล้ว +2

    Great explanation ma'am.. Thanks to this video now I can do my home works peaceful...❤❤❤

  • @rupinpatel9064
    @rupinpatel9064 4 ปีที่แล้ว +3

    best lectures ever on Data structures and algorithms

  • @saiakshagn3553
    @saiakshagn3553 2 ปีที่แล้ว +1

    Thank you so much maam.Your way of Teaching is so good that even a dull student can understand easily.Our Generation is so lucky, because We have you.

  • @princeverma-or7nc
    @princeverma-or7nc 4 ปีที่แล้ว +1

    Great mind with great beauty ✨✨✨✨
    Thanks you mam ❤

  • @mostafayounes9490
    @mostafayounes9490 ปีที่แล้ว

    Best Instructor Ever💯

  • @ravibisht2904
    @ravibisht2904 4 ปีที่แล้ว

    Mam apko dekh kr apne app hi padne mai man lag jata hai.. Nice explanation

  • @vaibhavgupta777
    @vaibhavgupta777 หลายเดือนก่อน +1

    Thank You Mam So So Much🙏🙏🙏🙏

  • @ripalnakiya
    @ripalnakiya 3 ปีที่แล้ว +1

    Best teacher on YT

  • @darpananand9848
    @darpananand9848 3 ปีที่แล้ว +3

    Ma'am we can also check the condition for 1 element in Dequeue Function i.e
    if there is only 1 element in the Queue , and we want to delete it , then the code would be
    void dequeue()
    {
    struct node*temp=front;
    if(front==0 && rear==0)
    {
    printf("UnderFlow Condition
    ");
    }
    else if(front==rear)
    {
    printf("The element which is deleted is %d
    ",front->data);
    front=rear=0;
    free(temp);
    }
    else
    {
    printf("The element which is deleted is %d
    ",front->data);
    front=front->next;
    free(temp);
    }
    }
    BTW Thank you so much Ma'am for this Amazing Content ❤❤

    • @justcurious1940
      @justcurious1940 11 หลายเดือนก่อน

      No need if we don't use the rear in the past functions I think .

  • @Shivaniverma24317
    @Shivaniverma24317 ปีที่แล้ว

    Ma'am apko jitna thank you bolo utna Kam h 😊❤ but thank you so much ma'am 💝💯 you are the best ❤🎉

  • @sushmanthavala7813
    @sushmanthavala7813 2 ปีที่แล้ว +1

    One of the best teacher in the online platform we are very lucky to have a great teacher like you TQ mam

  • @priyakaushik635
    @priyakaushik635 4 ปีที่แล้ว +2

    Thankyou❤❤your lectures are really good

  • @vakhariyajay2224
    @vakhariyajay2224 2 ปีที่แล้ว +1

    Thank you very much. You are a genius. 👍👍🔝🔝👌👌🙏🙏

  • @BhanuprakshSasapu
    @BhanuprakshSasapu 5 หลายเดือนก่อน +1

    Mam becuz of you I got the confidence to write the exam

  • @mohdehtesham8357
    @mohdehtesham8357 ปีที่แล้ว +2

    Just one note while running the code as is, the front and rear are globally initialized as NULL, so the functions dequeue(), display() and Peek() will always hit on the first condition. So, there is a need to either initialise the front and rear as local and pass those as arguments to the given functions or update the global pointers to the recent values as a whole.

  • @agyatkarmil
    @agyatkarmil หลายเดือนก่อน +1

    grateful for this 🙏 🙏

  • @surbhimishra2015
    @surbhimishra2015 3 ปีที่แล้ว +1

    Ma'm you are awesome I have learned many topics from your lectures. During this online classes .Online classes are of no use .Thank you ma'am for this Amazing lectures🙏

  • @AjeetKumar-mo6xt
    @AjeetKumar-mo6xt 3 ปีที่แล้ว

    i can trust all your videos because your accuracy is around 100 percent

    • @riyajaiswal2137
      @riyajaiswal2137 2 ปีที่แล้ว

      I tried this code but its not working...linked list and array as well for queue ...both arent working.

  • @sivasubramani612
    @sivasubramani612 4 ปีที่แล้ว +10

    @Jenny, I think at 2:50 sec, we can't consider front at the right end and rear at the left end since this is a singly linked list and after deque (which will take O(n)) we can't change the rear pointer to point the previous node. What do you think? If its right. please give a like so that it will be on top and will help others.

  • @vaishnavijasutkar8480
    @vaishnavijasutkar8480 4 ปีที่แล้ว +1

    Your teaching is best. Mam plz make videos of c programming also.

  • @maherinamdar2373
    @maherinamdar2373 5 หลายเดือนก่อน

    Excellent teaching ma'am👌❤

  • @akasharyan6233
    @akasharyan6233 2 ปีที่แล้ว

    Ma'am you should come to my clg coz no facaulty is like you
    And no 1 teach like as you teach🤗

  • @babon_zia
    @babon_zia 9 หลายเดือนก่อน

    Thanks for letting me understand the queue concisely.

  • @Mmkarts_i
    @Mmkarts_i ปีที่แล้ว

    Thank god we had an online like u mam, even ur lectures in online did it but not upto the point 😂

  • @baraamayasa5190
    @baraamayasa5190 ปีที่แล้ว +2

    thanks for your great explanations the data structure more fun and a lot easier with your lessons
    in this code there is a little problem when the front and rear pointers referring to same node because front pointer will be null otherwise rear pointer will lost the node but in that situation must refer to null so we need to add that statement to the code.
    #include
    #include
    struct node{
    int data;
    struct node* next;
    };
    struct node* front=0;
    struct node* rear=0;
    void enqueue(int data){
    struct node* newNode=(struct node*)malloc(sizeof(struct node));
    newNode->data=data;
    newNode->next=0;
    if(front==0&&rear==0){
    front=rear=newNode;
    }
    else{
    rear->next=newNode;
    rear=newNode;
    }
    }
    void dequeue(){
    struct node* temp=front;
    if(front==0&&rear==0){ //&&rear==0
    printf("empty queue
    ");
    }
    else if(front==rear){
    //peek();
    front=rear=0;
    free(temp);
    }
    else{
    //peek();
    front=front->next;
    free(temp);
    }
    }
    void display(){
    struct node* temp=front;
    if(front==0&&rear==0){
    printf("empty queue
    ");
    }
    else{
    while(temp!=0){
    printf("%d\t",temp->data);
    temp=temp->next;
    }
    printf("
    ");
    }
    }
    void peek(){
    if(front==0&&rear==0){
    printf("empty queue
    ");
    }
    else
    printf("front data: %d
    ",front->data);
    }
    int main()
    {
    dequeue();
    enqueue(5);
    enqueue(0);
    peek();
    enqueue(-3);
    display();
    dequeue();
    dequeue();
    dequeue();
    dequeue();
    enqueue(11);
    peek();
    display();
    return 0;
    }

  • @3ngdzgu
    @3ngdzgu 4 ปีที่แล้ว

    Thank you so much mam ur vedios are quit easy to understand the concepts of data structures....thank you lotzzz😊😊

  • @ghumoindia8828
    @ghumoindia8828 3 ปีที่แล้ว

    to be honest I was distracted while going through the topic, its due to the beauty you hold mam.

  • @sharath5796
    @sharath5796 3 ปีที่แล้ว +8

    note : while dequeue op, first we have to make temp->nxt as null and then free temp

    • @justcurious1940
      @justcurious1940 11 หลายเดือนก่อน

      Do we make a memory address NULL before or after we free it ?

  • @Shubhampatil-du8ys
    @Shubhampatil-du8ys 5 ปีที่แล้ว +3

    Awesome explanation maam, this video help me a lot

  • @researchayan4518
    @researchayan4518 4 ปีที่แล้ว +1

    You have a MALAYALI English accent...good lecture.

  • @bekind136
    @bekind136 ปีที่แล้ว

    mam thankyou so much literally so made data structures easy peasy

  • @barathkumarg3461
    @barathkumarg3461 3 ปีที่แล้ว +1

    Thankyou for the wonderful explanation mam your lectures very helpful in this lockdown situation

  • @maishamolepo2216
    @maishamolepo2216 4 ปีที่แล้ว +4

    Amazing content Jenny! Keep it up.

  • @fun.facts_videos
    @fun.facts_videos ปีที่แล้ว

    thanks to you for saving my much time! superb!

  • @satyamshukla3816
    @satyamshukla3816 4 ปีที่แล้ว

    god bless you mam.you are best teacher ever

  • @neerajanavya4178
    @neerajanavya4178 2 ปีที่แล้ว

    Thank for your explanation madam your teaching is very nice and clear madam

  • @truegrabbers
    @truegrabbers 4 ปีที่แล้ว

    Mind Blowing Explanation Maam thank you :))

  • @ritabritabasak5652
    @ritabritabasak5652 4 ปีที่แล้ว

    So so thanks Ma'am... 🌻🌻🌻♥️♥️

  • @lks5343
    @lks5343 5 ปีที่แล้ว +2

    Nice explanation mam , Thank you.

  • @bhojpuri-short34
    @bhojpuri-short34 5 ปีที่แล้ว +3

    Thank you so much ! nice explanations

  • @prashantverma9920
    @prashantverma9920 3 ปีที่แล้ว

    Crystal Clear.Thank You Very Much!!

  • @Crypto_UPDATE_2
    @Crypto_UPDATE_2 5 ปีที่แล้ว +2

    Great Explanation.......

  • @ashishgrover4506
    @ashishgrover4506 5 ปีที่แล้ว +1

    Thanks mam you make this topic very easy for me

  • @suhailaadeeb2780
    @suhailaadeeb2780 3 ปีที่แล้ว

    mam super.i can understand ths ds through ur words

  • @saikumartamminana3530
    @saikumartamminana3530 3 ปีที่แล้ว

    ur explaination is just awesome like you mam

  • @nitinkhilari1389
    @nitinkhilari1389 5 ปีที่แล้ว +1

    Excellent Teaching Ma'am

  • @thevindudilmith5343
    @thevindudilmith5343 ปีที่แล้ว

    Thank you so much 😊♥️♥️♥️

  • @thecloudterminal
    @thecloudterminal 2 ปีที่แล้ว

    Thank you for great explanation and putting so much effort mam 🙏

  • @unique_bhanu
    @unique_bhanu ปีที่แล้ว +1

    Thank you so much 🙏 madam

  • @coderssknowledge8342
    @coderssknowledge8342 5 ปีที่แล้ว +1

    awesome explanation mam,thanks....,plzz make videos on sorting of linklist.

  • @zenithacademy4588
    @zenithacademy4588 2 ปีที่แล้ว

    Very easily explained 👌

  • @HarithaSree14
    @HarithaSree14 4 ปีที่แล้ว

    Awesome mam....Helps a lot

  • @saritakumari-oh8fs
    @saritakumari-oh8fs 4 ปีที่แล้ว

    Absolutely genious mam

  • @ducatidiavel9639
    @ducatidiavel9639 4 ปีที่แล้ว +6

    Hello Ma'am, I have 2 questions,
    1) Given that the video is about a LL implementation of a linear Q, are there any rules that a circular linked list cannot be used, in place of a singly linked list with 2 pointers?
    2) And regarding your statement that a DLL using a head and tail pointer.. A DLL uses Nodes that only have a previous and next pointer right?

    • @ayaamverma6742
      @ayaamverma6742 2 ปีที่แล้ว

      1) A circular LL can be used here tho it will also contain the head and tail pointer like the singly LL used here; thus practically we will be using only the semi-circle of the CLL since our enqueuing and dequeuing are restricted between the head and tail pointer. Hence the last pointer of our CLL (from last node to first node) won't be of any use and simply be using memory space. Otherwise using a CLL is as good as singly LL.

  • @jithinmv6516
    @jithinmv6516 5 ปีที่แล้ว +13

    in dequeue you forgot to write the case for a single element, I mean front and rear points to same node, Which means only one element in queue, So we have to do (front=NULL and rear=NULL)

    • @karamsingh7785
      @karamsingh7785 5 ปีที่แล้ว +5

      That's exactly what i was going too comment

    • @arvsaurav
      @arvsaurav 4 ปีที่แล้ว +1

      I think there is one other way i.e., if we will use only front==0 instead of (front==0 and rear==0) at every place.

    • @qasimalikhan9692
      @qasimalikhan9692 3 ปีที่แล้ว +2

      else if(head==tail){
      std::cout

    • @ankitxalxotoo5580
      @ankitxalxotoo5580 3 ปีที่แล้ว

      @@qasimalikhan9692 thanks brother

  • @rahulsrivastava7017
    @rahulsrivastava7017 4 ปีที่แล้ว +3

    in dequeue(), there should also be a condition for when there is only 1 element in queue, that is,
    else if(front==rear)
    {
    Node *temp=new Node();
    temp=front;
    front=NULL;
    rear=NULL;
    free(temp);
    }

  • @gopavaramsaimadhuree520
    @gopavaramsaimadhuree520 4 ปีที่แล้ว

    Very clear ma'am
    Thank you ma'am ❤️🙏

  • @alokshukla1223
    @alokshukla1223 5 ปีที่แล้ว +5

    Thank you ma'am ! That was really very helpful.

  • @avirupbanerjee3253
    @avirupbanerjee3253 5 ปีที่แล้ว +4

    Mam why do we need to specify both front and rear while checking whether the list is empty or not. We can do it using rear only.

  • @StrollerEngineer
    @StrollerEngineer 5 ปีที่แล้ว +2

    Please upload all videos on data structures we support you

  • @PrabhatKumar-jl3se
    @PrabhatKumar-jl3se 5 ปีที่แล้ว +3

    thank you ma'am!!!!!

  • @rohitborra2507
    @rohitborra2507 4 ปีที่แล้ว

    beautiful and very clear

  • @VishalYadav-ss4qv
    @VishalYadav-ss4qv 4 ปีที่แล้ว

    Thanks ma'am 🙏🙏🙏❤️❤️

  • @sudharsands5773
    @sudharsands5773 3 ปีที่แล้ว +5

    Mam, you missed discussing a case in dequeue() i.e,, when front==rear.
    When front and rear is point same node

    • @justcurious1940
      @justcurious1940 11 หลายเดือนก่อน

      U will have to update the rear or the whole code will break;

  • @tit162-tiwarianurag2
    @tit162-tiwarianurag2 3 ปีที่แล้ว

    Great 🤓

  • @mirtanvirahmed3868
    @mirtanvirahmed3868 4 ปีที่แล้ว +2

    I have implemented the logic myself first and then watching the video 😁

  • @irfanbasha7445
    @irfanbasha7445 4 ปีที่แล้ว

    Thnk u...😍
    A beauty vth brain...❤️.
    Ur d first crush and probably may be d last Mam.🥰

  • @cristianandresvargasgonzal4510
    @cristianandresvargasgonzal4510 4 ปีที่แล้ว

    Very thanks is cool, this video.

  • @rohitadigam2466
    @rohitadigam2466 5 ปีที่แล้ว +1

    I love u mam ❤😘💞😍

  • @junaidrashid6147
    @junaidrashid6147 3 ปีที่แล้ว

    Mam God bless u

  • @akashprince_07
    @akashprince_07 3 หลายเดือนก่อน

    Where should I put void main function in program that should place in first or last ??

  • @Nag_12
    @Nag_12 ปีที่แล้ว

    Thank for you teaching mam any how I understand what u said

  • @RaviKumar-ts1kj
    @RaviKumar-ts1kj 4 ปีที่แล้ว

    Mam u r videos are very useful , tnq lot mam keep doing more videos have a nice day and may god bless u.

  • @nishanthulwan1478
    @nishanthulwan1478 4 ปีที่แล้ว +1

    Hello why are you assigning front and rear as 0 ? 0 can be a valid node instead of assigning it as 0 can we assign it as NULL? thanks.

  • @raghavjoshi9751
    @raghavjoshi9751 ปีที่แล้ว +4

    Mam in deletion condition their should be one more condition that is
    else if(front==rear)
    {
    printf("deleted element is %d
    ",temp->data);
    front =rear=NULL;
    }
    cause in last else condition (front= front->next) that make the front to point to the next undefined memory

    • @starkgamex4925
      @starkgamex4925 ปีที่แล้ว +1

      Yes, I also noticed...that's why finding in comments