Skip to content

Want to add Sorted Linked List to Data Structires #11768

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mjk22071998 opened this issue Oct 5, 2024 · 9 comments
Closed

Want to add Sorted Linked List to Data Structires #11768

mjk22071998 opened this issue Oct 5, 2024 · 9 comments
Labels
enhancement This PR modified some existing files

Comments

@mjk22071998
Copy link

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 mjk22071998 added the enhancement This PR modified some existing files label Oct 5, 2024
@AnuragSingh0000
Copy link

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

@mjk22071998
Copy link
Author

Yes this is complete

@mjk22071998 mjk22071998 changed the title Want to add sorted Linked List to Data Structires Want to add Sorted Linked List to Data Structires Oct 6, 2024
@roshankraveendrababu
Copy link

roshankraveendrababu commented Oct 6, 2024

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

@mjk22071998
Copy link
Author

I do not have permissions to assign this issue to anyone

@roshankraveendrababu
Copy link

I do not have permissions to assign this issue to anyone

so whom should i ask for assignation ..

@mjk22071998
Copy link
Author

Whoever is maintaining the repo

@onhgomat
Copy link

onhgomat commented Oct 7, 2024

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

@onhgomat
Copy link

onhgomat commented Oct 7, 2024

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()

@mjk22071998
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement This PR modified some existing files
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants
@mjk22071998 @AnuragSingh0000 @onhgomat @roshankraveendrababu and others