Inserting/Adding Elements Before The Given Node in The Linked List | Python Program

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

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

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

    This is a very high quality playlist to learn Data structures in python!!!!!!!!!! superb👏👏👏

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

    I don’t know how much to thank you Ma’am. I was struggling before to understand DSA but r now with your well detailed explanation, I’m catching up. You’re the best! 😂😂 You’ve got also a fantastic voice😂😂.

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

    Your voice so cute Sister,It is like some Melody,
    Im a beginner of Python i trying to understand Data Structure,Most of other Tutorials They teach for advanced students,You only teach the Data Structure for Begginner we Love You Teaching Sister Keep Going

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

    Thank you🥺❤
    I can't find better explanation then this. Keep educating us.

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

    I like the way you teach even I'm able to understand these concepts, initially i thought it would be difficult for me but now i'm able to understand DS thank you

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

    U r osmm🙏🙏🙏🙏💘 really i tried to understand from many channels but stills didn't understand anything but u made it simple for me..... 💗💗💗

  • @snex-techprogrammer5110
    @snex-techprogrammer5110 2 ปีที่แล้ว +1

    Top notch level of explanation....Thanks for this great content for free

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

    Wonder woman of DSA love your voice and explanation.

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

    Mam.. 🤩 really u explained well, u teach from basic, keep it up mam

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

    It is impossible to explain better than this❤️❤️❤️

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

    you are really great mam and your voice too......
    The way you are explaining is great, clear..!!!!!
    I feel very happy after watching your video. Thank you so much mam. Do continue!!.Its my hearty request.

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

    Great Conceptual Learning in an easy Manner.
    Thankyou so much Mam.

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

    while True:
    print("❤❤❤❤❤East or West Amulya ma'am is the best!❤❤❤❤❤")

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

    Thank you sooooo much, ma'am. If you wasn't there my ds was not going to get started

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

    Thankyou mam You cleared me the concepts which no'one could.

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

    very awesome explanation......Thank You

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

    def insert_before(self,data,x):
    n = self.head
    while n.next.data!=x:
    n = n.next
    if n.next==None:
    print(x,"is not in the list")
    return
    self.insert_after(data,n.data)
    This code works for inserting data before an element.simple!

  • @TarunKumar-hv6jk
    @TarunKumar-hv6jk ปีที่แล้ว +1

    Where can i practice DS problems from basic

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

    You are the best !

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

    Excellent tutorial mam. Small suggestion: Would it be possible to maintain a Git repo for all your code and paste the link to it here.

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

    Thank you so much!

  • @sm-df6ft
    @sm-df6ft 3 ปีที่แล้ว +1

    Explaination is too good
    I really understand the concept but ,i have a question do we need to create node class and linkedlist class for head on every time for evy operation of linked list like reverse or find middle element

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

      No while adding new nodes you need to create new node for that you need to use Node class :)

    • @sm-df6ft
      @sm-df6ft 3 ปีที่แล้ว

      @@AmulsAcademy thanks maam

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

    Thank you mam 😊
    Ur teaching is best than our lectures, as I'm a beginner, I'm trying to improve my logics but I don't know what to do ?
    Can u give any suggestions from ur side mam?

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

      Thank you :)
      Practice programs try to write your own version of program for a problem :)

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

    At time stamp 6:03 Cant, we call the add_begin function in add_after function when x is the head data instead of copying the code again. I tried this but showed an error so please explain how to call a method in another method of the same class in python.

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

    Hi amulya, Thanks for the wonderful session on adding element before a NODE.
    But as I am executing the code provided by you its showing an Error as " Linked list object has no attribute head".

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

      In the Linked List class you need initialise head ... Watch the video completely :)

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

      @@AmulsAcademy 🤣😂

  • @Kavya-d8l
    @Kavya-d8l 6 หลายเดือนก่อน

    Can you clarify me the difference between 'while n is None' and 'while n.ref is None' . How these two conditions works in different way!

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

    can you cover the advanced topics..??

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

    I have a doubt that why u used return in second if block in add_before method???

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

      If the condition of if block is true , after executing its body I want to stop the execution of the function 😊

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

      @@AmulsAcademy thankyou!!!! Much

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

    Can't we call directly the add_begin fn inside the add_before instead of copying the code from it?

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

    Please recommend me a book for dsa using python

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

    At the condition first node ==x
    Why didn't you used n instead u used self. Head
    Iam not getting answer for using n

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

      I am referring first node and we can access first node data using self.head.data also.
      if you want you can use n also.
      :)

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

    600th like

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

    Anyone explain? Why I can't use while n is not None , but n.ref? Can't I just use while n is not None and if n is None?

  • @AliKhan-rr6kz
    @AliKhan-rr6kz 3 ปีที่แล้ว

    while n.ref is not None:
    if n.ref.data ==x:
    new_node.ref = n.ref
    n.ref=new_node
    break
    n=n.ref
    why we need to add break in the loop here,if i remove break while loop is running continuously .i dont get it, loop should end after the last node right?
    where last node ref is none then loops terminates.can anyone help plz.

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

    mam don't know why but code is showing run time error
    def add_before(self,data,x):
    if self.head is None:
    print("
    Linked List is empty")
    return
    if self.head.data==x:
    new_node=Node(data)
    new_node.ref=self.head
    self.head=new_node
    print("
    Node inserted successfully
    ")
    return
    n=self.head
    while n.ref is not None:
    if n.ref.data==x:
    break
    n=n.ref
    if n.ref is None:
    print("Node is not present in the Linked List")
    else:
    new_node=Node(data)
    new_node.ref=n.ref
    n.ref=new_node
    print("
    Node inserted successfully
    ")
    return
    this is my code..and while I am trying to insert a node at the starting position it is showing that "Node is not present in the Linked List" . Please help me on this

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

    👍

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

    Please provide notes mam WE CAN REFER

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

    if any one has wrote this data structrures notes or anybody has all the notes written.. if Yes please send me

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

    It's not inserting the element before the given node(x). It is inserting only if the x value equals to the first node. Please help me Ma'am. I have written the same code as you.🥲

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

      You pasted the another else:
      Just watch the video and write as ma'am has written.
      I'm telling you because this happens with me also.
      Don't worry just write as ma'am did 😊