Doubly Linked List | Program | Insertion Operation | Part 2 | Data Structures

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

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

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

    I was searching for python basics and i found u just like the way i wanted to be. Thanks nd keep going

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

      Happy to hear that! :)

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

      @@AmulsAcademy it's euphonious the way you explains it.thnx

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

    Oooo God a lot to know a lot to learn from this wonderful channel.

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

    Your videos are great as well as you voice and your explanation. So nice

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

    Great teacher .I like the way explains and iam an fan of her teaching.... Thanks for the great eplain...❤❤❤❤❤❤

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

    mam we can use add begin or end method instead of add before or after the first or last node insertion!? it's more easy and not confused

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

    Nice Work ❤

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

    good work

  • @RohitSingh-ko2cz
    @RohitSingh-ko2cz 2 ปีที่แล้ว +1

    i am adding node before last node and getting issue, last 2 node printing infinte time. its working fine if i am adding before any other node
    def add_node_before_given_Node(self,data,x):
    ob1 = Create_Node(data)
    if self.head is None:
    print("LL is Empty")
    elif self.head.data is x:
    ob1.nref = self.head
    self.head.pref = ob1
    self.head = ob1
    else:
    n = self.head
    while n is not None: # we not take n.nref in while loop becz if we take the it will not go in last node
    if n.data is x:
    ob1.pref = n.pref
    ob1.nref = n
    n.pref.nref = ob1
    n.pref = ob1
    return #exit from function
    n= n.nref
    print("Given node is not present in LL")

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

    Gud morning ma'am and nice video explaination😁

  • @aravindboniy-t5505
    @aravindboniy-t5505 4 ปีที่แล้ว +5

    First comment but can't see video
    Due to our mid examination's
    All the best for 100k subscriber's soon 😘
    😁👍🏻

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

      Thank you but don't do that, watch videos if you like them then only hit like button :)

    • @aravindboniy-t5505
      @aravindboniy-t5505 4 ปีที่แล้ว +1

      @@AmulsAcademy with Guts👍🏻
      Tnq 😁
      Mam

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

    Mam in add_before method can we use
    New_node.nref=n.pref.nref
    Instead of giving
    New_node=n
    But it gives attribute error,could you please tell me abt this..!

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

    Man please make videos on AI&ML

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

    Mam pls put more videos for c programming

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

    Can you please let me know which data structures is used to implement other data structures ?
    Like we use linked list to implement stack and que .... am right ?
    Then what about other data structures ? Which data structures do we need to implement other DS ?

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

      Yes we can use linked list to implement stack queue tree etc :)

  • @Ak-security
    @Ak-security 2 ปีที่แล้ว

    Add before method 2nd is not working it struck in infinitely loop and keep printing the entering node value.

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

    Ma'am your videos are great......how can i contact you for doubts?

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

      Thank you 😊
      You can contact me here or Facebook page : amuls academy 😊

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

    Ma'am your video is too good ❤️for python programmer
    Ma'am please upload also tree graph related videos in python

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

      Will upload soon :)

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

      @@AmulsAcademy nice

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

    👍

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

    ❤️

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

    thank you ma'am!

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

    class Node:
    def __init__(self, data):
    self.data = data
    self.prev = None
    self.next = None
    class DLinkedList:
    def __init__(self):
    self.head = None
    self.count = 0
    def insert(self, data):
    node = Node(data)
    if self.head is None:
    self.head = node
    else:
    self.head.prev = node
    node.next = self.head
    self.head = node
    self.count +=1
    def insert_at(self, data: any, index:int):
    if index==0:
    self.insert(data)
    elif index == self.count:
    self.append(data)
    elif index < self.count:
    n = self.head
    i = 0
    while n.next is not None:
    if (index-1) == i:
    node = Node(data)
    n.next.prev = node
    node.next = n.next
    n.next = node
    self.count += 1
    n = n.next
    i+=1
    else:
    print("Can not insert at this position")
    def append(self, data):
    node = Node(data)
    if self.head is None:
    self.head = node
    else:
    n = self.head
    while n.next is not None:
    n = n.next
    n.next = node
    node.prev = n
    self.count += 1
    def view_list(self)->str:
    string = "["
    n = self.head
    while n is not None:
    string += f"{n.data}, "
    n = n.next
    return string[:-2] + "]"
    def at_index(self, index:int)->any:
    n = self.head
    i = 0
    while n is not None:
    if index == i:
    return n.data
    n = n.next
    i+=1
    def remove(self):
    n = self.head
    while n.next is not None:
    n = n.next
    n.prev.next = None
    self.count -= 1
    def remove_at(self, index: int):
    n = self.head
    i = 0
    if index == 0:
    self.head.next.prev = None
    self.head = self.head.next
    elif index == (self.count-1):
    self.remove()
    elif index >= self.count:
    print("Index out of reach")
    else:
    while n.next is not None:
    if index == i:
    n.prev.next = n.next
    n.next.prev = n.prev
    self.count -=1
    n = n.next
    i+=1
    dlist = DLinkedList()
    dlist.append(5)
    dlist.append(10)
    dlist.append(11)
    dlist.insert(2)
    dlist.insert_at(7,4)
    print(dlist.view_list())
    dlist.remove_at(5)
    print(dlist.view_list())
    print(dlist.count)
    print(dlist.at_index(3))

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

    Are u telugu speaking or hindi?☺️

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

      Kannada 😊

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

      @@AmulsAcademy unexpected 😀 anyways nice... you're ds course is so underrated

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

    Can you teach python in tamil..?

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

      No, i don't know Tamil :)

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

      @@AmulsAcademy tamil very very simple just try to learn free time

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

      Mam are you from Telugu or kannada