{"id":15009939,"url":"https://github.com/gsauc3/gsauce-pyds","last_synced_at":"2025-10-08T18:28:14.381Z","repository":{"id":62568812,"uuid":"408969210","full_name":"GSAUC3/Gsauce-pyds","owner":"GSAUC3","description":"Advanced-Data Structures for python","archived":false,"fork":false,"pushed_at":"2023-05-20T05:21:23.000Z","size":65,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-20T22:08:43.091Z","etag":null,"topics":["circular-linked-list","data-structures","doubly-circular-linked-list","doubly-linked-list","doublylinkedlist","linked-list","python","python-3","python-library","queue","stack"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GSAUC3.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-09-21T20:45:55.000Z","updated_at":"2023-01-09T16:55:06.000Z","dependencies_parsed_at":"2024-11-24T23:03:59.267Z","dependency_job_id":null,"html_url":"https://github.com/GSAUC3/Gsauce-pyds","commit_stats":{"total_commits":61,"total_committers":1,"mean_commits":61.0,"dds":0.0,"last_synced_commit":"118d157b2dc47d71f765223520e2f96cb936cd2f"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GSAUC3%2FGsauce-pyds","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GSAUC3%2FGsauce-pyds/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GSAUC3%2FGsauce-pyds/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GSAUC3%2FGsauce-pyds/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GSAUC3","download_url":"https://codeload.github.com/GSAUC3/Gsauce-pyds/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235515427,"owners_count":19002481,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["circular-linked-list","data-structures","doubly-circular-linked-list","doubly-linked-list","doublylinkedlist","linked-list","python","python-3","python-library","queue","stack"],"created_at":"2024-09-24T19:29:12.172Z","updated_at":"2025-10-06T09:31:07.978Z","avatar_url":"https://github.com/GSAUC3.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Data Structures for python\n\n## Installation\nLatest Version : 1.0.0\npython version needed: `\u003e= 3.9`\n\n```\npip install Gsauce-pyds\n```\n# Data Structures Implemented so far\nLinked List | Doubly linked list | Stacks | Queue | dequeue\n\n\n## Linked List\n```python\nfrom dstructure.linkedlist import LinkedList\nl = LinkedList(range(8))\nprint(l)\n# LinkedList([0, 1, 2, 3, 4, 5, 6, 7])\n\nl.append('last')\nprint(l)\n# LinkedList([0, 1, 2, 3, 4, 5, 6, 7, last])\n\nprint(len(l))\n#9\n\nprint(l[0],l[5],l[8])\n# Node(data = 0) Node(data = 5) Node(data = last)\n\nprint(l.head,l.tail)\n# Node(data = 0) Node(data = last)\n\nl[8]=8\nprint(l)\n# LinkedList([0, 1, 2, 3, 4, 5, 6, 7, 8])\n\nl.reverse()\nprint(l,'head: ',l.head,'tail: ',l.tail,sep='\\n')\n# LinkedList([8, 7, 6, 5, 4, 3, 2, 1, 0])\n# head: \n# Node(data = 8)\n# tail: \n# Node(data = 0)\n\nprint(l[:3],l[3:])\n# LinkedList([8, 7, 6]) LinkedList([5, 4, 3, 2, 1, 0])\n\nl.insert(0,'zero')\nl.insert(3,'three')\nprint(l,len(l),l.head,l.tail,sep='\\n')\n# LinkedList([zero, 8, 7, three, 6, 5, 4, 3, 2, 1, 0])\n# 11\n# Node(data = zero)\n# Node(data = 0)\n\nl.remove(0)\nl.remove(3)\nprint(l,l.head,l.tail,sep='\\n')\n# LinkedList([8, 7, three, 5, 4, 3, 2, 1, 0])\n# Node(data = 8)\n# Node(data = 0)\n\na = LinkedList('a b c'.split())\nprint(a)\na + l  # concatenation will overwrite the original list, in this case it's a\nprint(a)\n# LinkedList([a, b, c])\n# LinkedList([a, b, c, 8, 7, three, 5, 4, 3, 2, 1, 0])\n\n\nprint(len(a))\na.pop()\na.pop()\nprint(len(a))\n# 12\n# 10\n```\n\n`NOTE: to get the data of any LinkedList and DoublyLinkedList nodes use .data attribute | ex: l.head.data will return the actual value`\n  \n## Doubly Linked List\n\n```python\nfrom dstructure.linkedlist import DoublyLinkedList\n\nl = DoublyLinkedList(range(4))\nprint(l)\n# DLList([0 1 2 3])\n\nl.append(4)\nprint(l,len(l))\n# DLList([0 1 2 3 4]) 5\n\nl.pop()\nprint(l)\n# DLList([0 1 2 3])\n\nprint(l.head,l[0],l.tail,l[3],sep='\\t')\n# Node(data = 0)\tNode(data = 0)\tNode(data = 3)\tNode(data = 3)\n\nl.reverse()\nprint(l.head,l[0],l.tail,l[3],sep='\\t')\n# Node(data = 3)\tNode(data = 3)\tNode(data = 0)\tNode(data = 0)\n\nprint(l.head.next,l.tail.prev)\n# Node(data = 2) Node(data = 1)\n\nprint(l)\nl[2]='two'\nprint(l)\n# DLList([3 2 1 0])\n# DLList([3 2 two 0])\n\nprint(l[:2],l[2:])\n# DLList([3 2]) DLList([two 0])\n\n```\n## Stack\n```python\nfrom dstructure.stack import Stack2\n\ns = Stack2(range(3))\nprint(s,len(s))\n# Stack([0,1,2]) 3\n\ns.push(3)\ns.push(5)\nprint(s,len(s))\n# Stack([0,1,2,3,5]) 5\n\n\ns.pop()\nprint(s,len(s))\n# Stack([0,1,2,3]) 4\n\nprint(s.peek)\n# 3\n```\n\n## Queue\n```python\nfrom dstructure.queues import Queue\n\ns = Queue(range(4))\nprint(s,len(s))\n# Queue([0,1,2,3]) 4\n\ns.enqueue('back')\ns.enqueue('to back')\nprint(s,len(s))\n# Queue([0,1,2,3,back,to back]) 6\n\ns.dequeue()\nprint(s,len(s))\n# Queue([1,2,3,back,to back]) 5\n\nprint(s.isempty)\n# False\n\nfor _ in range(len(s)):\n    s.dequeue()\nprint(s.isempty,len(s),s)\n# True 0 Queue([])\n```\n## Dequeue \n```python\n\nfrom dstructure.queues import Dequeue\n\ns = Dequeue(range(4))\nprint(s,len(s))\n# Dequeue([0,1,2,3]) 4\n\ns.appendback('back')\ns.appendfront('front')\nprint(s,len(s))\n# Dequeue([front,0,1,2,3,back]) 6\n\ns.popback()\ns.popfront()\nprint(s,len(s))\n# Dequeue([0,1,2,3]) 4\n\nprint(s.isempty)\nfor _ in range(len(s)):\n    s.popback()\nprint(s.isempty,s,len(s))\n\n# False\n# True Dequeue([]) 0\n```\n\n\n## License\n\n© 2021 Rajarshi Banerjee\n\nThis repository is licensed under the MIT license. See Licence for details.\n\n## Link to package\n\n\u003ca href=\"https://pypi.org/project/Gsauce-pyds/\"\u003e pypi site \u003c/a\u003e\n\n***\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgsauc3%2Fgsauce-pyds","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgsauc3%2Fgsauce-pyds","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgsauc3%2Fgsauce-pyds/lists"}