Implementing all the Stack Operations using Linked List (With Code in C)

แชร์
ฝัง
  • เผยแพร่เมื่อ 27 ธ.ค. 2024

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

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

    Abhi bhi bahut logo ne playlist access kyu nahi kari hai DSA ki? - th-cam.com/play/PLu0W_9lII9ahIappRPN0MCAgtOu3lQjQi.html
    Instagram: instagram.com/codewithharry

    • @PramodKumar-nv5cg
      @PramodKumar-nv5cg 4 ปีที่แล้ว +2

      First

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

      @sanghamitra dass I also want that bcz I want to become a ethical hacker

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

      Thank you so much Harry Bhai... Please make a series on ANGULAR

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

      Java Course launch kro please

    • @VedPrakash-bw2dp
      @VedPrakash-bw2dp 4 ปีที่แล้ว +2

      @codewithharry Bhai 4:51 pr else block me n ko free krna hoga.

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

    Quality Ka naam hai Harry Bhai❤️🔥

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

    i m new your channel , and bs aate hi fan bn gya

  • @HiteshKumar-fu6qj
    @HiteshKumar-fu6qj 2 ปีที่แล้ว +2

    Me ye video esliye like kar rha hu kyuki aapne pura afford lga diya samjane me, Thank you Bhai❤❤

  • @Roshankumar-fz6xs
    @Roshankumar-fz6xs 2 ปีที่แล้ว +4

    Really you are a good teacher , i starrted the course just from the starting of the month of November and today I think that I am some suitable with the dsa problems and making others understand the concept of dsa topics, Thank you harry bhai, love you ...

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

    To anyone getting confused with pop function,
    we can do the whole stuff without making it complex,
    just write the simple pop function and update top in main function.
    CODE given below:
    struct node* pop(struct node* top)
    {
    if(isempty(top))
    {
    printf("Stack Underflow, Can't pop anthing out
    ");
    }
    else
    {
    struct node* helper = top;
    top = top->next;
    printf("Popped %d Successfully.
    ",helper->data);
    free(helper);
    return top;
    }
    }
    // in the main function to pop anything just update the top like below
    int main()
    {
    // Whatever prev code is written here
    // for popping an element just update top.
    top = pop(top);
    return 0;
    }

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

    this playlist is very helpful

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

      Java Course launch kre... Harry

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

      @@ViralXtreme one note notes where it is uploade anyone have idea regarding brother?

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

    Harry is one guy who only wants his viewers to learn without expecting anything in return. Unlike these other TH-camrs who teach half the thing and force us into buying their paid courses. I wouldn't hesitate to give something to Harry once I start earning. I love you Harry bhai❤️

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

    Harry Bhai me aapki python series sikh raha hu or apne mere bahut pqise bachaye hai.......thank you bhaiiiiii very much........

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

      Kitna sikha ?

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

      @@vikramjha7450 Bhai abhi mene 2nd exersice means faulty calculator tak sikha hai.......

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

      bhai kaisa hai python ka course? abhi tak toh job bhi mil gyi hogi na

    • @imMiraj26
      @imMiraj26 5 วันที่ผ่านมา

      @@bhaumik250 💀

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

    Best ds algo course ❤ one request plz continue this series and don't stop regular videos🙏🙏🙏

  • @RANDOM_TECH_SHORTS-mz4od
    @RANDOM_TECH_SHORTS-mz4od ปีที่แล้ว

    Harry Bhai Your The God For Coders🧑‍💻

  • @shubhansu-kr
    @shubhansu-kr 3 ปีที่แล้ว +43

    So we coded a linked list and called it a stack .

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

      Yeah bacislly😂😂

    • @md.adnanparwez215
      @md.adnanparwez215 7 หลายเดือนก่อน +8

      We alse made an array named it stack🙂

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

      Hence,Stack is an ADT

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

    2 years old course but this is the best explanation present anywhere else on yt

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

    I was zero when I started watching c language in april 2023. Today, I feel confident in using c,c++ and data strucrures.Thanks harry bhai. Today is 26 June 2023.

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

    int peek(stack* s,int idx){
    Node* p = s->top;
    int len =1;
    while(p->next){
    p = p->next;
    len++;
    }
    p = s->top;
    int i=1;
    while(inext;
    i++;
    }
    cout

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

    24:00, pop() can be implemented in the following way too.
    struct Node* pop(struct Node *top)
    {
    if (!isEmpty(top))
    {
    struct Node *ptr = top;
    top = top->next;
    int val = ptr->data;
    printf("Popped element is %d
    ", val);
    free(ptr);
    }
    else
    printf("Stack Underflow
    ");
    return top;
    }

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

      Absolutely, ptr ko free krlo bs

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

      @@avinashdharme2234 haan ptr ko free Krna tha.

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

      @@rickk3300 yes

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

      Bro I think return top will be written in if part not in else part, please kindly check

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

      @@Freshtech4428 return top is neither in the if part nor in the else part. If Stack Overflow happens, top will just get returned without any changes.

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

    struct node * pop (struct node * top){
    struct node *n = top ;
    top = top->nextpointer;
    int data_of_popped = n->data;
    free(n);
    printf(" the data popped out : %d
    ", data_of_popped);
    return top;
    };
    use this for pop . bhaiya kyu top ko global variable banana hai top ko change krke app return bhi kr skte ho

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

      @Relaxing hours bro.. in my computer, it is working perfectly. This code fragment is the perfect alternative to Harry bhai's code.

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

      @Mayank :)
      Use this in main function
      int main()
      {
      top=push(top);
      LinkedlistTraversal(top);
      }

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

      @Mayank :) Bro, use the above function as it is and,
      In main(), write this:
      top = pop(top);
      printf("Updated stack is: ");
      linkedListTraversal(top);

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

      perfect alternative of using ampersnet and "*" everywhere

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

      I did same

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

    Waoh Harry bhai !! 1000 videos complete🔥🔥🔥

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

    Easily samajh me aa raha hai stack using linked list jaisa topic bhi.... Very helpful videos Sir 👍

  • @MantoManto-v2i
    @MantoManto-v2i ปีที่แล้ว +1

    Hats off ,your way of teaching is amazing ,and implementing it in code is a good way of understanding really appreciate your hard work

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

      isEmpty() aur isFull() method me return 1 kyu kiya hai??

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

    You did not teach any concept of global and local variable in 15 hr video but i got this concept from this video thnx for your support 🥰

    • @Ranjeetvishwakarma-72
      @Ranjeetvishwakarma-72 ปีที่แล้ว +1

      😄😄😁

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

      that was what i was wondering too coz i didnt remember that part being taught in the 15 hr lecture.

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

    pop function can also be implemented like this
    /*
    struct Node * pop(struct Node * top)
    {
    struct Node *ptr;
    if (is_empty(top) )
    {
    printf("stack underflow");
    }
    else
    {
    ptr = top;
    top = top->next;
    int x = ptr->data;
    printf("deleted/popped element is %d
    ", x);
    free(ptr);
    return top;
    }
    }
    */
    here the only diffference is data type of pop function that is [ struct Node * ] type
    almost similar like deletion of first node in linkedlist explained in video no. 18

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

      Thankyou so much buddy
      Great Help

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

      That is the same thing I Implemented in my code..Same pinch!!

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

    bhaiya aur jyaada jyaada videos daalo, bhot maza aa raha and cant wait to get into Compi coding

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

    your teaching style is very crystal clear

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

      muth pe le harry bhai ki sab kuchh aa jayega teko

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

      @@dhruvarora5755 psycho hai kya? Kya baat Kara rahai hai?

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

      apni ma se smajh le uske aata hoga
      usen bhi harry ka muth peeya tha@@biswajitadhikary_0807

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

    Bhai great teacher..maine aapki sabhi playlist lagbhag dekh li hai..bhut knowledge mila..thanku

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

    great help bro to clear all concept that how to implement

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

    hi harry sir mene apki python tutorial dekha and muje jod mili thank you sir

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

    please continue the course harry bhai . app advanced data structure per bhi vedios laiye . or graph per bhi and i must say the video is awesome

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

    25:00 jinko problem ho rahi hai isme. Ye sab complicated way use karne ko zaroorat nahi hai. Bass pop function me print karwado ki tumne ye value popped ki hai by using x.
    Aur int main me bass top = pop(top);
    Karo and pop function lo struct Node * type ka banao
    And return me top kardo pop function me
    Sab easy and simple ho jayega no tention 💯

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

    28:29 koi doubt ni hai global and local variable mai apne c ke playlist mai bahut acche se samjha ya tha

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

    In isFull() function, we need to free(p) when we are returning 0. Otherwise we will get an error when we do not have enough memory because we have already used that to assign p inside isFull() function.

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

      Yeah or else we can make isFull() to return struct Node pointer ,and check in push if(isFull()==null ) then stack overflow Or else use that allocated memory as n in push, Right? This way memory will not be wasted

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

      @@Im_RajSingh Yes

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

      thanks . Learnt something new

    • @MainakBhowmick-vw3sh
      @MainakBhowmick-vw3sh ปีที่แล้ว

      me to bol raha hoon isFull and isEmpty function alag se banake ka hi jarurat nehi h.... tum push and pop function k under hi wo sab cheez kar sakte ho bina koi function ko call kare

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

      Thanks I was thinking same

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

    Thank you harry bhai for such awesome course 🙏🙏🙏

  • @21AniketThakre
    @21AniketThakre 3 ปีที่แล้ว

    These playlist is best ❤️🤗.
    My online classes are worst.

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

    25:20 you can just simply change your function header to => int pop(Node* &top)
    This works for C++. Not sure about C.

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

      Bhai is video me harry ne jo isFull() function likha hai. samajh nai aya.
      can you explain me what's he doing?
      he is just creating a node using dynamic memory allocation and just checking if it's null or not.
      is this like indefinite stack which keeps on getting values till it runs out of memory?

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

      @@uraniumgaming123 he wants his stack to grow on till he has memory in his stack(kinda inifinite - but has some max definite memory in pc)...so he implements a struct node pointer and allocated its memory and if the total space is filled , then he says stack overflow.....this is what i think

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

      @@Pranauv i understood it after giving it some time.
      still..
      Thanks a lot for Taking time and explaining me this.
      🙂

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

      It can be done only in C++

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

    Thank You Sir ! Your Efforts Are Really Appreciated !!

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

    harry bhai your tutorial is best.

  • @PrashantSingh-qr3vn
    @PrashantSingh-qr3vn ปีที่แล้ว

    Sir you are just GOAT

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

    thanks Harry
    happy Guru pournima

  • @Mustafa-ji3cp
    @Mustafa-ji3cp 4 ปีที่แล้ว +1

    Thanku so sir ❤ God bless you

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

    another implementation of pop:-
    struct node* pop(struct node *top){
    struct node *n=top;
    top=top->next;
    free(n);
    return top;
    }
    int main(){
    top=pop(top);
    }

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

      The code you wrote I also applied it in the program, but the issue with it is that it just returns you the value of the top for the first time, but doesn't update the top variable in the main function. Since, it doesn't traverse the data after that.

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

      That is we need to make it global variable any way to update the top for the whole.

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

      @@knowtechwithaman7254 no, it updates the top pointer in the main(), I have tried this code with multiple variations, and it works perfectly in each and every case

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

      i did same and works

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

    Thank you Sir 😊

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

    int pop(struct node * top){
    if (isEmpty(top))
    {
    printf("Stack underflow");
    }
    else
    {
    struct node * n =top;
    top=top->next;
    int result=n->data;
    free(n);
    return result;

    }
    }

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

    Thanku sir ..bhaut acche se aaya smjh....Thanks alot sir

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

    I learnt soo much from you I subscriped from 3 different accounts

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

    20:10
    isFull( ) me argument "top" pass kyu kar rhe h ??
    jabki wo function "top" ka use bhi nhi kar rha 🤔🤔

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

      Agar Full() me top pass nhi bhi kiya to bhi koi problem nhi ayegi...

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

      waise bhi isFull() negligible he smjho, kyuki linked list mai itna size matter nahi karta whereas in array pe karta hai.

  • @KeshavPal-i4s
    @KeshavPal-i4s หลายเดือนก่อน

    Thanks brother for this quality contant

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

    BHAI TUSSI GREAT HO........

  • @k.mohanrao2568
    @k.mohanrao2568 3 ปีที่แล้ว

    Good video......bas last last me thoda confuse kar diya,😅😅👍

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

    JIO RE BHAUBALLI.....OP RE HARRY BALLI😁😁

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

    Maza aagaya Harry Bhai💖💖💖💖

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

    ❤ Thank you
    Harry Bhai ❤❤❤

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

    Really you are great I. I. Tian kharagpur.

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

    at 25 minutes video;
    while in pop function u can return top instead of element so we dont have to send address of top in the function and poped element can pe printed inside pop function only before element is poped;
    struct node* pop(struct node* top)
    {
    if(isempty(top))
    {
    printf("stack underflow");

    }
    else
    {
    struct node* n=top;
    printf("the popped elemnt %d ",n->data);
    top=top->next;
    free(n);
    return top;
    }
    }

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

    Loved this playlist 💘

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

    thank you soooo much for your amazing content. Please keep this up.

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

    to all those who r using next variable ig do not understand the concept of stack .....that's becoz it should be "prev" acc to ur concept sir

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

    Harry bhaiya done with this thank you

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

    11:05 what is need to make n ? Kya sidha top=top->next sidha nahi kar sakte?

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

    Very nice explanation sir

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

    You are osome teacher harry

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

    Hello, Harry bhaiya first of all thanks a lot for doing this much that too free of cost.Hope you doing well.I have a doubt here can you please sort it out------ What's the need of creating of is full() bcoz we are already checking it in our push function whether our stack is full or not.

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

    We can also implement pop() like this:
    struct Node *pop(struct Node *top){
    if (isEmpty(top))
    {
    printf("Stack Underflow!! Can't pop
    ");
    }
    else
    {
    struct Node *p = top;
    int x = top->data;
    top = top->next;
    free(p);
    return top;
    }
    }
    In int main():
    top = pop(top);
    traversal(top);

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

      I appreciate you bro... But the goal is to return the popped element .

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

      After, free(p);
      printf("Poped element is %d
      ", x);

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

      But you can't use the popped element 😅

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

      then, we can do like this :
      int pop(struct Node **top){
      if (isEmpty(*top))
      {
      printf("Stack Underflow!! Can't pop
      ");
      }
      else
      {
      struct Node *p = *top;
      int x = (*top)->data;
      *top = (*top)->next;
      free(p);
      return x;
      }
      }
      In int main():
      printf("The poped element is %d
      ", pop(&top));
      traversal(top);

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

      @@dollcyjain2452 OR create int x as global varible.

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

    Amazing Harry bhai

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

    Mine was 1000th like 👍 ❤️

  • @Cc-qy1xx
    @Cc-qy1xx 2 ปีที่แล้ว +1

    great course

  • @7.waseem
    @7.waseem 2 ปีที่แล้ว +1

    I bought GFG paid course for DSA and compared with this one, I found Harry Bhai rocks.......I regret y I wasted mh fathers money on that course🙂

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

      which is GFG?

    • @7.waseem
      @7.waseem 2 ปีที่แล้ว

      @@soumi6720 geeks4geeks

  • @HimanshuGupta-bc9ox
    @HimanshuGupta-bc9ox 4 ปีที่แล้ว +1

    Thanks for the vedio and please make a video on carrer options like gate , other. thanks

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

    quality content ekdum

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

    I'm First This Time
    BTW Harry Bhai Java Pe Full Playlist Banaona Plzz

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

    Thankyou so much 🙏

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

    good one, done on 15th may 2021

  • @SN-edits4u
    @SN-edits4u ปีที่แล้ว +1

    Why in pop function, we didn't dynamically allocated memory for n? Like
    struct Node* n= (struct Node *)malloc (sizeof(struct Node))

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

      because memory allocated tab karte hai jab hume node create karna hota hai.....
      struct node *n (yaha n ek normal variable hai).
      struct node *n =(struct node*)malloc(sizeof(struct node*)-----(yaha n ek node bann gya hai....ab "n" ke two components hoge n->data OR n->next.

    • @nt-ss1jq
      @nt-ss1jq 7 หลายเดือนก่อน

      Bro waha ham usko as pointer use kar rahe hai but in push function ham ek node create kar rahe hote hai iss liye.

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

    Fantastic Explanation Harry Bhaiya!!!!

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

    simple use use & after * in parameter ====> int pop(nstack *&top)

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

    wow sir you are great

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

    Harry bhai awesome

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

    Sir polynomial addition and multiplication wala program bhi bataiye

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

    Perfect explanation 👍🏻

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

    ❣❣thankyou so much

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

    Harry Bhai wbsite pe notes available nahi hai stack implementation se

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

    Thanks Harry Bhaiya

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

    Harry bhai Hashing pe video banao na please linear probing, quadratic probing and chaining.

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

    harry paaji tussi great ho..........

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

    Harry Bhai please make video on Java of 15 to 20 hours just like C language video of 15 hours with projects and notes

  • @Anuj-sr7li
    @Anuj-sr7li 3 หลายเดือนก่อน +1

    Why you passing top in isFull Function Because no any use of top in isFull 20:09

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

    I think this method is more easy and efficient...You dont have to return each node's address after pushing data
    ..................
    #include
    #include
    #include
    using namespace std;
    struct node
    {
    int data;
    node * ptr;
    };
    bool isFull(){
    node * s = new node;
    if (s == nullptr)
    {
    return true;
    }
    delete(s);
    return false;
    }
    bool isEmpty(node * top){
    if (top == nullptr)
    {
    return true;
    }
    else{
    return false;
    }
    }
    void push(node ** top , int data){
    if (isFull())
    {
    cout

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

      Thank you bro for sharing........I am also doing code in c++....

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

    Thank you Harry Bhai...

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

    *Kisko kisko JAVA full course chahiye...*
    👇
    👇 We want JAVA
    👇

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

    passing top in the push ...and saying top = n ; then why we need to return top for updating . why it is not getting updated by top = n in push function although we are using the call by reference .

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

    sir last me apne bola local variable top or global variable top aps me coincide kr rheh . to vo sirf pop wale function me hi use hoga ki push wale me bhi ho skta h .

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

      better alternative is to return the updated head of type struct node*. Without using global variable.

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

    GREAT JOB

  • @HARSHYADAV-ss6zq
    @HARSHYADAV-ss6zq 4 ปีที่แล้ว +1

    Harry bhai m tkinter me button pe command me ek function de rha hu file ko write krane ke liye ye example aapne bhi diya tha par aapke program me side by side file write ho rhi thi par mere me m jab GUI window band kr deta hu uske baad file banti h aur write hoti h

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

    bro stack using linked list mein address of pointer paas krne ki zarurat q pad rhi hai array implementation mein to direct pointer pass ho jaata tha output bhi correct aata tha.

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

    i got the pointer harry bhi😅😅

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

    23:10 double pointers will be required imo.
    int Pop(struct Node **top){
    struct Node* temp;
    temp = *top;
    *top = temp->next;
    int val = temp->data;
    free(temp);
    return val;
    }

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

      Yea, can you please explain why we need to do so coz I can't really understand it. Thanks in advance:)

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

      zyada tez ho rha hai bete

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

    Thank you bhai!

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

    Bhaiya I think, the image of the stack which u draw on the right top corner is incorrect, means 7 should be written at last of the stack

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

    void Push(struct Stack *head, int value)
    {
    if (isFull(head))
    {
    printf("Stack overflow");
    }
    else
    {
    struct Stack *ptr = (struct Stack *)malloc(sizeof(struct Stack));
    ptr->next = head;
    head = ptr;
    }
    }
    why this not working?is that so i have return type void?but since i am changing head to ptr at last which should retain its change even after scope is destroyed as it is pointer ,so it should be fine if i don't return head?

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

    nice bro u explained well

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

    Did not get why we are getting in error as when I am trying to print it is giving segmentation error.