2.4 Linked List Implementation in C/C++ | Creation and Display | DSA Tutorials

Поділитися
Вставка
  • Опубліковано 1 жов 2024
  • Jennys Lectures DSA with Java Course Enrollment link: www.jennyslect...
    ******************************************
    CORRECTION: @24:10 initialize choice variable with 1 by writing:
    int choice=1;
    ******************************************
    In this video we will see implementation of basic operations like Create a Node in Linked List and traverse a Linked List.
    DSA Full Course: https: • Data Structures and Al...
    ******************************************
    See Complete Playlists:
    C Programming Course: • Programming in C
    C++ Programming: • C++ Complete Course
    Python Full Course: • Python - Basic to Advance
    Printing Pattern in C: • Printing Pattern Progr...
    DAA Course: • Design and Analysis of...
    Placement Series: • Placements Series
    Dynamic Programming: • Dynamic Programming
    Operating Systems: // • Operating Systems
    DBMS: • DBMS (Database Managem...
    ************************************************
    Connect & Contact Me:
    Facebook: / jennys-lectures-csit-n...
    Quora: www.quora.com/...
    Instagram: / jayantikhatrilamba
    #linkedlist #datastructures #algorithms

КОМЕНТАРІ • 1,3 тис.

  • @JennyslecturesCSIT
    @JennyslecturesCSIT  Рік тому +193

    CORRECTION: @24:10 initialize choice variable with 1 by writing:
    int choice=1;

    • @rabean50
      @rabean50 Рік тому +4

      long time no see

    • @sachinandanprasad7618
      @sachinandanprasad7618 Рік тому +6

      @@kangmoabel still she is the best
      the way she teaches,, its unique & efficient enough..

    • @pallaviyaddanapudi7345
      @pallaviyaddanapudi7345 Рік тому

      After loop which is one printed for creating list

    • @Mohammed.1471
      @Mohammed.1471 Рік тому +8

      Mam can u please provide printed code ?....plzz

    • @SB_Roy_Vlogs
      @SB_Roy_Vlogs Рік тому

      ​@@Mohammed.1471
      @SB_Roy_Vlogs
      #include
      #include
      #include
      struct node{
      int data;
      struct node *next;
      };
      int main(){
      struct node *head,*newnode,*temp;
      int choice=1;
      head=NULL;
      while(choice){
      newnode=(struct node*)malloc(sizeof(struct node));
      printf("Enter node:");
      scanf("%d",&newnode->data);
      newnode->next=NULL;
      if(head==NULL){
      head=newnode;
      temp=newnode;
      }
      else{
      temp->next=newnode;
      temp=newnode;
      }
      printf("Enter 1 for continue and 0 for exit:");
      scanf("%d",&choice);
      }
      temp=head;
      while(temp!=NULL){
      printf("%d->",temp->data);
      temp=temp->next;
      }
      printf("NULL");
      getch();
      return 0;
      }

  • @roshangogu2670
    @roshangogu2670 2 роки тому +130

    Oh my, why can’t i understand anything 😢

    • @learnersacademybyhaya.345
      @learnersacademybyhaya.345 6 місяців тому +7

      Did you get then?
      Did you pass the course?

    • @DurgaSaathwikKolla
      @DurgaSaathwikKolla 6 місяців тому +1

      😂😂

    • @roshangogu2670
      @roshangogu2670 6 місяців тому

      @@learnersacademybyhaya.345it's been 1 year 😲 , luckily I passed my exam(data structure), it was my 3rd sem subject and currently I am on my final sem(time files like a jet)

    • @roshangogu2670
      @roshangogu2670 5 місяців тому

      @@learnersacademybyhaya.345 yeh, I passed luckily anyway🥹. It was one of my 3rd sem subject

    • @coding_with_bf
      @coding_with_bf 5 місяців тому +1

      I am also😢😢😢😢

  • @LaysaBit
    @LaysaBit 3 роки тому +694

    At this point, I dropped my college classes to watch your videos. I learn so fast with you, even though english is not my first language. A big thank you from Brazil!

  • @PareeksAcademy10october2001
    @PareeksAcademy10october2001 2 роки тому +18

    /*Creation and display of singly linked list*/
    #include
    #include
    #include
    void main()
    {
    struct node{
    int data;
    struct node *next;
    };
    struct node *head,*newnode,*temp;
    head=0;
    int choice;
    while(choice){
    newnode=(struct node*)malloc(sizeof(struct node));
    printf("enter data");
    scanf("%d",&newnode->data);
    newnode->next=0;
    if(head==0)
    {
    head=temp=newnode;
    }
    else
    {
    temp->next = newnode;
    temp=newnode;
    }
    printf("do you want to continue");
    scanf("%d",&choice);
    }
    temp=head;
    while(temp!=0)
    {
    printf("%d",temp->data);
    temp=temp->next;
    }
    }

    • @Twitter_trending_
      @Twitter_trending_ Рік тому +1

      this code will node work because you have to assign your choice=1 before while

  • @hetulmehta9960
    @hetulmehta9960 Рік тому +29

    #include
    #include
    int main(){
    struct node{
    int data;
    struct node * next;
    };
    struct node *head, *newnode , *temp;
    head = 0;
    int choice = 1;
    while(choice){
    newnode =(struct node *)malloc(sizeof(struct node));
    printf("Enter data");
    scanf("%d", &newnode -> data);
    newnode->next = 0;
    if(head == 0){
    head = temp = newnode;
    }
    else{
    temp -> next = newnode;
    temp = newnode;
    }
    printf("Do you want to continue (0 , 1)?");
    scanf("%d",&choice);
    }
    temp = head;
    while(temp != 0)
    {
    printf("%d",temp-> data);
    temp = temp -> next;
    }
    }

  • @srin42
    @srin42 5 років тому +331

    Her dedication should be really appreciated.Please do all algorithms then leetcode also. She will be a youtube education trainer star. Her videos are being viewed from all corners of the world. in short she is helping many students who lack proper lectures. Some people born to help and a bring change in world. She has long way to go.

    • @badrip3237
      @badrip3237 2 роки тому +2

      Please explain me what is the difference between head pointer and newnode pointer and why malloc is used for only newnode but not head

    • @bhashkarkumar1542
      @bhashkarkumar1542 Рік тому +1

      @@badrip3237 the declaration "struct Node* head = NULL" reserves memory for the pointer variable 'head', it doesn't allocate memory for the 'node' structure itself at this point. the memory for the Node structure is dynamically allocated using the malloc.

  • @arvindersingh9588
    @arvindersingh9588 5 років тому +612

    One of the best DS lectures i have ever seen on youtube. The tricky concept of linked list has been explained in such an interactive and crystal clear manner that i was able to think of the codes of other operations on singly linked list by end of video.
    This type of content deserves millions of views. Wish you get 1 Million + subs soon.
    Thanks for the awosome content.
    Respect from NIT Jalandhar

    • @prachijadhav5719
      @prachijadhav5719 3 роки тому +3

      Ma'am I have seen many videos of data structures but yours is best 💯thanks a lot for such a best explaination of the concept🙌👍

    • @duniajahansaraasman1997
      @duniajahansaraasman1997 3 роки тому +1

      Mam ne wakai accha tarike se samjhaya hai

    • @soujitd
      @soujitd 2 роки тому +1

      Your words are really true bro...

    • @sunnyjain6731
      @sunnyjain6731 2 роки тому

      @@pundlikpatil2380 bhai printf scanf ki jgh cout cin ka he to diff hai itna kuch nhi hai same he to hai bro

    • @aniketsaha7273
      @aniketsaha7273 2 роки тому +2

      Kitna paisa mila yeh sab likhne ke liye Bhai

  • @mavericks5763
    @mavericks5763 3 роки тому +219

    Thank you ma'am.
    The code taught by ma'am is :
    #include
    #include
    void main(){
    struct node{
    int data;
    struct node *next;
    };
    struct node *head;
    struct node *newnode;
    struct node *temp;
    head=NULL;
    int choice,count=0;
    while(choice)
    {
    newnode=(struct node*)malloc(sizeof(struct node));
    printf("Enter Data:
    ");
    scanf("%d",&newnode->data);
    newnode->next=0;
    if(head==0)
    {head=temp=newnode;}
    else
    {
    temp->next=newnode;
    temp=newnode;}
    printf("Do you want to continue (0,1)?
    ");
    scanf("%d",&choice);
    }
    printf("--------------------------------
    ");
    temp=head;
    while(temp!=0)
    {
    printf("
    %d
    ",temp->data);
    temp=temp->next;
    count++;}
    {
    printf("
    Count=%d",count);}
    }

  • @hariomvitthala
    @hariomvitthala 20 годин тому

    You're exuberantly flawless miss Jenny!! Thanks a lot ❤

  • @mukul4243
    @mukul4243 4 роки тому +7

    CODE :
    #include
    #include
    int main()
    {
    struct node{
    int data ;
    struct node*next;

    };
    int choice =1;
    struct node*head;
    struct node*temp;
    struct node*newNode;
    head=0;
    while(choice){
    newNode = (struct node*) malloc(sizeof(struct node));
    printf(" enter the data ");
    scanf("%d",&newNode->data);
    newNode->next=0;
    if (head==0)
    {
    head= temp=newNode;
    }
    else {
    temp->next=newNode ;
    temp= newNode;
    }
    printf ( " do u want to continue ( type 0 or 1)?
    ");
    fflush(stdin);
    scanf("%d",&choice);
    }
    temp= head;
    printf("items in linked list are:");
    while(temp!=0)
    {
    printf( " %d",temp->data);
    temp= temp->next;

    }
    return 0;
    }
    thank you mam

  • @snehashishhalder6591
    @snehashishhalder6591 5 років тому +41

    Because of you I am alive ... Can't understand a single concept in my clg but after your 30 mins lecture ... Its now clear and understandable ... Proper explanations and best tutorials in UA-cam for CS students ... Keep this amazing work up !!

  • @_Aditya_Raikwar_
    @_Aditya_Raikwar_ 8 місяців тому +2

    #include
    #include
    struct node{
    int data;
    struct node*next;
    };
    int main(){
    struct node *head,*newnode,*temp;
    head=0;
    int choice=1;
    while(choice){
    newnode=(struct node*)malloc(sizeof(struct node ));
    printf("enter the data that you want to insert in linked list = ");
    scanf("%d",&newnode->data);
    newnode->next=0;
    if(head==0){
    head=temp=newnode;
    }
    else{
    temp->next=newnode;
    temp=newnode;
    }
    printf("do you want to continue (1 for yes and 0 for No) = ");
    scanf("%d",&choice);
    }
    temp=head;
    printf("the list is =");
    while(temp!=0){
    printf(" %d",temp->data);
    temp=temp->next;
    }
    }

  • @atulpandey7637
    @atulpandey7637 5 місяців тому +3

    Everything was going well before this video but this video made me realize that i am still noob😥😥

  • @paladugukavya5713
    @paladugukavya5713 2 місяці тому +2

    Madam can you excute in the system plz

  • @deekshithpraddeep6715
    @deekshithpraddeep6715 4 роки тому +21

    Thank u so much Maam, the lecture was one of the effective and understanding DS lectures I had watched since now. I again Thank u for the effort you have taken for providing us this Wonderful Lecture.

  • @ajentroy6193
    @ajentroy6193 2 роки тому +3

    Mam
    I am crazy about you.....
    I fell in love the minute i saw you 😍
    Mujse shadhi karogi

  • @gayathri-8-i6s
    @gayathri-8-i6s 2 роки тому +1

    I have a doubt mam. Only when head ==0 , we are setting temp = new node. When head is not 0, we are not assigning anything to temp and we are assigning temp-> next = new node, here what is temp->next ?? As we are not assigning anything to temp?
    Clarify my doubt, mam

  • @erl2nd
    @erl2nd Рік тому +16

    Thank you 😊
    You have given new life to my understanding of the C program Link List.

  • @heeku_
    @heeku_ 5 років тому +40

    you explain so good, there is not a lot of QUALITY videos regarding linked list, you are among the few I have ever seen, you made me understand linked list (which I am doing in C now) and I managed to success my homework after trying it for a week without success, you are amazing, I want to thank you for that!

  • @aniketsaxena4879
    @aniketsaxena4879 4 роки тому +2

    These videos are only for C programming and not for c++.

  • @moazzamqureshi7150
    @moazzamqureshi7150 4 роки тому +82

    This is like exponential times better than my phd professor , glad to be learning from this !

  • @Anil_2411
    @Anil_2411 2 роки тому +1

    Hi mam
    Here in the last while condition
    Is it
    While(temp != 0) ? Or
    While (temp->next != 0) ?

  • @Crying_eyes
    @Crying_eyes 6 місяців тому +3

    I have to ignore mam in video to understand the topic
    Why she 's so beautifull❤

  • @SB_Roy_Vlogs
    @SB_Roy_Vlogs Рік тому +2

    #Full code herre thanks mam..
    #include
    #include
    #include
    struct node{
    int data;
    struct node *next;
    };
    int main(){
    struct node *head,*newnode,*temp;
    int choice=1;
    head=NULL;
    while(choice){
    newnode=(struct node*)malloc(sizeof(struct node));
    printf("Enter node:");
    scanf("%d",&newnode->data);
    newnode->next=NULL;
    if(head==NULL){
    head=newnode;
    temp=newnode;
    }
    else{
    temp->next=newnode;
    temp=newnode;
    }
    printf("Enter 1 for continue and 0 for exit:");
    scanf("%d",&choice);
    }
    temp=head;
    while(temp!=NULL){
    printf("%d->",temp->data);
    temp=temp->next;
    }
    printf("NULL");
    getch();
    return 0;
    }

  • @RahulSingh-db3ge
    @RahulSingh-db3ge 5 років тому +14

    One of the best teacher I have ever seen in my life who explained linked list in such an easy way.
    Thanks mam for uploading this video.

  • @rampujansharma3440
    @rampujansharma3440 4 роки тому +1

    Mam , why you are not doing coding part in software,it will be easier 4 us.just create one coding session and provide a link in each linked video

  • @anjalii1102
    @anjalii1102 5 років тому +38

    I was so tensed with linked list.Tried paid courses,even watch other so called 80 k+ subscriber's channels no one was better than you.u explain from heart not juzz for subscribers.hoping 4ur 1 Million+ n ahead!!!! Tysm ma'am

  • @gautamdwivedi2400
    @gautamdwivedi2400 3 роки тому +9

    One of the best video on linked list. I tried to learn from different sources but coudn't understand. But after watching this video my concepts are completely clear. The concept has been explained in crystal clear manner. Thank you so much ma'am for this awesome video.

  • @Lashistoriasdelilith
    @Lashistoriasdelilith 2 роки тому +1

    when printing if I write just temp in the condition it appears an error, if I write temp->next in the condition and then I print before moving temp->next it doesn't print the last one as it is equal to cero and if I move temp->next first and then print, it doesn't print the first one.... 🤔

  • @Lifestyle_Lab77
    @Lifestyle_Lab77 4 роки тому +9

    Ma'am you are so beautiful so I can't focused 😭😭

  • @aditi1512
    @aditi1512 2 роки тому +1

    why are we not declaring struct node*newnode,*temp etc inside struct node datatype??

  • @syrus8077
    @syrus8077 Рік тому +6

    #include
    #include
    struct list
    {
    int data;
    struct list *next;
    };
    typedef struct list list;
    list *head , *start , *temp;
    void main()
    {
    head = 0;
    int a;
    int count = 0;
    do
    {
    count++;
    start = (list*)malloc(sizeof (list));

    printf("Enter Data : ");
    scanf("%d",&start->data);
    start->next=0;
    if (head == 0)
    {
    head = temp = start;
    }
    else
    {
    temp->next=start;
    temp=start;
    }
    printf("
    Press 1 To Continue Adding More Data Or 0 To End [ 1 / 0]
    ");
    scanf("%d",&a);

    } while (a);
    int i=1;
    printf("
    No of data added = %d
    ",count);
    temp = head;
    while (temp != 0)
    {
    printf("
    %d. Data is = %d
    ",i++,temp->data);
    temp = temp->next;
    }
    }

  • @muhammadsaqibjaved9904
    @muhammadsaqibjaved9904 Рік тому +7

    A big round of applause from Pakistan. Great work....
    But please do the same in Java coding. Thank you

  • @Ary2345
    @Ary2345 3 місяці тому +1

    review time: guys lectures are worth it ( you don't need review i know it, but i have to brag my grades as well lol!! ) i got an A both in thoery and lab.. so you can do it...

  • @prabhat2661
    @prabhat2661 Рік тому +8

    Jenny mam your teaching skills are way better than tier 1 2 3 college teachers really grateful to consume such valuable content for free hats of to your hard work and dedication towards Teaching, every engineers programming base is created from UA-cam .... :)

  • @tusharsoni2450
    @tusharsoni2450 2 роки тому +1

    Maam's code is below this
    #include
    #include
    void main()
    {
    struct node{
    int data;
    struct node* next;
    };
    struct node* newnode,*head, *temp;
    int choice=1,count=0;
    head=NULL;
    while(choice==1){
    newnode=(struct node*)malloc(sizeof(struct node));
    printf("Enter Data:
    ");
    scanf("%d",&newnode->data);
    newnode->next=0;
    if(head==0)
    {
    head=temp=newnode;
    }
    else{
    temp->next=newnode;
    temp=newnode;
    }
    printf("DO you wish to continue:1 for yes and 0 for no
    ");
    scanf("%d",&choice);}
    printf("-----------------------
    ");
    temp=head;
    while(temp!=0)
    {
    printf("%d
    ",temp->data);
    temp=temp->next;
    count++;
    }
    printf("%d",count);
    }

  • @vaibhavsharma5114
    @vaibhavsharma5114 5 років тому +9

    Really mam the lecture was soo understanding, i was having soo much difficulty in implementation of link list but nothing helped me out.Your lecture was soo good and excellent that i have no doubts remained please continue to teach us like this mam.Really you're a fabolous teacher

  • @himanshuchauhan4440
    @himanshuchauhan4440 8 місяців тому +1

    Hey! Videos are really of great help. I very much appreciate the content and dedication.
    This explanation can be bit better as in the traversal of temp pointer could have been explained little more.

  • @ayeshaqamar9224
    @ayeshaqamar9224 9 місяців тому +23

    Seriously she deserves Oscar in teaching profession ❤

  • @RashaadMirza
    @RashaadMirza 11 місяців тому +1

    #include
    void main() {
    struct node {
    int data;
    struct node *next;
    };
    struct node *head, *newnode, *temp;
    head=0;
    int choice=1;
    while (choice) {
    newnode=(struct node *)malloc(sizeof(struct node));
    printf("
    Enter data: ");
    scanf("%d", &newnode->data);
    newnode->next=0;
    if (head==0) {
    head=temp=newnode;
    }
    else {
    temp->next=newnode;
    temp=newnode;
    }
    printf("Do you want to continue? (0/1): ");
    scanf("%d", &choice);
    }
    temp=head;
    while (temp!=0) {
    printf("%d ", temp->data);
    temp=temp->next;
    }
    getch();
    }

  • @douchenozzlemcgee6111
    @douchenozzlemcgee6111 4 роки тому +20

    w o w she's smart, well-spoken and gorgeous?? My brain has officially broken!

  • @shreshtha_6399
    @shreshtha_6399 5 років тому +9

    Thanks mam for teaching in such an amazing way , keep giving your valuable knowledge 🤩🤩🤩🔥🔥🔥

  • @aashishshrestha8180
    @aashishshrestha8180 4 роки тому +2

    can you make videos in c++

  • @AJAYLIKEEMO
    @AJAYLIKEEMO 4 роки тому +19

    Ma'am its my 17th time of watching this video though I haven't understood this concept well but Dekhna Acha Lagta hai

  • @adhargupta3441
    @adhargupta3441 3 роки тому +25

    Who the hell has said the one way communication can't work...🙄
    This is incredible mam thanku🥺🌝💗💗

  • @anoshahafeez5188
    @anoshahafeez5188 Рік тому +1

    I am still confused in this linked list impletation

  • @koolkd12
    @koolkd12 4 роки тому +10

    Amazing, you didn't only explain the concept of linked lists well, you also taught how to think and construct the program along the way, adding the if else , while loops . Wish I had someone teach me concept like this 10 us back when I graduated I would have found greater joy and purpose in life with programming.

    • @TheBoredandCool
      @TheBoredandCool 3 роки тому

      GeeksforGeeks is organising mini course of DSA that you should not miss out.
      Why??
      1. Live QnA sessions, you can clear all doubts related to DSA. Any doubt from LinkedList to Graph.
      2. You will get practice problems after every Data structure to make you good at DSA and crystal clear concepts.
      3. After completion of course you will get certificate and can access course anytime.
      4. Its FREE!!! But only if you use the below code -
      GFGD4Y2JR
      Register here-
      practice.geeksforgeeks.org/courses/Workshop-DSA?loginMode=308

  • @AnmolKumar-ci7qz
    @AnmolKumar-ci7qz 5 років тому +28

    Best lecture ever ma'am...u have explained every single point...

  • @murigig
    @murigig 4 роки тому +13

    You can't imagine how much you are helping some of us

  • @srujithreddy1643
    @srujithreddy1643 2 роки тому +19

    I finally understood the concept of linked list.
    previously, I watched thousands of other youtubers, teaching the same thing and no body does it better than you .
    Thank you so much mam.....

  • @kumarivandana3449
    @kumarivandana3449 3 роки тому +8

    I had lots of confusion .. but now I understand everything about linked list...thank you so much Jenny mam..
    Students like us ..who do not understand concepts easily you teach us easily.😊

  • @suhainasirajudeensuhainasi1225
    @suhainasirajudeensuhainasi1225 7 місяців тому +1

    Initialise for loop for creating multiple number of linked list

  • @shivambaghel9668
    @shivambaghel9668 4 роки тому +8

    A big thanks to you ma'am,i was so frustrated on this topic but you clear all my confusion and make a clear cut concept, thanks you.❤️🤘

    • @TheBoredandCool
      @TheBoredandCool 3 роки тому

      GeeksforGeeks is organising mini course of DSA that you should not miss out.
      Why??
      1. Live QnA sessions, you can clear all doubts related to DSA. Any doubt from LinkedList to Graph.
      2. You will get practice problems after every Data structure to make you good at DSA and crystal clear concepts.
      3. After completion of course you will get certificate and can access course anytime.
      4. Its FREE!!! But only if you use the below code -
      GFGD4Y2JR
      Register here-
      practice.geeksforgeeks.org/courses/Workshop-DSA?loginMode=308

  • @poojamore9576
    @poojamore9576 3 роки тому +1

    #include
    #include
    struct node{ //own data type
    int data; //4 bytes
    struct node *next; //4 bytes
    //struct node is data type of node, whose add next will store
    };
    void main()
    {
    printf("hello world
    ");
    struct node *head, *new_node, *temp; //struct node is data type of node, whose add head will store
    head=0;
    int choice, count=0;
    //dynamic allocation - malloc function
    while(choice){
    new_node=(struct node*)malloc(sizeof(struct node)); //8 bytes is allocated dynamically
    printf("enter the data:
    ");
    scanf("%d", &new_node->data);
    new_node->next=0; //null
    if(head == 0){
    head= temp=new_node;
    }
    else {
    temp->next= new_node;
    temp=new_node;
    }
    printf("do you want to continue(0,1)?");
    scanf("%d", &choice);
    }//while
    temp=head;
    printf("All the linkedlist data :
    ");
    while(temp!=0){ //to print the data of linked list
    printf("%d
    ", temp->data);
    temp= temp->next;
    count++;
    }//while
    printf("count : %d", count);
    getch();
    }

  • @ramjas5351
    @ramjas5351 5 років тому +6

    o....mother of algorithm...💚💛🧡
    i never seen such like explanation. ..only and only requist capture ever topic. .

  • @abdulwarissherzad9914
    @abdulwarissherzad9914 4 роки тому +8

    You teach Link List completely in a very logical way and i hope you will never remove this taturail or never chang to payment site . thank you.... wish you the best .

    • @TheBoredandCool
      @TheBoredandCool 3 роки тому

      GeeksforGeeks is organising mini course of DSA that you should not miss out.
      Why??
      1. Live QnA sessions, you can clear all doubts related to DSA. Any doubt from LinkedList to Graph.
      2. You will get practice problems after every Data structure to make you good at DSA and crystal clear concepts.
      3. After completion of course you will get certificate and can access course anytime.
      4. Its FREE!!! But only if you use the below code -
      GFGD4Y2JR
      Register here-
      practice.geeksforgeeks.org/courses/Workshop-DSA?loginMode=308

  • @sooryaj1270
    @sooryaj1270 4 роки тому +15

    the value of the choice variable must be set to 1 for the initial entry into while loop, EXCELLENT LECTURE MAM !! A great tutorial that took me to the basics !!! happy_coding_geeks !!

  • @thisisavi1898
    @thisisavi1898 6 місяців тому +2

    Implemented correct code from my side :
    //linked list
    #include
    #include
    int main(){
    struct node{
    int data;
    struct node *next;
    };
    int choise = 1,count = 0;
    struct node *newnode, *temp, *head = 0;

    while(choise){
    newnode = (struct node*)malloc(sizeof(struct node));
    printf("
    Enter the data ");
    scanf("%d",&newnode->data);
    newnode->next = 0;
    if(head == 0){
    head = temp = newnode;
    }else{
    temp->next= newnode;
    temp = newnode;
    }

    printf("
    Enter the choise : ");
    scanf("%d",&choise);
    }
    printf("
    Our data is : ");
    temp = head;
    while(temp!=0){
    printf("
    Data : %d",temp->data);
    temp = temp->next;
    }
    }

  • @gaminghouse7599
    @gaminghouse7599 Рік тому +1

    Mam the printing part of the code will run infinitely
    Beacause it was set to run untill temp becomes '0' i.e. the address stored in last node
    But the next part of last node contains a garbage value by default. So we have to manually put temp=0 in the last iteration i.e. when last node is created

  • @ashrafulalamhridoy6728
    @ashrafulalamhridoy6728 5 років тому +4

    Miss, i have been trying to learn linked list for last 4/5 days.. And wasted 6/7 hours. But somehow i found your video and thought 30 mins will waste again.. But everything changed when you were explain.. You made it so clear and easy.. Thanx for the great video..

  • @debjeetmukherjee1297
    @debjeetmukherjee1297 Рік тому +1

    Traversal is not working please help

  • @abhishek_kumarvelloreinsti1866
    @abhishek_kumarvelloreinsti1866 4 роки тому +4

    I would like to owe you my genuine respect from the core of my heart....a huge amount of respect from me....n fr my friends from Vellore institute of Technology....

  • @Code_with_sai
    @Code_with_sai 6 місяців тому +1

    Actual code what mam told is:
    #include
    #include
    void main()
    {
    struct node
    {
    int data;
    struct node *next;
    };
    struct node *head,*newnode,*temp;
    head=NULL;
    int choice=1;
    while(choice)
    {
    newnode=(struct
    node*)malloc(sizeof(struct node));
    printf("Enter Data:");
    scanf("%d",&newnode->data);
    newnode->next=0;
    if(head==0)
    {
    head=temp=newnode;
    }
    else
    {
    temp->next=newnode;
    temp=newnode;
    }
    printf("Do you want to continue (0,1)?
    ");
    scanf("%d",&choice);
    }
    temp=head;
    while(temp)
    {
    printf("%d",temp->data);
    temp=temp->next;
    }
    }

  • @great8736
    @great8736 10 місяців тому +3

    Thankyou mam i pass the data structure exam by watching your videos😊❤.its really very very helpfull to me

  • @aayushgour5320
    @aayushgour5320 3 роки тому +1

    What's the problem in my code I m not getting required output:-
    #include
    #include
    struct node
    {
    int data;
    struct node *next;
    }*head=NULL,*newnode,*temp;
    int main()
    {
    int count;
    int choice=1;
    while(choice)
    {
    newnode=(struct node*)malloc(sizeof(struct node));
    printf("Enter the data item:");
    scanf("%d ",&newnode->data);
    newnode->next=NULL;
    if(head==NULL)
    {
    head=temp=newnode;
    }
    else
    {
    temp->next=newnode;
    temp=newnode;
    }
    printf("Do you want to continue(0,1) ?
    ");
    scanf("%d",&choice);
    }
    temp=head;
    while(temp!=NULL)
    {
    printf("%d ",temp->data);
    temp=temp->next;
    count++;
    }
    printf("%d",count);
    return 0;
    }

  • @brr522
    @brr522 Рік тому +3

    This lecture is so good.. I can't thnk you enough for the lectures u provide.. solid lecture 💯💯

  • @sahanas7838
    @sahanas7838 8 місяців тому +2

    Mam I'm really thankful for you ❤️. I never thought that I would understand this topic but you made this really easy to understand. This society needs more teachers like you. Thank you for your amazing help mam💜

  • @koushikmajumder1898
    @koushikmajumder1898 4 роки тому +4

    I can't run it with while(choice), I am using Do-while instead...is that correct way to approach?

    • @chiragpandey3221
      @chiragpandey3221 3 роки тому

      with do whille it will be executed once and the ask which doesn't affect anything in short it doesn't matter

    • @dhruvvashishth3122
      @dhruvvashishth3122 3 роки тому

      shuru mai bhi jab ham choice declare kar rhe hai tih bhi shayad choice ki value deni padegi like int choice=1;

    • @sumitadas9286
      @sumitadas9286 2 роки тому

      Can you please give me the full code?
      I am also struggling to run it

  • @shamikiani1080
    @shamikiani1080 2 роки тому +1

    Please make this video in c++ only, because it is creating problem for me.i Will be very thankful to you.
    Please, please please.

  • @yrtepgold
    @yrtepgold 2 роки тому +20

    Hello from the USA. Thank you for making these videos mam! I found your channel last spring as I was struggling to implement a linked list ds for a masters course. I found your channel and after watching this video everything clicked for me and I totally understood what I needed to do. I've since passed my course but I find myself still watching videos on your channel even though I don't need to for any course work bc I find your teaching style and white board approach to be so effective.

    • @user-ve8kw6eu7h
      @user-ve8kw6eu7h 11 місяців тому

      Sir ,in usa how is the scope of IT sector ? Is it has much scope?

  • @Daya_1996-f6g
    @Daya_1996-f6g 5 місяців тому +1

    hello mam......a small request mam....>>>>>>>>.please revise all the concept of a video at last mam...so that we can easily understand😇

  • @AmitYadav-hm4sz
    @AmitYadav-hm4sz 5 років тому +9

    one of the best DS lectures i have ever seen on youtube....
    this type of lecture is not present on youtube..thanks mam

    • @harithachandran9562
      @harithachandran9562 2 роки тому

      Ma'am I have a doubt ,I have an error in if(head=newnode->next=0)
      It seems Id returned 1 exit status.

  • @mukul4243
    @mukul4243 4 роки тому +1

    Can anyone send me the copy of code in c on the editor ...please

  • @mdimranhussain171
    @mdimranhussain171 3 роки тому +4

    Thank you teacher.
    after 4 days of wandering here and there , its all clear now .

  • @dhanushponnada-hl9kw
    @dhanushponnada-hl9kw Рік тому +2

    Edo Malayalam movie ni Telugu subtitles tho chusthunattu undi 😭

    • @KHAN-dg2qs
      @KHAN-dg2qs Рік тому

      Ardam aitunda bro?

    • @dhanushponnada-hl9kw
      @dhanushponnada-hl9kw Рік тому

      @@KHAN-dg2qs ardam kavatledu bro

    • @KHAN-dg2qs
      @KHAN-dg2qs Рік тому

      @@dhanushponnada-hl9kw Sandeep Saradhi Ani Search chey bro , manchi explanation untadi akkada

    • @sameerpatnaik
      @sameerpatnaik Рік тому

      ​@@KHAN-dg2qs can't understand anything 😔😔😔

  • @jenniefine9456
    @jenniefine9456 4 роки тому +3

    Awesome linked list tutorial thank you.
    It's my request, if you can make video on some higher competitive problems like baktracking,highest substring palindrome pls make
    Thanks🙏🙇

  • @shaikhfatema4766
    @shaikhfatema4766 Місяць тому +1

    To display our list what should we write in code???(for c language)
    #include
    #include
    Int main()
    struct node
    {
    Int data;
    struct node*link;
    }
    Struct node *head,*newnode;
    Newnode=(struct node*)malloc(size of(struct node))
    printf("enter data to insert");
    Scanf("%d",&data);
    Newnode ->link = head;
    Head=newnode;
    ?????
    Yaha per hamne newnode join krdiye at beginning but now, how should i display the whole list after this upgradation??? Iske aage ka code batao mam ek baar , program khatam kaise karein?? getch() kab use karna hai us list ko display kaise karna hai???

    • @Shattered2715
      @Shattered2715 Місяць тому

      #include
      #include
      For c language
      And
      #include
      For c++

    • @Shattered2715
      @Shattered2715 Місяць тому +1

      Getch ( ) user se input lene k liye krna he use like cin in c++ and scanf in c language
      I hope you get it.

  • @saitarunaili3370
    @saitarunaili3370 4 роки тому +4

    Ma’am I’m getting conflicting types for head, while declaring head=0

  • @SurajSingh-fb4ff
    @SurajSingh-fb4ff 2 роки тому +1

    Sorry, but head ache lecture not clean as previous lecture and plz explain in pure not little English.

  • @Adeel_Noshahi
    @Adeel_Noshahi 4 роки тому +4

    Mam my cousin became your fan at first sight.He listens your lec by sitting with me even though he is not studying at all.

    • @ruthrakaran
      @ruthrakaran 3 роки тому

      🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣suma eru da

  • @divyenduroychoudhuri7267
    @divyenduroychoudhuri7267 3 роки тому +3

    Thanks a lot madam. I was struggling with these for 1 week. I couldn't find any proper material or any lecture video or notes containing good explanations. But after seeing your lecture I am really feeling very comfortable with the topic. Thank you very much for such great explanation. 😊😊

    • @CricwuthNJ
      @CricwuthNJ 2 роки тому

      Bhai ye program run hua tha

  • @omoleyeosadare5775
    @omoleyeosadare5775 11 місяців тому +1

    Can I alone like and subscribe a million times?

  • @harshgupta0498
    @harshgupta0498 2 роки тому +4

    what a explanation, you just won my heart. I got this lecture after suffering a lot from linked list. Thank you so much MAM for providing such a wonderful lecture.

  • @adityachoudhury396
    @adityachoudhury396 Рік тому +1

    Nothing was added in the list

  • @avineshp7858
    @avineshp7858 5 років тому +9

    Recently started following your channel.
    Good stuff on data structure and algorithms.
    Almost everything is covered and explained clearly.
    Being a non CS student it is difficult to understand DS but you have made it easy. Thank you.

  • @Shattered2715
    @Shattered2715 Місяць тому +1

    Ma'am hindi me series start kro na c++ or dsa ki English thoda confusion create krta he isiliye ❤

  • @ershadtantry5774
    @ershadtantry5774 4 роки тому +4

    ...been struggling with this for quite some time. Thank you for the help!

  • @mksmohitkumarsingh8285
    @mksmohitkumarsingh8285 4 роки тому +1

    Mam aap ke programming me 4 places par error aarahe h please help

  • @harshdwivedi5832
    @harshdwivedi5832 5 років тому +8

    Proper explanation!Amazing lecturer...Each and every point was explained briefly and she cleared almost all my doubts and confusions regarding link list within minutes.Thank you for this.😊

  • @pawanlalwani4306
    @pawanlalwani4306 4 роки тому +1

    Mam one doubt agar hum first node insert krwa rhe hai in linked list too uss first node ko memory mai starting mai null mill skta hai kya

  • @rahulkaushik949
    @rahulkaushik949 5 років тому +13

    PLEASE CAN YOU GIVE THIS CODE IN C++

    • @shonemicheal4935
      @shonemicheal4935 4 роки тому +11

      #include
      #include
      #include
      using namespace std;
      struct node{
      int data;
      node *next;
      };
      int count=0;
      node *head=0,*newnode,*temp;
      class linked{
      public:
      void createnode();
      void traverse();
      };
      int main(){

      int choice;
      char ch;
      linked li;
      do{
      cout

    • @chprudhviraj7208
      @chprudhviraj7208 4 роки тому

      Brother can I give code for c I'm unable be execute above code I'm getting errors

    • @mavericks5763
      @mavericks5763 3 роки тому

      @@shonemicheal4935 Can you please provide the complete code of Linked List in C ?

    • @shonemicheal4935
      @shonemicheal4935 3 роки тому +1

      @@mavericks5763 idk c bro

    • @shonemicheal4935
      @shonemicheal4935 3 роки тому

      @@mavericks5763 #include
      #include
      struct node
      {
      int data;
      struct node *next;
      };
      struct node *head;

      void beginsert ();
      void lastinsert ();
      void randominsert();
      void begin_delete();
      void last_delete();
      void random_delete();
      void display();
      void search();
      void main ()
      {
      int choice =0;
      while(choice != 9)
      {
      printf("

      *********Main Menu*********
      ");
      printf("
      Choose one option from the following list ...
      ");
      printf("
      ===============================================
      ");
      printf("
      1.Insert in begining
      2.Insert at last
      3.Insert at any random location
      4.Delete from Beginning

      5.Delete from last
      6.Delete node after specified location
      7.Search for an element
      8.Show
      9.Exit
      ");
      printf("
      Enter your choice?
      ");
      scanf("
      %d",&choice);
      switch(choice)
      {
      case 1:
      beginsert();
      break;
      case 2:
      lastinsert();
      break;
      case 3:
      randominsert();
      break;
      case 4:
      begin_delete();
      break;
      case 5:
      last_delete();
      break;
      case 6:
      random_delete();
      break;
      case 7:
      search();
      break;
      case 8:
      display();
      break;
      case 9:
      exit(0);
      break;
      default:
      printf("Please enter valid choice..");
      }
      }
      }
      void beginsert()
      {
      struct node *ptr;
      int item;
      ptr = (struct node *) malloc(sizeof(struct node *));
      if(ptr == NULL)
      {
      printf("
      OVERFLOW");
      }
      else
      {
      printf("
      Enter value
      ");
      scanf("%d",&item);
      ptr->data = item;
      ptr->next = head;
      head = ptr;
      printf("
      Node inserted");
      }

      }
      void lastinsert()
      {
      struct node *ptr,*temp;
      int item;
      ptr = (struct node*)malloc(sizeof(struct node));
      if(ptr == NULL)
      {
      printf("
      OVERFLOW");
      }
      else
      {
      printf("
      Enter value?
      ");
      scanf("%d",&item);
      ptr->data = item;
      if(head == NULL)
      {
      ptr -> next = NULL;
      head = ptr;
      printf("
      Node inserted");
      }
      else
      {
      temp = head;
      while (temp -> next != NULL)
      {
      temp = temp -> next;
      }
      temp->next = ptr;
      ptr->next = NULL;
      printf("
      Node inserted");

      }
      }
      }
      void randominsert()
      {
      int i,loc,item;
      struct node *ptr, *temp;
      ptr = (struct node *) malloc (sizeof(struct node));
      if(ptr == NULL)
      {
      printf("
      OVERFLOW");
      }
      else
      {
      printf("
      Enter element value");
      scanf("%d",&item);
      ptr->data = item;
      printf("
      Enter the location after which you want to insert ");
      scanf("
      %d",&loc);
      temp=head;
      for(i=0;inext;
      if(temp == NULL)
      {
      printf("
      can't insert
      ");
      return;
      }

      }
      ptr ->next = temp ->next;
      temp ->next = ptr;
      printf("
      Node inserted");
      }
      }
      void begin_delete()
      {
      struct node *ptr;
      if(head == NULL)
      {
      printf("
      List is empty
      ");
      }
      else
      {
      ptr = head;
      head = ptr->next;
      free(ptr);
      printf("
      Node deleted from the begining ...
      ");
      }
      }
      void last_delete()
      {
      struct node *ptr,*ptr1;
      if(head == NULL)
      {
      printf("
      list is empty");
      }
      else if(head -> next == NULL)
      {
      head = NULL;
      free(head);
      printf("
      Only node of the list deleted ...
      ");
      }

      else
      {
      ptr = head;
      while(ptr->next != NULL)
      {
      ptr1 = ptr;
      ptr = ptr ->next;
      }
      ptr1->next = NULL;
      free(ptr);
      printf("
      Deleted Node from the last ...
      ");
      }
      }
      void random_delete()
      {
      struct node *ptr,*ptr1;
      int loc,i;
      printf("
      Enter the location of the node after which you want to perform deletion
      ");
      scanf("%d",&loc);
      ptr=head;
      for(i=0;inext;

      if(ptr == NULL)
      {
      printf("
      Can't delete");
      return;
      }
      }
      ptr1 ->next = ptr ->next;
      free(ptr);
      printf("
      Deleted node %d ",loc+1);
      }
      void search()
      {
      struct node *ptr;
      int item,i=0,flag;
      ptr = head;
      if(ptr == NULL)
      {
      printf("
      Empty List
      ");
      }
      else
      {
      printf("
      Enter item which you want to search?
      ");
      scanf("%d",&item);
      while (ptr!=NULL)
      {
      if(ptr->data == item)
      {
      printf("item found at location %d ",i+1);
      flag=0;
      }
      else
      {
      flag=1;
      }
      i++;
      ptr = ptr -> next;
      }
      if(flag==1)
      {
      printf("Item not found
      ");
      }
      }

      }

      void display()
      {
      struct node *ptr;
      ptr = head;
      if(ptr == NULL)
      {
      printf("Nothing to print");
      }
      else
      {
      printf("
      printing values . . . . .
      ");
      while (ptr!=NULL)
      {
      printf("
      %d",ptr->data);
      ptr = ptr -> next;
      }
      }
      }

  • @ikhanvids2804
    @ikhanvids2804 2 роки тому +1

    Disappoint to implement C, every one use C but not C++.

  • @aryanrathore1790
    @aryanrathore1790 4 роки тому +4

    Even 1million likes are less for this lecture!!

  • @abcb3ueb
    @abcb3ueb Рік тому +1

    mam please skeak in hindi i can understand english but in hindi its easy to lean fast

  • @smitkevadia
    @smitkevadia 4 роки тому +4

    Your videos are very helpful during this lockdown period.
    Thank You ❤

  • @SandipGhara-v7b
    @SandipGhara-v7b Місяць тому +1

    Please Mam Make A Playlist For Java .....Your Teaching Style Is So So..........Good..Please Mama I Want To Learn Java From You......Please Mam .... Who Want This Please Support

  • @AbdulGhaffar-lw5vf
    @AbdulGhaffar-lw5vf 5 років тому +12

    Thnk yu...
    BTW How yu said "fine" in last is funny nd cute.

  • @himanshipandegi6225
    @himanshipandegi6225 4 роки тому +1

    Mam, in first loop while (choice) we enter the value in the last so how can first time program work.

  • @veerbeniwal120
    @veerbeniwal120 5 років тому +8

    can anyone show me the complete linked list program..in same way she is teaching..same variables,functions,and datatypes

    • @saitarunaili3370
      @saitarunaili3370 4 роки тому

      Veer Beniwal can you send me too, if someone sent you?

    • @aniketmishra8197
      @aniketmishra8197 4 роки тому +22

      #include
      #include
      int main()
      {
      struct node
      {
      int data;
      struct node *next;
      };
      typedef struct node NODE;
      int choice=1;
      NODE *head,*newnode,*temp;
      head=0;
      while(choice)
      {
      newnode=(NODE *)malloc(sizeof(NODE));
      printf("Enter data item
      ");
      scanf("%d",&newnode-> data);
      newnode->next=0;
      if(head==0)
      {
      head=temp=newnode;
      }
      else
      {
      temp->next=newnode;
      temp=newnode;
      }
      printf("Do you want to continue:(Type 0 or 1)?
      ");
      fflush(stdin);
      scanf("%d",&choice);
      }
      temp=head;
      printf("Linked list items: ");
      while(temp!=0)
      {
      printf("%d ",temp->data);
      temp=temp->next;
      }
      return 0;
      }

    • @LyricsLayer
      @LyricsLayer 4 роки тому

      @@aniketmishra8197 Correct, I was thinking that how will it go in while loop already but you have declared choice that is right and instead we can also use do while also , do while will also do right?

    • @fahimsharuk433
      @fahimsharuk433 4 роки тому

      bro i have an doubt, y we using NODE.

    • @aniketmishra8197
      @aniketmishra8197 4 роки тому

      @@fahimsharuk433 to avoid writing struct node.

  • @meghana3775
    @meghana3775 3 роки тому +2

    You can take snap at 27.54