pystlx 0.0.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
pystlx-0.0.1/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Prasad Raju G
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
pystlx-0.0.1/PKG-INFO ADDED
@@ -0,0 +1,13 @@
1
+ Metadata-Version: 2.4
2
+ Name: pystlx
3
+ Version: 0.0.1
4
+ Summary: Standard Template Library for Python
5
+ Author-email: Prasad Raju G <gls.prasadraju@gmail.com>
6
+ Requires-Python: >=3.14
7
+ Description-Content-Type: text/markdown
8
+ License-File: LICENSE
9
+ Dynamic: license-file
10
+
11
+ <div align="center">
12
+ <img src="logo.svg", width="55%">
13
+ </div>
pystlx-0.0.1/README.md ADDED
@@ -0,0 +1,3 @@
1
+ <div align="center">
2
+ <img src="logo.svg", width="55%">
3
+ </div>
@@ -0,0 +1,17 @@
1
+ [build-system]
2
+ requires = ["setuptools>=77"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "pystlx"
7
+ version = "0.0.1"
8
+ description = "Standard Template Library for Python"
9
+ readme = "README.md"
10
+ requires-python = ">=3.14"
11
+ authors = [
12
+ { name = "Prasad Raju G", email = "gls.prasadraju@gmail.com" }
13
+ ]
14
+ dependencies = []
15
+
16
+ [tool.setuptools.packages.find]
17
+ where = ["."]
File without changes
@@ -0,0 +1,72 @@
1
+ #!/usr/bin/env python3
2
+
3
+
4
+ class Node:
5
+ def __init__(self, data):
6
+ self.data = data
7
+ self.next_node = None
8
+
9
+
10
+ class LinkedList:
11
+ def __init__(self):
12
+ self.head = None
13
+ self.tail = None
14
+ self.len = 0
15
+
16
+ # O(1) with tail, without O(n)
17
+ def append(self, data):
18
+ new_node = Node(data)
19
+ if self.head == None:
20
+ self.head = new_node
21
+ self.tail = self.head
22
+ self.len += 1
23
+ return
24
+
25
+ self.tail.next_node = new_node
26
+ self.tail = new_node
27
+ self.len += 1
28
+ return
29
+
30
+ # O(n), no rebuild
31
+ def insertat(self, data, index):
32
+ if self.len < index:
33
+ raise IndexError("Index out of bound")
34
+
35
+ insert_node = Node(data)
36
+ index_node = self.head # start with head as base node
37
+
38
+ # TODO: handle insert at index 0 (head) - push(data)
39
+
40
+ # get just before node to index node (we can't look backwards)
41
+ for _ in range(index - 1):
42
+ index_node = index_node.next_node
43
+
44
+ tmp_node = index_node.next_node
45
+ index_node.next_node = insert_node
46
+ insert_node.next_node = tmp_node
47
+ self.len += 1
48
+
49
+ def push(self, data): pass # insertat first(head)
50
+ def lpop(self): pass # delete last
51
+ def fpop(self): pass # delete first
52
+ def deleteat(self, index): pass
53
+
54
+ def __str__(self):
55
+ ll_rep = str(self.head.data) # first node
56
+ start = self.head.next_node # next node
57
+
58
+ while(start != None):
59
+ ll_rep += f" -> {start.data}"
60
+ start = start.next_node
61
+ return ll_rep
62
+
63
+ if __name__ == "__main__":
64
+ ll = LinkedList()
65
+ for i in range(1, 11):
66
+ ll.append(i)
67
+ print(ll)
68
+ print(ll.len)
69
+
70
+ ll.insertat(9, 1)
71
+ print(ll)
72
+ print(ll.len)
File without changes
@@ -0,0 +1,13 @@
1
+ Metadata-Version: 2.4
2
+ Name: pystlx
3
+ Version: 0.0.1
4
+ Summary: Standard Template Library for Python
5
+ Author-email: Prasad Raju G <gls.prasadraju@gmail.com>
6
+ Requires-Python: >=3.14
7
+ Description-Content-Type: text/markdown
8
+ License-File: LICENSE
9
+ Dynamic: license-file
10
+
11
+ <div align="center">
12
+ <img src="logo.svg", width="55%">
13
+ </div>
@@ -0,0 +1,10 @@
1
+ LICENSE
2
+ README.md
3
+ pyproject.toml
4
+ pystlx.egg-info/PKG-INFO
5
+ pystlx.egg-info/SOURCES.txt
6
+ pystlx.egg-info/dependency_links.txt
7
+ pystlx.egg-info/top_level.txt
8
+ pystlx/linear/__init__.py
9
+ pystlx/linear/linked_list.py
10
+ pystlx/nonlinear/__init__.py
@@ -0,0 +1,2 @@
1
+ dist
2
+ pystlx
pystlx-0.0.1/setup.cfg ADDED
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+