peek(), stackTop() and Other Operations on Stack Using Linked List (with C Code)

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

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

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

    8:50
    stackBottom Function::
    int stackBottom (struct Node*top) {
    struct Node*ptr=top;
    while (ptr->next!=NULL) {
    ptr=ptr->next;
    }
    return ptr->data;
    }

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

    I left my NPTEL DSA course as I like your way of teaching... more than anyone else. Hats off.. Harry Bhai

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

    Really you are one of the greatest teacher I met in my life.

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

      When did you met him😒😒...huh...when...you saw him only

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

      Same
      ❤️

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

    JAVA playlist laane ke liye thank u harry bhai😍💞

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

      Java is huge.. but awasome.. learn java MVC like Spring, Hibernate ...

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

      Everyone should learn python

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

      @@ravikanttiwari6623 aati hai python 😇

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

    Ek hi din me different languages k video.i. e., C, java, data structures..
    Maan gae sir ji apke hrdwrk ko.👍👍

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

    31 videos done.....61 left...learning... Enjoying... Thank you Harry.

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

    Pata nahi log ise kyu nahi dekh rahe maine ye start ki h to 1 week bhi nahi hua h and 30 videos complete kar li hai with practice. Sir aapse hi seekh rahe hai varna baki teachers to only theory hi batate hai , theory + with practice jyada Better hai thanks sir ise banane ke liye. Aapko pata hai hame kaha problem ho sakti hai .

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

    8:38
    int stackBottom(struct Node *top){
    struct Node *ptr = top;
    while(ptr->next != NULL){
    ptr = ptr->next;
    }
    return ptr->data;
    }

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

    Function to print the bottom-most element in the stack
    Code:
    void stackBottom(){
    if(isEmpty(top)){
    printf("Stack Underflow!
    ");
    }
    else{
    node* ptr = top;
    while(ptr->next != NULL){
    ptr = ptr->next;
    }
    printf("Bottom-most element in the stack is %d
    ",ptr->data);
    }
    }

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

    your videos are so better than many online courses. :) Thank you for uploading them.Its a great cause.

  • @HEMANTPORWAL-t7d
    @HEMANTPORWAL-t7d ปีที่แล้ว +4

    in (stackbottom)function we will run a while loop till (ptr->next!=NULL) and when we came out of the loop it will point to the last node and value at that node will give us the desired bottom value of the stack

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

    8:59-int stack bottom(struct Node *top)
    {
    struct Node *ptr=top;
    while(ptr->next!=Null)
    {
    ptr=ptr->next;
    }
    return ptr->data;
    }

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

    You are best programmer in you tube.

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

    Awesome lectures learning a lot

  • @ShubhamKumar-em1kg
    @ShubhamKumar-em1kg 4 ปีที่แล้ว +2

    Stack bottom:
    Int stackBottom(struct node*ptr)
    { If(isEmpty(top))
    { Printf("stack is empty");
    Return -1;
    }
    Else
    {
    While (top->next!=NULL)
    { top=top->next;
    }
    Return top->data;
    }

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

    8:55
    int stackBtm(struct node* top){
    struct node* p = top;
    while (p->next!=NULL)
    {
    p=p->next;
    }
    return p->data;

    }

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

    StackBottom (struct Node*top)
    { Struct Node* p=top;
    While (p->next != NULL)
    {
    P=P->next;
    } Return p->data;

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

    Your dedication inspires me a lot...Thank you for the beautiful content

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

    stackBottom done sir. Here 'top' is global variable
    int stackBottom(void)
    {
    struct Node *ptr = top;
    while (ptr->next != NULL)
    {
    ptr = ptr->next;
    }
    return ptr->data;
    }

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

    Harry vaii you are my superhero ❤️

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

    Thank you Sir for these free content ❣️👍🏻

  • @KRIXIVMOHAN-fc3dm
    @KRIXIVMOHAN-fc3dm 8 หลายเดือนก่อน

    all clear Sir!

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

    Function for Stack Bottom ----->
    int stack_bottom(struct Node * t){
    while(t->next != NULL){
    t = t->next;
    }
    if(t->next == NULL){
    return t->data;
    }
    return -1;
    }

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

    Thank you so much Harry Bhai subkuch free sikha denge ap. Excellent coder in the world.

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

    You are great sir, i appreciate your effort , thank you very much 😊😊

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

    8:47 - stackBottom() implementation
    int stackBottom(Node *top){
    Node *ptr = top;
    while(ptr->next!=NULL){
    ptr = ptr->next;
    }
    return ptr->data;
    }

  • @lil.hercules
    @lil.hercules 3 ปีที่แล้ว

    @8:50
    int stackBottom(struct node *ptr)
    {
    struct node *p;
    p = ptr;
    while (p->next != NULL)
    {
    p = p->next;
    }
    return p->data;
    }

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

    int stackbottom(struct Node *sb){
    while(sb->next != NULL){
    sb=sb->next;
    }
    return sb->data;
    }
    printf("bottom element is :- %d
    ",stackbottom(top));
    Edited :- make sure your "top" is struct variable and it is set null

  • @RohitKumar-dy2gc
    @RohitKumar-dy2gc 3 ปีที่แล้ว

    8:35 int StackBottom(struct Node*top){
    struct Node*p=top;
    while(p->next!=NULL){
    p=p->next;
    }
    return p->data;
    }

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

    Stack bottom:
    8:48
    int StackBottom(node* top){
    node *ptr = top;
    while(ptr != NULL){
    ptr = ptr->next;
    }
    if(ptr != NULL){
    return ptr->data;
    }
    else{
    return -1;
    }
    }

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

    8:50
    struct node *ptr = top;
    while((*ptr).next)
    ptr = (*ptr).next;
    return (ptr->data); // --> Bottom most element

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

    Harry bhai the *best*

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

    Sir thanks for the course 🙏🙏🙏

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

    Harry Bhai you already have 581K subscribers. We want a party when it get's to 600K.
    Don't forget the party!!

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

    *Gajab padhate ho !!!*
    int stackBottom(struct Node*top)
    {
    struct Node * p = top;
    while(p->next != NULL)
    {
    p =p ->next;
    }
    return p -> data;
    }

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

    10:18 #problem : - top is undefiend

  • @anju-s9f6w
    @anju-s9f6w ปีที่แล้ว

    8:50 challenge accepted
    int stackBottom(struct node *ptr){
    while(ptr->next!=NULL){
    ptr=ptr->next;
    }
    return ptr->data;
    }

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

    great sir .... you made my life easy

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

    Dont stop uploading data structure please 🥺🥺

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

    I have made a slight different peek function. it's for finding the position of a particular element in the linked list. Just the opposite of normal peek function. Here it is --
    int peek(struct node *pt, int x)
    {
    int i = 1;
    while(pt->data!=x)
    {
    pt = pt->next;
    i++;
    }
    printf("
    The value %d was found at index %d
    ",x, i);

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

      if you use 'int' (int peek(...)) then you have to return something.

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

      you should also include the case when that value is not equal to any data of linked list

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

      this one is not peek function
      - peek function takes an index and returns the value at index
      - your function takes an value and returns the index of that value

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

      It is not peek function Bruh!!! .Your Function is searching position of data so it is like binary search.

    • @Ayan-od8hk
      @Ayan-od8hk 2 ปีที่แล้ว

      @@manthangevariya1435 That is what he said bro....It is a slightly different peak function😶

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

    Your videos are awesome and I'm sharing your videz

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

    void stackbottom(struct node*top)
    {
    struct node*p=top;
    while (p->next!=NULL)
    {
    p=p->next;
    }
    printf("Bottom most element of the stack is %d
    ",p->data);
    }

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

    Stack bottom( ){
    Node *p = top;
    while(p->next!=NULL){
    p=p->next;
    }
    return p->data;
    }

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

      @Abdullah basically when you want to print the last element from the linked list we traversed till the last Node . Not the NuLL onces. Because as we know that stack bottom will be the first element in the stack as it follows LIFO so that's why. But when we have to print each and every Node then only we use p!=NULL as this will reach to end means fully end of the linked list. And P->next != Null means that the last value of that linked list.

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

      @Abdullah yup basically when p==NULL then it will come out the loop , but when p->next == NuLL means Null se phela wala.

  • @24_cse_shivammishra37
    @24_cse_shivammishra37 2 ปีที่แล้ว

    int stackBottom(node* top){
    node* ptr=top;
    while(ptr->next!=NULL){
    ptr=ptr->next;
    }
    if(ptr!=NULL){
    return ptr->data;
    }
    else{
    return -1;
    }
    }
    Homework completed sire 😊 😊

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

    Waiting for AWS full course in same energy :D And I wish you were my teacher in college.

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

    8:41
    Home-Work Hogaya bhaiya 😅😅
    int stackBottom(struct Node *top)
    {
    struct Node* ptr = top;
    while (ptr->next != NULL)
    {
    ptr = ptr->next;
    }
    return ptr->data;

    }

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

    Function that returns the bottom most element of stack
    int stackBottom(Node* top)
    {
    if(isEmpty(top))
    {
    coutnext!=NULL);
    return p->data;
    }
    }

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

    Thanks sir for datastructure series
    Program-stackbottom()
    Int stackbottom()
    {
    Struct Node *n=top;
    while(n!=NULL)
    {
    n=n->next;
    }
    return n->data;
    }

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

      Kya baat 😁

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

      This code is wrong bro, in while condition you need to type n->next != NULL .

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

      @@manishsemwal1777 yes, & argument pass nahi kiya

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

      @@manishsemwal1777 bro can you please tell me why this so

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

    8:42
    // Function to print the stack bottom
    void stack_bottom(struct node *t){
    struct node *ptr=top;
    while(ptr->next!=NULL){
    ptr=ptr->next;
    }
    printf("BOTTOM = %d
    ", ptr->data);
    }

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

    Function to print the bottom-most element in the stack
    Code:
    int stackBottom(){
    if(isEmpty(top)){
    printf("Stack Underflow!
    ");
    }
    else{
    node* ptr = top;
    while(ptr->next != NULL){
    ptr = ptr->next;
    }
    printf("Bottom-most element in the stack is %d
    ",ptr->data);
    }
    }

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

    8:46
    int stackBottom(struct Node *top)
    {
    struct Node *ptr = top;
    while(ptr->next!=NULL)
    ptr = ptr->next;
    return ptr->data;
    }

  • @ShaksD-vf3go
    @ShaksD-vf3go 5 หลายเดือนก่อน

    Goat= harry bhai❤❤

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

    //implementing stack bottom function
    void stackBottom(struct node* top){
    struct node* indexpointer;
    indexpointer=top;
    while(indexpointer->next!=NULL){
    indexpointer=indexpointer->next;
    }
    cout

  • @ManjotSingh-ov2jp
    @ManjotSingh-ov2jp 2 ปีที่แล้ว

    8:55 while ptr-> next!=NULL; ptr=ptr->next; exit loop print ptr->data;

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

    Stack Bottom:
    For implementation I had created a stack* so as to dynamically allocate stack hence using stack** for copy by reference
    void bottom(stack** p){
    if((*p)->top == NULL) return;
    node* t = (*p)->top;
    while(t->next != NULL){
    t = t->next;
    }
    printf("The Data first inserted was : %d
    ",t->data);
    }

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

    8:46
    int bottom(node* ptr) {
    while(ptr->next!=NULL){
    ptr= ptr->next;
    }
    return ptr->data;
    }

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

    8:51
    //Stack Bottom Implementation in C++
    Node *stackBottom(Node *top){
    Node *p = top;
    while(p->next!=NULL){
    p = p->next;
    }
    return p->data;
    }

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

    God bless you 😇❤you are blessing for others keep uploading Jazak Allah ❤❤❤

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

    int stackBottom(struct Node* top){
    struct Node *k = top;
    while (k->next != NULL)
    {
    k = k->next;
    }
    return k->data;
    }

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

      @Harsh Chopra shi hai bro

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

      @Harsh Chopra sahi hai

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

      you can use this function without struct Node *top ==> parameters too. as top is already declared as Global variable.

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

      @@raht9578 hi banss

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

      @@shelbys1533 oh wow

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

    sare data structure samajh aa rhe he harry bhai

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

    8:45 Homework: stackBottom function in Linked list
    stackBottom(){
    struct node*ptr = top;
    while(ptr!= NULL){
    ptr = ptr -> next; }
    return ptr -> data; }

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

    Greatt work 👍👍

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

    8:46 Stack Bottom:
    while(ptr->next!=NULL){
    ptr=ptr->next;
    }
    return ptr->data;

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

    Harry bhaiya done with this thank you

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

    Bhai agar ham deletion and insertion at start for linked list for pop and push respectively along with the checks for underflow and overflow we could implement the same simply by knowing the
    Linked list u taught beautifully

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

    stackBottom Function:
    int stackBottom(struct node * ptr){
    while(ptr->next != NULL){
    ptr = ptr->next;
    }
    return ptr->data;
    }

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

    thankyou so much herry sir this playlist very helpful for me

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

    Thank you harry bhai for such awesome course

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

    Function for stack bottom.
    int stackBottom(struct Node *s)
    {
    if (isEmpty(s) == 1)
    {
    return -1;
    }
    while (s->next != NULL)
    {
    s = s->next;
    }
    return s->data;
    }

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

    correct code
    int stackBottom(struct Node *top){
    if(isEmpty(top)){
    printf("stack is empty:stack underflow
    ");
    return -1;
    }
    else{
    struct Node *ptr = top;
    do{
    ptr = ptr->next;
    }while(ptr->next!= NULL);

    return ptr->data;
    }
    }

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

    StackBottom() operation of stack using linked list in c language:
    int stackBottom(struct Node* top){
    struct Node* ptr=top;
    while(ptr->next!=NULL){
    ptr=ptr->next;
    }
    return ptr->data;
    }

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

    Great work..learned a lot from you.

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

    int StackBottom()
    {
    struct Node* ptr= top;
    while(ptr->Next!=NULL)
    {
    ptr=ptr->Next;
    }
    return (ptr->data);
    }

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

    int StackBottom(struct Node* top)
    {
    Node* temp = top;
    while(temp->next != nullptr)
    {
    temp = temmp->next;
    }
    return temp->data;}
    }

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

    8:42
    STACK BOTTOM
    int stackBottom(struct node *top)
    {
    struct node *ptr = top;
    while (ptr->next != NULL)
    {
    ptr = ptr->next;
    }
    return ptr->data;
    }

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

    Thank you sir for such awesome content .respect your hardwork man

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

    8:48
    int stackBottom()
    {
    struct Node * ptr = (struct Node *)malloc(sizeof(struct Node *));
    ptr->next = top;
    while (ptr->next != NULL){
    ptr = ptr->next;
    }
    return ptr->data;
    }

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

    8:33 // Home Work
    int stackBottom(struct Node* top){
    if(isEmpty(top)){
    printf("Stack is Underflow:(
    ");
    return -1;
    }
    while(top->next!=NULL){
    top=top->next;
    }
    return top->data;
    }

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

    top is not global variable so why peek is ablae to use it even without passing that.plz reply .

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

    8:59
    stackBottom
    while(top->next != NULL)
    {
    top= top->next;
    }
    printf("%d",top->data);

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

    Code for stackButtom :
    int stackButtom(node *top){
    node *ptr=top;
    while(ptr->next!=NULL){
    ptr=ptr->next;
    }
    int a=ptr->data;
    return a;
    }

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

    Harry bhai apne is dsa course mein sirf 12 pdf dali apke download notes ki or kaha hai
    Please btao harry bhai

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

    for stack bottom function
    int stackBottom(struct node *pt){
    while(pt-> next !=NULL)
    {pt= pt->next;}
    return pt->data;
    }

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

    int stackBottom(struct node *top)
    {
    struct node *ptr = top;
    struct node *q = top->next;
    while (q != NULL)
    {
    ptr = ptr->next;
    q = q->next;
    };
    return ptr->data;
    }

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

    int stackBottom(struct Node * top){
    struct Node * p = top;
    struct Node * q = top->next;
    while(q != NULL){
    p = p->next;
    q = q->next;
    }
    return p->data;
    }

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

    Thankyou Sir❤️❤️

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

    int stackBottom(struct Node* top){
    struct Node *k = top;
    while(k->next){
    k=k->next;
    }
    return k->data;
    }😇

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

    Home work -->stackbottom code:int stackbottom(struct Node *head){
    if(isEmpty(head)){
    return -1;
    }
    else{
    int size=0,i=1;
    struct Node *p=(struct Node *)malloc(sizeof(struct Node));
    p=head;
    while(p!=NULL){
    p=p->next;
    size++;
    }
    while(inext;
    i++;
    }
    return head->data;

    }
    }

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

    Thanks Harry Bhaiya

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

    Nice explanation

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

    int stackBottom(struct Node *top)
    {
    struct Node *ptr = top;
    for (int i = 0; (i < 3); i++)
    {
    ptr = ptr->next;
    }
    return ptr->data;
    }
    printf("The Bottom element of the stack is %d", stackBottom(top));

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

    8:34
    int stackBottom(struct Node * ptr)
    {
    for (int i=0; (ptr->next)!=NULL; i++)
    {
    ptr=ptr->next;
    }
    return ptr->data;
    }

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

    Harry bhai ek request hai.
    Can you please make a tutorial on database management system as well
    If your answer is yes then please reply to me. I have watched many of your tutorials

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

    while(ptr!=NULL){
    ptr=ptr->next;}
    cout

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

    Near 1M Harry Bhai!

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

    stack bottom :
    int stackbottom(node *top){
    node *ptr = top;
    while (ptr->next != NULL)
    {
    ptr = ptr->next;
    }
    int b = ptr->data;
    return b;
    }

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

    Stack Bottom:-
    int BottomStack(struct node *top)
    {
    struct node *ptr = top;
    while (ptr->next != NULL)
    {
    ptr = ptr->next;
    }
    return ptr->data;
    }

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

    code for stackBottom--->
    int stackBottom(ND* top){
    ND* ptr=top;
    while(ptr->next!=NULL){
    ptr=ptr->next;
    }
    return ptr->data;
    }

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

    Solution:
    int stackBottom(){
    struct Node *ptr = top;
    while (ptr->next != NULL)
    {
    ptr = ptr -> next;
    }
    return ptr->data;
    }

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

    stackbottom(struct node * top){
    struct node *ptr=top;
    while(ptr->next==NULL){
    printf("element of stack botttom is %d",ptr->data);
    }
    }