Python icon indicating copy to clipboard operation
Python copied to clipboard

Want to add Sorted Linked List to Data Structires

Open mjk22071998 opened this issue 1 year ago • 6 comments

Feature description

I want to add sorted linked list to the repo under data structures. I have opened a pull request #11607 Please review

mjk22071998 avatar Oct 05 '24 07:10 mjk22071998

@mjk22071998 Is this issue completed? If not I would like to add it. Please respond.

AnuragSingh0000 avatar Oct 05 '24 11:10 AnuragSingh0000

Yes this is complete

mjk22071998 avatar Oct 05 '24 12:10 mjk22071998

please assign this issue to me if it is in open. please respond to this message it will help me an long way in my professional devolopment

roshankraveendrababu avatar Oct 06 '24 14:10 roshankraveendrababu

I do not have permissions to assign this issue to anyone

mjk22071998 avatar Oct 06 '24 14:10 mjk22071998

I do not have permissions to assign this issue to anyone

so whom should i ask for assignation ..

roshankraveendrababu avatar Oct 06 '24 14:10 roshankraveendrababu

Whoever is maintaining the repo

mjk22071998 avatar Oct 06 '24 14:10 mjk22071998

Can I try this can you give me this opportunity I want it

onhgomat avatar Oct 07 '24 04:10 onhgomat

class Node: def init(self, data): self.data = data self.next = None

class SortedLinkedList: def init(self): self.head = None

def insert(self, data):
    if not self.head or data < self.head.data:
        new_node = Node(data)
        new_node.next = self.head
        self.head = new_node
    else:
        current = self.head
        while current.next and data > current.next.data:
            current = current.next
        new_node = Node(data)
        new_node.next = current.next
        current.next = new_node

def print_list(self):
    current = self.head
    while current:
        print(current.data, end=" ")
        current = current.next
    print()

onhgomat avatar Oct 07 '24 04:10 onhgomat

Guys Guys Guys calm down, I opened the issue after I opened a pull request you can see #11607. The purpose of opening the issue is to get attention of maintainers to review the pull request

mjk22071998 avatar Oct 07 '24 05:10 mjk22071998