pkstruct 0.1.2__tar.gz → 0.1.3__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.
- {pkstruct-0.1.2 → pkstruct-0.1.3}/CHANGELOG.md +7 -0
- {pkstruct-0.1.2 → pkstruct-0.1.3}/MANIFEST.in +0 -3
- {pkstruct-0.1.2 → pkstruct-0.1.3}/PKG-INFO +21 -32
- {pkstruct-0.1.2 → pkstruct-0.1.3}/README.md +718 -727
- {pkstruct-0.1.2 → pkstruct-0.1.3}/pyproject.toml +2 -4
- {pkstruct-0.1.2 → pkstruct-0.1.3}/src/pkstruct/__init__.py +2 -2
- pkstruct-0.1.2/.github/ISSUE_TEMPLATE/bug_report.md +0 -46
- pkstruct-0.1.2/.github/ISSUE_TEMPLATE/config.yml +0 -8
- pkstruct-0.1.2/.github/ISSUE_TEMPLATE/feature_request.md +0 -37
- pkstruct-0.1.2/.github/pull_request_template.md +0 -29
- pkstruct-0.1.2/CODE_OF_CONDUCT.md +0 -113
- pkstruct-0.1.2/CONTRIBUTING.md +0 -133
- pkstruct-0.1.2/MAINTAINERS.md +0 -62
- pkstruct-0.1.2/SECURITY.md +0 -20
- {pkstruct-0.1.2 → pkstruct-0.1.3}/.gitignore +0 -0
- {pkstruct-0.1.2 → pkstruct-0.1.3}/LICENSE +0 -0
- {pkstruct-0.1.2 → pkstruct-0.1.3}/src/pkstruct/_display.py +0 -0
- {pkstruct-0.1.2 → pkstruct-0.1.3}/src/pkstruct/_help.py +0 -0
- {pkstruct-0.1.2 → pkstruct-0.1.3}/src/pkstruct/_linear_shortcuts.py +0 -0
- {pkstruct-0.1.2 → pkstruct-0.1.3}/src/pkstruct/_str.py +0 -0
- {pkstruct-0.1.2 → pkstruct-0.1.3}/src/pkstruct/_tree_shortcuts.py +0 -0
- {pkstruct-0.1.2 → pkstruct-0.1.3}/src/pkstruct/graphs/__init__.py +0 -0
- {pkstruct-0.1.2 → pkstruct-0.1.3}/src/pkstruct/graphs/connectivity.py +0 -0
- {pkstruct-0.1.2 → pkstruct-0.1.3}/src/pkstruct/graphs/directed.py +0 -0
- {pkstruct-0.1.2 → pkstruct-0.1.3}/src/pkstruct/graphs/exceptions.py +0 -0
- {pkstruct-0.1.2 → pkstruct-0.1.3}/src/pkstruct/graphs/graph.py +0 -0
- {pkstruct-0.1.2 → pkstruct-0.1.3}/src/pkstruct/graphs/mst.py +0 -0
- {pkstruct-0.1.2 → pkstruct-0.1.3}/src/pkstruct/graphs/scc.py +0 -0
- {pkstruct-0.1.2 → pkstruct-0.1.3}/src/pkstruct/graphs/shortest_path.py +0 -0
- {pkstruct-0.1.2 → pkstruct-0.1.3}/src/pkstruct/graphs/tests/__init__.py +0 -0
- {pkstruct-0.1.2 → pkstruct-0.1.3}/src/pkstruct/graphs/tests/test_graph.py +0 -0
- {pkstruct-0.1.2 → pkstruct-0.1.3}/src/pkstruct/graphs/tests/test_graph_advanced.py +0 -0
- {pkstruct-0.1.2 → pkstruct-0.1.3}/src/pkstruct/graphs/topo_sort.py +0 -0
- {pkstruct-0.1.2 → pkstruct-0.1.3}/src/pkstruct/graphs/traversal.py +0 -0
- {pkstruct-0.1.2 → pkstruct-0.1.3}/src/pkstruct/graphs/visualization.py +0 -0
- {pkstruct-0.1.2 → pkstruct-0.1.3}/src/pkstruct/graphs/weighted.py +0 -0
- {pkstruct-0.1.2 → pkstruct-0.1.3}/src/pkstruct/linear/__init__.py +0 -0
- {pkstruct-0.1.2 → pkstruct-0.1.3}/src/pkstruct/linear/deques/__init__.py +0 -0
- {pkstruct-0.1.2 → pkstruct-0.1.3}/src/pkstruct/linear/deques/deque.py +0 -0
- {pkstruct-0.1.2 → pkstruct-0.1.3}/src/pkstruct/linear/deques/linked_deque.py +0 -0
- {pkstruct-0.1.2 → pkstruct-0.1.3}/src/pkstruct/linear/exceptions.py +0 -0
- {pkstruct-0.1.2 → pkstruct-0.1.3}/src/pkstruct/linear/linked_lists/__init__.py +0 -0
- {pkstruct-0.1.2 → pkstruct-0.1.3}/src/pkstruct/linear/linked_lists/_base.py +0 -0
- {pkstruct-0.1.2 → pkstruct-0.1.3}/src/pkstruct/linear/linked_lists/circular_linked_list.py +0 -0
- {pkstruct-0.1.2 → pkstruct-0.1.3}/src/pkstruct/linear/linked_lists/doubly_linked_list.py +0 -0
- {pkstruct-0.1.2 → pkstruct-0.1.3}/src/pkstruct/linear/linked_lists/nodes.py +0 -0
- {pkstruct-0.1.2 → pkstruct-0.1.3}/src/pkstruct/linear/linked_lists/singly_linked_list.py +0 -0
- {pkstruct-0.1.2 → pkstruct-0.1.3}/src/pkstruct/linear/queues/__init__.py +0 -0
- {pkstruct-0.1.2 → pkstruct-0.1.3}/src/pkstruct/linear/queues/circular_queue.py +0 -0
- {pkstruct-0.1.2 → pkstruct-0.1.3}/src/pkstruct/linear/queues/linked_queue.py +0 -0
- {pkstruct-0.1.2 → pkstruct-0.1.3}/src/pkstruct/linear/queues/priority_queue.py +0 -0
- {pkstruct-0.1.2 → pkstruct-0.1.3}/src/pkstruct/linear/queues/queue.py +0 -0
- {pkstruct-0.1.2 → pkstruct-0.1.3}/src/pkstruct/linear/stacks/__init__.py +0 -0
- {pkstruct-0.1.2 → pkstruct-0.1.3}/src/pkstruct/linear/stacks/array_stack.py +0 -0
- {pkstruct-0.1.2 → pkstruct-0.1.3}/src/pkstruct/linear/stacks/linked_stack.py +0 -0
- {pkstruct-0.1.2 → pkstruct-0.1.3}/src/pkstruct/linear/stacks/stack.py +0 -0
- {pkstruct-0.1.2 → pkstruct-0.1.3}/src/pkstruct/linear/tests/__init__.py +0 -0
- {pkstruct-0.1.2 → pkstruct-0.1.3}/src/pkstruct/linear/tests/test_edge_cases.py +0 -0
- {pkstruct-0.1.2 → pkstruct-0.1.3}/src/pkstruct/linear/tests/test_linked_list.py +0 -0
- {pkstruct-0.1.2 → pkstruct-0.1.3}/src/pkstruct/linear/tests/test_visualization.py +0 -0
- {pkstruct-0.1.2 → pkstruct-0.1.3}/src/pkstruct/linear/utils/__init__.py +0 -0
- {pkstruct-0.1.2 → pkstruct-0.1.3}/src/pkstruct/linear/utils/benchmark.py +0 -0
- {pkstruct-0.1.2 → pkstruct-0.1.3}/src/pkstruct/linear/utils/debug_tools.py +0 -0
- {pkstruct-0.1.2 → pkstruct-0.1.3}/src/pkstruct/linear/utils/helpers.py +0 -0
- {pkstruct-0.1.2 → pkstruct-0.1.3}/src/pkstruct/linear/utils/iterators.py +0 -0
- {pkstruct-0.1.2 → pkstruct-0.1.3}/src/pkstruct/linear/visualization/__init__.py +0 -0
- {pkstruct-0.1.2 → pkstruct-0.1.3}/src/pkstruct/linear/visualization/ascii_visualizer.py +0 -0
- {pkstruct-0.1.2 → pkstruct-0.1.3}/src/pkstruct/linear/visualization/linked_list_visualizer.py +0 -0
- {pkstruct-0.1.2 → pkstruct-0.1.3}/src/pkstruct/py.typed +0 -0
- {pkstruct-0.1.2 → pkstruct-0.1.3}/src/pkstruct/shared/__init__.py +0 -0
- {pkstruct-0.1.2 → pkstruct-0.1.3}/src/pkstruct/shared/benchmarking/__init__.py +0 -0
- {pkstruct-0.1.2 → pkstruct-0.1.3}/src/pkstruct/shared/debugging/__init__.py +0 -0
- {pkstruct-0.1.2 → pkstruct-0.1.3}/src/pkstruct/shared/exceptions/__init__.py +0 -0
- {pkstruct-0.1.2 → pkstruct-0.1.3}/src/pkstruct/shared/serializers/__init__.py +0 -0
- {pkstruct-0.1.2 → pkstruct-0.1.3}/src/pkstruct/shared/threading/__init__.py +0 -0
- {pkstruct-0.1.2 → pkstruct-0.1.3}/src/pkstruct/shared/validators/__init__.py +0 -0
- {pkstruct-0.1.2 → pkstruct-0.1.3}/src/pkstruct/shared/visualization/__init__.py +0 -0
- {pkstruct-0.1.2 → pkstruct-0.1.3}/src/pkstruct/trees/__init__.py +0 -0
- {pkstruct-0.1.2 → pkstruct-0.1.3}/src/pkstruct/trees/avl.py +0 -0
- {pkstruct-0.1.2 → pkstruct-0.1.3}/src/pkstruct/trees/balancing.py +0 -0
- {pkstruct-0.1.2 → pkstruct-0.1.3}/src/pkstruct/trees/bplus.py +0 -0
- {pkstruct-0.1.2 → pkstruct-0.1.3}/src/pkstruct/trees/bst.py +0 -0
- {pkstruct-0.1.2 → pkstruct-0.1.3}/src/pkstruct/trees/btree.py +0 -0
- {pkstruct-0.1.2 → pkstruct-0.1.3}/src/pkstruct/trees/exceptions.py +0 -0
- {pkstruct-0.1.2 → pkstruct-0.1.3}/src/pkstruct/trees/fenwick_tree.py +0 -0
- {pkstruct-0.1.2 → pkstruct-0.1.3}/src/pkstruct/trees/interval_tree.py +0 -0
- {pkstruct-0.1.2 → pkstruct-0.1.3}/src/pkstruct/trees/node.py +0 -0
- {pkstruct-0.1.2 → pkstruct-0.1.3}/src/pkstruct/trees/red_black.py +0 -0
- {pkstruct-0.1.2 → pkstruct-0.1.3}/src/pkstruct/trees/segment_tree.py +0 -0
- {pkstruct-0.1.2 → pkstruct-0.1.3}/src/pkstruct/trees/tests/__init__.py +0 -0
- {pkstruct-0.1.2 → pkstruct-0.1.3}/src/pkstruct/trees/tests/test_avl.py +0 -0
- {pkstruct-0.1.2 → pkstruct-0.1.3}/src/pkstruct/trees/tests/test_bplus.py +0 -0
- {pkstruct-0.1.2 → pkstruct-0.1.3}/src/pkstruct/trees/tests/test_bst.py +0 -0
- {pkstruct-0.1.2 → pkstruct-0.1.3}/src/pkstruct/trees/tests/test_btree.py +0 -0
- {pkstruct-0.1.2 → pkstruct-0.1.3}/src/pkstruct/trees/tests/test_fenwick_tree.py +0 -0
- {pkstruct-0.1.2 → pkstruct-0.1.3}/src/pkstruct/trees/tests/test_interval_tree.py +0 -0
- {pkstruct-0.1.2 → pkstruct-0.1.3}/src/pkstruct/trees/tests/test_red_black.py +0 -0
- {pkstruct-0.1.2 → pkstruct-0.1.3}/src/pkstruct/trees/tests/test_segment_tree.py +0 -0
- {pkstruct-0.1.2 → pkstruct-0.1.3}/src/pkstruct/trees/traversal.py +0 -0
- {pkstruct-0.1.2 → pkstruct-0.1.3}/src/pkstruct/trees/tree_helpers.py +0 -0
- {pkstruct-0.1.2 → pkstruct-0.1.3}/src/pkstruct/trees/utils/__init__.py +0 -0
- {pkstruct-0.1.2 → pkstruct-0.1.3}/src/pkstruct/trees/utils/complexity_helpers.py +0 -0
- {pkstruct-0.1.2 → pkstruct-0.1.3}/src/pkstruct/trees/visualization/__init__.py +0 -0
- {pkstruct-0.1.2 → pkstruct-0.1.3}/src/pkstruct/trees/visualization/ascii_renderer.py +0 -0
- {pkstruct-0.1.2 → pkstruct-0.1.3}/src/pkstruct/trees/visualization/tree_printer.py +0 -0
|
@@ -5,6 +5,13 @@ All notable changes to pkstruct will be documented in this file.
|
|
|
5
5
|
The format follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.1.3] - 2026-06-16
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
- README PriorityQueue examples corrected: `push()`/`pop()` → `enqueue()`/`dequeue()`
|
|
12
|
+
- README BST traversal examples corrected: use `pkstruct.trees.traversal` module, `zigzag` → `zigzag_order`
|
|
13
|
+
- `__version__` bumped to 0.1.3
|
|
14
|
+
|
|
8
15
|
## [0.1.2] - 2026-06-16
|
|
9
16
|
|
|
10
17
|
### Added
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pkstruct
|
|
3
|
-
Version: 0.1.
|
|
4
|
-
Summary: A production-grade
|
|
3
|
+
Version: 0.1.3
|
|
4
|
+
Summary: A production-grade Python library providing comprehensive data structures and algorithms with type hints, thread safety, and extensive testing
|
|
5
5
|
Project-URL: Homepage, https://github.com/prnvvv/pkstruct
|
|
6
6
|
Project-URL: Repository, https://github.com/prnvvv/pkstruct
|
|
7
7
|
Project-URL: Documentation, https://github.com/prnvvv/pkstruct#readme
|
|
8
|
-
Project-URL: Bug Tracker, https://github.com/prnvvv/pkstruct/issues
|
|
9
|
-
Author: pkstruct Contributors
|
|
10
8
|
Author-email: Prannavakhanth <prannavakhanth12@gmail.com>, Priyanka Kaliraj <pri2303k@gmail.com>
|
|
11
9
|
License: MIT License
|
|
12
10
|
|
|
@@ -63,7 +61,7 @@ Description-Content-Type: text/markdown
|
|
|
63
61
|
|
|
64
62
|
# pkstruct
|
|
65
63
|
|
|
66
|
-
**A production-grade
|
|
64
|
+
**A production-grade Python library providing comprehensive data structures and algorithms with type hints, thread safety, and extensive testing.**
|
|
67
65
|
|
|
68
66
|
[](https://pypi.org/project/pkstruct/)
|
|
69
67
|
[](https://pypi.org/project/pkstruct/)
|
|
@@ -81,7 +79,7 @@ Description-Content-Type: text/markdown
|
|
|
81
79
|
| Need | pkstruct gives you |
|
|
82
80
|
|------|-------------------|
|
|
83
81
|
| **Interview prep** | Linked lists, trees, graphs with LeetCode-style helpers (palindrome, cycle detection, LCA, topological sort, etc.) |
|
|
84
|
-
| **Production code** | Thread-safe structures (`threading.RLock`), strict type hints,
|
|
82
|
+
| **Production code** | Thread-safe structures (`threading.RLock`), strict type hints, 899+ tests |
|
|
85
83
|
| **Learning DSA** | Consistent API across all structures, built-in ASCII visualization, runtime help system |
|
|
86
84
|
| **Competitive programming** | Drop-in collection of trees (BST, AVL, Red-Black, Fenwick, Segment, Interval) and graph algorithms (Dijkstra, Kruskal, Tarjan, etc.) |
|
|
87
85
|
|
|
@@ -301,7 +299,7 @@ ArrayStack().daily_temperatures([73, 74, 75]) # [1, 1, 0]
|
|
|
301
299
|
q = LinkedQueue([1, 2, 3])
|
|
302
300
|
q.enqueue(4)
|
|
303
301
|
q.dequeue() # 1
|
|
304
|
-
q.
|
|
302
|
+
q.front() # 2
|
|
305
303
|
|
|
306
304
|
# LeetCode extras
|
|
307
305
|
LinkedQueue().sliding_window_maximum([1,3,-1,-3,5,3,6,7], 3) # [3,3,5,5,6,7]
|
|
@@ -314,9 +312,9 @@ cq.dequeue() # 1
|
|
|
314
312
|
|
|
315
313
|
# ── Priority Queue (min-heap) ──
|
|
316
314
|
pq = PriorityQueue()
|
|
317
|
-
pq.
|
|
318
|
-
pq.
|
|
319
|
-
pq.
|
|
315
|
+
pq.enqueue("task1", priority=3)
|
|
316
|
+
pq.enqueue("task2", priority=1)
|
|
317
|
+
pq.dequeue() # "task2"
|
|
320
318
|
|
|
321
319
|
# LeetCode extras
|
|
322
320
|
PriorityQueue().kth_largest([3,2,1,5,6,4], 2) # 5
|
|
@@ -325,10 +323,10 @@ PriorityQueue().top_k_frequent([1,1,1,2,2,3], 2) # [1, 2]
|
|
|
325
323
|
# ── Deque ──
|
|
326
324
|
d = LinkedDeque([1, 2, 3])
|
|
327
325
|
d.append(4)
|
|
328
|
-
d.
|
|
329
|
-
d.pop()
|
|
330
|
-
d.
|
|
331
|
-
d.rotate(2)
|
|
326
|
+
d.append(0, side="left") # append to left side
|
|
327
|
+
d.pop() # 4 (from right)
|
|
328
|
+
d.pop(side="left") # 0 (from left)
|
|
329
|
+
d.rotate(2) # rotate right by 2
|
|
332
330
|
```
|
|
333
331
|
|
|
334
332
|
### Linear — Utilities
|
|
@@ -375,17 +373,17 @@ run_full_benchmark() # full suite
|
|
|
375
373
|
bst = BinarySearchTree()
|
|
376
374
|
bst.insert(10, value="ten")
|
|
377
375
|
bst.insert(5, value="five")
|
|
378
|
-
bst[5] # "five" (via __getitem__)
|
|
379
376
|
bst.search(10) # ("ten", Node)
|
|
380
377
|
bst.delete(5)
|
|
381
378
|
len(bst) # 1
|
|
382
379
|
|
|
383
|
-
# Traversals
|
|
384
|
-
|
|
385
|
-
list(bst.
|
|
386
|
-
list(bst.
|
|
387
|
-
list(bst.
|
|
388
|
-
list(bst.
|
|
380
|
+
# Traversals (via standalone functions)
|
|
381
|
+
from pkstruct.trees.traversal import inorder, preorder, postorder, levelorder
|
|
382
|
+
list(inorder(bst.root)) # [5, 10, 15]
|
|
383
|
+
list(preorder(bst.root)) # [10, 5, 15]
|
|
384
|
+
list(postorder(bst.root)) # [5, 15, 10]
|
|
385
|
+
list(levelorder(bst.root)) # [10, 5, 15]
|
|
386
|
+
list(bst.zigzag_order()) # [10, 15, 5]
|
|
389
387
|
|
|
390
388
|
# Navigation Shortcuts
|
|
391
389
|
bst.root # root node
|
|
@@ -496,6 +494,7 @@ from pkstruct.trees.tree_helpers import (
|
|
|
496
494
|
validate_bst_order, path_to_node,
|
|
497
495
|
level_of_node, max_width,
|
|
498
496
|
)
|
|
497
|
+
from pkstruct.trees.node import TreeNode
|
|
499
498
|
|
|
500
499
|
# Traversal functions (work on any binary tree root)
|
|
501
500
|
bst = BinarySearchTree()
|
|
@@ -746,16 +745,6 @@ run_full_benchmark()
|
|
|
746
745
|
|
|
747
746
|
---
|
|
748
747
|
|
|
749
|
-
## 🤝 Contributing
|
|
750
|
-
|
|
751
|
-
We welcome contributions! See [CONTRIBUTING.md](CONTRIBUTING.md) to get started.
|
|
752
|
-
|
|
753
|
-
- [Code of Conduct](CODE_OF_CONDUCT.md)
|
|
754
|
-
- [Issue Tracker](https://github.com/prnvvv/pkstruct/issues)
|
|
755
|
-
- [Feature Requests](https://github.com/prnvvv/pkstruct/issues/new?template=feature_request.md)
|
|
756
|
-
|
|
757
|
-
---
|
|
758
|
-
|
|
759
748
|
## 🔧 Development
|
|
760
749
|
|
|
761
750
|
```bash
|
|
@@ -778,7 +767,7 @@ ruff check src/pkstruct
|
|
|
778
767
|
|
|
779
768
|
## 📄 License
|
|
780
769
|
|
|
781
|
-
MIT ©
|
|
770
|
+
MIT © Prannavakhanth & Priyanka Kaliraj
|
|
782
771
|
|
|
783
772
|
## 🙌 Credits
|
|
784
773
|
|