A comprehensive Python package for various data structures and algorithms implementations.
Project description
dsaedge: Data Structures and Algorithms in Python
A comprehensive collection of various data structures and algorithms implemented in Python.
Installation
You can install this package using pip:
pip install dsaedge
Usage
Here are some examples of how to use the implemented data structures and algorithms:
Linked Lists
from dsaedge.linked_lists.singly_linked_list import LinkedList
ll = LinkedList()
ll.append(10)
ll.prepend(5)
print(ll)
Sorting Algorithms
from dsaedge.sorting.sorting_algorithms import Sorting
arr = [64, 34, 25, 12, 22, 11, 90]
sorted_arr = Sorting.bubble_sort(arr[:])
print(sorted_arr)
Searching Algorithms
from dsaedge.searching.searching_algorithms import Searching
arr = [1, 5, 2, 8, 3]
index = Searching.linear_search(arr, 8)
print(f"Element found at index: {index}")
Graph Algorithms
from dsaedge.graphs.graph_representation import Graph
graph = Graph()
graph.add_edge('A', 'B', weight=4)
graph.add_edge('A', 'C', weight=2)
# Example BFS
bfs_result = graph.bfs('A')
print(f"BFS Traversal: {bfs_result}")
# Example Dijkstra
distances, predecessors = graph.dijkstra('A')
print(f"Dijkstra distances from A: {distances}")
Implemented Data Structures and Algorithms
The dsaedge package is organized into several modules, each focusing on a specific category of data structures or algorithms.
Data Structures
advanced_data_structuresdisjoint_set_union.py: Disjoint Set Union (DSU)fenwick_tree.py: Fenwick Tree (Binary Indexed Tree)segment_tree.py: Segment Treetrie.py: Trie (Prefix Tree)
hash_tableshash_table.py: Hash Table (with chaining)
heapsmin_heap.py: Min-Heap
linked_listscircular_singly_linked_list.py: Circular Singly Linked Listdoubly_linked_list.py: Doubly Linked Listsingly_linked_list.py: Singly Linked List
treesavl_tree.py: AVL Treebinary_search_tree.py: Binary Search Tree (BST)binary_tree.py: Generic Binary Tree (with traversals)
Algorithms
algorithmic_paradigmskmp_search.py: Knuth-Morris-Pratt (KMP) string searchingknapsack_problem.py: Knapsack Problem (Dynamic Programming)longest_common_subsequence.py: Longest Common Subsequence (Dynamic Programming)n_queens.py: N-Queens Problem (Backtracking)sudoku_solver.py: Sudoku Solver (Backtracking)
graphsbellman_ford.py: Bellman-Ford Algorithmfloyd_warshall.py: Floyd-Warshall Algorithmgraph_representation.py: Graph Representation (Adjacency List) and common graph algorithms (BFS, DFS, Dijkstra, Prim, A*, Cycle Detection, SCC)kruskal_algorithm.py: Kruskal's Algorithmtopological_sort.py: Topological Sort
searchingsearching_algorithms.py: Linear Search, Binary Search, Jump Search, Exponential Search
sortingsorting_algorithms.py: Bubble Sort, Selection Sort, Insertion Sort, Merge Sort, Quick Sort, Heap Sort, Counting Sort, Radix Sort
Contributing
Contributions are welcome! Please feel free to open issues or submit pull requests.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dsaedge-0.3.0.tar.gz.
File metadata
- Download URL: dsaedge-0.3.0.tar.gz
- Upload date:
- Size: 20.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
380989e32b20cf80a289944efe98aa45771b9a4f830a96e3fddb1285f343f8ee
|
|
| MD5 |
d027fd5185d38c451164c75a66887d86
|
|
| BLAKE2b-256 |
5e1e60254a5b523745812317ea61a9d879bcc9d750f9a2a5c767becf08512aad
|
File details
Details for the file dsaedge-0.3.0-py3-none-any.whl.
File metadata
- Download URL: dsaedge-0.3.0-py3-none-any.whl
- Upload date:
- Size: 27.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b6578dd052c81966044a3d0ae015ca8d18f33ad792eee5e7b3a2369d19c3dbf7
|
|
| MD5 |
b81687a2deaa3fce195b1dc3bf3e7e3c
|
|
| BLAKE2b-256 |
235576849819d5bc58e671f3302eb565d210b8dd0b3f4feeb5a5484c4b9f496b
|