2.10 Implementation of Doubly Linked List - Data Structures

แชร์
ฝัง
  • เผยแพร่เมื่อ 16 ส.ค. 2019
  • We will see how to implement a Doubly Linked List with code.
    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/profile/Jayanti...
    Instagram: / jayantikhatrilamba
    #implementation, #implementationofdoublylinkedlist, #doublylinkedlist, #jennyslectures, #linkedlist, #datastructures

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

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

    Jenny, you are an amazing Professor! Your lessons thoroughly cover material my professors take 2 hours to explain but many of my classmates remain confused! A huge thank you to you! I'm SO glad I found your channel! May your channel have more successes. Sending my best regards from Los Angeles, CA.

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

    Thanks mam for the explanation...and also mam your skin is flawless 💖

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

      I hope she may become santoor soap ad ambassador in future. Madam son will come by saying mummy then the advertisement starts.

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

    Ma'am , Very Unique explanation, Thank you for ur contribution. U are doing an amazing work, May God Bless You

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

    We should implement head out of function Create cause if we implement inside, when we call that function it will get value of head = 0 and we will loose all the nodes.

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

      bro, i was trying to figure out why my code wasn't running well from last 1/2 hr and you saved my life.

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

      Bro can you provide source code please it will be helpful!

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

      @Upmanyu Gaming plz give

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

      #include
      #include
      struct node{
      int data;
      struct node *prev;
      struct node *next;
      };
      struct node *head=0;
      struct node *newnode;
      void create()
      {
      struct node *temp;
      int choice = 1;
      while(choice)
      {
      newnode = (struct node*)malloc(sizeof(struct node));
      printf("Enter the Data");
      scanf("%d",&newnode->data);
      newnode->prev=0;
      newnode->next = 0;
      if(head ==0)
      {
      head=temp=newnode;
      }
      else
      temp->next =newnode;
      newnode->prev = head;
      temp = newnode;
      printf("Do you want to continue
      ");
      scanf("%d",&choice);
      void display()
      {
      struct node *temp;
      temp = head;
      while(temp!=0){
      printf("%d",temp->data);
      temp = temp->next;
      }
      void main()
      {
      create();
      display();
      }
      }
      }
      }
      plz tell me why it not running

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

    Quality teaching as always. STAY BLESSED!!!!

  • @SanthoshKumar-fw4dz
    @SanthoshKumar-fw4dz 3 ปีที่แล้ว +1

    Best Lecture in Data Structure and Algorithms till now..

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

    Thank u mam. This video helped alot in understanding the concept of doubly linked list which I was trying to understand for almost a week

  • @ORION-hf6fu
    @ORION-hf6fu 3 ปีที่แล้ว +2

    You are great teacher. Very simple easy to understand and very clean way to writing codes. Huge respect ma'am.

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

    One word for this- Amazing ❣️

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

    Best Explanation for engineering students. Great work mam..

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

    Love the way you teach mam❤️
    Difficult topics made easy by you for us
    Thanks a lot😇

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

    Linked list is now becoming easy
    Tq and cheers✌

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

    one correction!!
    temp should be initialized outside the create() function because as the function is called repeatedly the temp value changed as it will be reinitialized and the old value will be lost
    so, temp should be initialized globally near the head
    :)

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

      Is mam code works ??

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

      @@sudheerarigela8202 no

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

      The function is for creating the link list for the first time. So there is no second use of this function, Why would call the create function second time anyway? So mam's code is indeed correct because we don't need the temp globally.

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

    Amazing videos ma'am. As a CSE student, these are really helpful for me.

  • @saritakumari-oh8fs
    @saritakumari-oh8fs 3 ปีที่แล้ว +8

    I am a BA student but your video makes me computer science student. Best explanation!

  • @FarhanAli-km5id
    @FarhanAli-km5id 3 ปีที่แล้ว

    Very helpful and outstanding video.
    May you (mam) live happy and long.

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

    Thank you so much mam.❤️❤️
    I start everyday seeing you most probably.

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

    Mam you clearify those thing like a genius.. you're a genius..thank you mam

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

    Mam please show us the total compilation and output in a code editor and make a seperate video because while typing code myself it is not executing at all. Please 🙏😭

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

      same bro, compilation error

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

      You have to make sure that you've the proper knowledge of function with pointer

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

      Actually mam was teaching the logic of the code only for understanding the concept ...and we have to use a proper code when we are compiling in the editor

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

      Ok

    • @subhampatro351
      @subhampatro351 8 หลายเดือนก่อน +3

      Correct the code head=0

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

    I'm gobsmacked to watch your videos mam....you are doing such as a great job ...

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

    Hello Ma'am just now saw your videos on youtube and it was awesome explanation, could you please make a video to explain time and space complexity also...

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

    Ma'am your channel and videos deserve more popularity and wider audience. Really thankful for your efforts and happy after understanding concepts from you. My senior suggested your channel and I am from mechanical branch from nit Allahabad so no knowledge of computer science but now I am feeling confident.

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

    The best teacher that i see.

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

    shouldn't temp be globally declared rather than locally as its values will change everytime create is called?

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

    This lecture is very helpful. Thank you ma'am.

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

    Maam your teaching is God level.......fav teacher on youtube

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

    My college is closed because of covid-19. I am learning ds by watching your videos.
    They are really helpful.
    Thank you

    • @HimanshuSharma-th1xw
      @HimanshuSharma-th1xw 4 ปีที่แล้ว

      in which year you are?

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

      I'm watching in lockdown...cse branch

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

      Can u please share compiler code ...??

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

    Mam you are the best 😚 I can't thank you enough ♥️ may god bless you 🙏🏽

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

    thank you very much your teaching helps me understand concepts easier

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

    I really appreciate for your efforts mam.Thanks a lot.

  • @125siddheshmhatre6
    @125siddheshmhatre6 4 ปีที่แล้ว

    the end of the vedio make me smile😊
    and thanks a lots mam give me a right knowledge 🙂

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

    It is better to remember pointer to tail node
    Queue insertion and concatenation are O(1)
    Backward trawversal is a little bit faster because you dont need to find tail node

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

    Mam We have to declare head outside of the function create otherwise Display point to only last node

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

    hi jenny thanks for ur helpful lecture i am form Ethiopia please keep up it

  • @AbhishekSingh-cm4be
    @AbhishekSingh-cm4be 3 ปีที่แล้ว +2

    you are Amazing

  • @job.incharge9709
    @job.incharge9709 3 ปีที่แล้ว

    AoA u way of teaching is absolutely nice and awesome plz Kindly make video on double linked in C++ please.

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

    Mam could you explain about Time complexity on a separate video. And you are just awesome mam, your videos are very helpful and beneficial to us. Thank you ❤

  • @Vishalpatil-tp4sb
    @Vishalpatil-tp4sb 3 ปีที่แล้ว +2

    God Bless U mam plz share the Knowledge to needy through Utube.

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

    mam i'm big fan of your teaching method......
    you are one of the best teacher in youtube..i have one question...
    aapko silver play button mila kya ...????(waiting for your reply: ) )

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

    Thank you ma'am. I'm your student from Bangladesh :)

  • @MrMutant-v1h
    @MrMutant-v1h 4 ปีที่แล้ว +4

    Thanks mam 😊 ...& Ur smile is adorable ✌

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

    Thankyou so much mam for this fantastic explanation 😊

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

    I love that "Emputy"..

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

    Very helpful video,thank you ma'am.

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

    Actually mam i downloaded your whole series and whenever i completed the lecture I come here every time to like your vedio😄😌

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

    Tq u mam I'm searching for this double linked list implementation and good explanation

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

      Can u please paste the code from compiler.

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

    Mam...ur explanation is much better than my sir's explanation...but please provide notes I mean pdf of the coding part mam please . Thank you:)

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

    Mam I humbly request you to start a playlist on Java and python for beginners.
    I like the way to teach and I can connect the concept. There are very less educators in TH-cam who teach in whiteboard and give the feel of a classroom.

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

    hi mam, tq for helpping us .Mam data structure and algorithm i cant solve bcz its difficult for me but now im learning from ur videos

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

    thanks a lot mam for posting this informative video👍👍👍

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

    Thanks for your good explanation... Mam

  • @Roy-gj1ph
    @Roy-gj1ph 4 ปีที่แล้ว

    Ma'am if I insert nodes at the beginging only then how will I reach till the end of the list and assign the tail?I am trying to reverse a doubly linked list where I inserted nodes at the beginning only.

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

    Mam , your teaching is awesome but there is a mistake, i think while making linked list , you have to also give value to tail otherwise we can't use it in further operation.

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

    Ma'am can we use new and delete operators to allocate memory dynamically??

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

    Ma'am, you teach smoothly and the concepts tend to become clearer as you move forward. Best of works you are doing! But there are frequent ads in your videos, which create problem and disturb the flow.

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

      So trueee after watching each video one after the other, the concepts in previous videos are becoming more and more clearer, love how this playlist works

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

    Mam I have a question in create funtion we r initialising head=0 always the when ever we will call that function r head will have null value ?

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

    Can you make database tuning and query optimization video series?🙂

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

    Really mam your explanation is amazing

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

    In create function you have written head=0. It should be initialize globally??

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

    Ma'am when I am running the code in the output first and last data is not showing only middle data is showing.

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

    Ma'am aap sch me bahut accha pdhate ho i really like✨ your videos especially data structure . I m a bca 2 year student please give me some suggestions 😊

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

    mam upload some video related circular linked list and please arrange the playlist in which order we have to follow.

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

    mam will you please upload notes of each video or topic ..it will so helpful

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

    Mam.. once head ptr is declared globally it means it's intialized with null. Again need not to initialize to null in local functions

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

    Mam can we create newnode =malloc(sizeof(struct node)) since we have already declared *newnode as pointer

  • @NikhilKumar-gy8bb
    @NikhilKumar-gy8bb ปีที่แล้ว

    Thanks
    Real god of datastructure

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

    thanks a lot mam , you helped me alot.

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

    mam i think that head=0 below void create() shouldn't be there.

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

    Can u explain memory efficient DLL pls (single pointer one)

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

    Videos r too helpful ma'am

  • @KK-hd4wy
    @KK-hd4wy 11 หลายเดือนก่อน +22

    For anyone who need a code that runs--
    #include
    #include
    int main()
    {
    struct node
    {
    int data;
    struct node *next;
    struct node *prev;
    };
    struct node *head;
    struct node *newnode;
    struct node *temp;
    head=NULL;
    int choice=1;
    int count=0;
    while(choice)
    {
    newnode=(struct node*)malloc(sizeof(struct node));
    printf("Enter Data:
    ");
    scanf("%d",&newnode->data);
    newnode->next=0;
    newnode->prev=0;
    if(head==0)
    {
    head=temp=newnode;
    }
    else
    {
    temp->next=newnode;
    newnode->prev=temp;
    temp=newnode;
    }
    printf("Do you want to continue (0,1)?
    ");
    scanf("%d",&choice);
    }
    printf("--------------------------------
    ");
    temp=head;
    while(temp!=0)
    {
    printf("%d\t",temp->data);
    temp=temp->next;
    count++;
    }
    printf("
    Count=%d",count);
    return 0;
    }

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

      Thank you , this really helps as i got confused

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

      @@hunterxcobby GOOD code, bu u didn't free the memory !!???

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

      @@justcurious1940 I wrote a function that frees memory

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

      @@hunterxcobby Ok show me , and I will show u a nice trick. 🙂

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

      @@justcurious1940 this is it
      /* Function to free nodes in a doubly linked list*/
      void freeDll(struct Node *head)
      {
      struct Node *current = head;
      struct Node *nextNode;
      /* Traverse the list*/
      while (current != NULL)
      {
      /* Save the reference to the next node before freeing the current node*/
      nextNode = current->next;
      /* Free the current node*/
      free(current);
      /* Move to the next node*/
      current = nextNode;
      }
      }

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

    Mam I have a question that if in choice I am putting any value(not only one) except 0 then it will permit to add new node

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

    Coming here after paying a Udemy course which wasn't clear. This is much better, thank you.

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

    Pls make video on memory management

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

    I have suggestion you can initialize head = 0 outside function so if we need to call the function again, inside function become head = 0 and assigned to newnode and it loose all previous link we have only temp and newnode it can be recoverable even if we lose head by temp itself need traverse reverse to assign head but that complexity we can assign outside function head = 0 even temp also create at outside function if we need to reverse back to get head value

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

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

    }; //no memory allocated ,declaration only
    struct node*head;
    head=0;
    struct node*temp;
    int choice=1;
    while(choice){
    struct node*newnode=(struct node*) malloc(sizeof(struct node));
    printf(" enter the data");
    scanf("%d",&newnode->data);
    newnode->next=0;
    newnode->prev=0;
    if(head==0)
    {
    head=temp=newnode;


    }
    else{
    temp->next=newnode;
    newnode->prev=temp;
    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 .

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

    mam make video on skip list its insertion and deletion process

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

    amazing explanation ma'am !

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

    Mam love this your teching

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

    Simply awesome ❤

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

    madam instead of using while loop u directly stored the address of last node in temp but plz tell me when create function completes then automatically temp variable will be lost because u declared it within the create function so it becomes local. then next time when create() is called how temp will able to hold address of last node? i think it will not work until we declared temp globally

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

    Mam simply keeping" head->prev =0 in if condition is enough know" what is the need to keep on assingning it with 0

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

    temp is a local variable and will be deleted after the function call is over. So to insert 3rd node, I'm skeptical about this logic.

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

    Temp pointer should be decalred globally outside the function to preserve the value of temp else it would be deleted when the activation record of the function is deleted after completion of the function.

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

    Thank you ma'am for these lectures

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

    beauty with brain awsm teacher

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

    Very nice explained ma'am

  • @user-od6cr2cz5g
    @user-od6cr2cz5g ปีที่แล้ว

    We are understanding you lecture mam thanks mam

  • @RAJKAMAL-wv3uf
    @RAJKAMAL-wv3uf 3 ปีที่แล้ว

    miss the linked list node that you have created in this video
    is more or less inserting the elements at the end;

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

    Ma'am pls make a video on how can core atudents or rather any student can prepare for their placements.

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

    madam jo aap ne if condition likhi hai woh shayad thodi si galat nahi hai kya?? kyunki mujhe lagtaa hai jo apne head=temp=newnode kiya hai usemin phele keval head=newnode denge phir else condition mein alag se hum temp=head denge kyunki agar head null nahi hai toh kabhi head=temp=newnode hoga hi nahi aur agar hoga hi nahi toh else condition temp kabhi 1st node ko point hi nahi karega..... please check and clear my doubt

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

    ERROR.........
    ????
    ??/
    ??
    Jenny Mam you have written head=0 in void function so every time when you call the function then head will always be 0 , therefore if comdition would be follow each time .?????

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

    Mam all ur videos are very useful mam please do upload some algorithms also mam

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

    Thank You Mam

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

    Mam there is a mistake....@10:00...you can make head as Null in create fxn....bcz every time u call create it will intialize head as Null and if(Head==0) block will execute.... So it's wrong...

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

    Best teacher in the world 🌍🌍🌍🌍🎉🎉

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

    Doubly_node temp = head;

    public void reverselist() {
    while(temp.next != null) {

    temp = temp.next;
    }



    while(temp != null) { //if you write (temp != head) you will have the first node not printed because you will have you loop terminated when it comes to head node
    System.out.println(temp.str);
    temp= temp.prev;
    }
    }
    just traverse till the end and then traverse back to head while printing all the elements in the loop (i have taken data as string so it has temp.str )

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

    Mam shayad display function wrong hai.... Print nai hora hai

  • @suneethkumarpolaki3441
    @suneethkumarpolaki3441 11 ชั่วโมงที่ผ่านมา

    is type casting a void pointer is required or we just writing it for redability

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

    mam great👌 but algo java mn likhy plzzz 💕