Skip to main content

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

YouYou 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 bubble_sort

arr = [64, 34, 25, 12, 22, 11, 90]
sorted_arr = bubble_sort(arr[:])
print(sorted_arr)

Graph Algorithms

from dsaedge.graphs.graph_representation import Graph
from dsaedge.graphs.bellman_ford import bellman_ford

graph = Graph()
graph.add_edge('A', 'B', weight=4)
graph.add_edge('A', 'C', weight=2)

# Example of using Bellman-Ford (requires a different Graph class structure)
# For Bellman-Ford, you'd typically define the graph as a list of edges:
# from data_structures_algorithms.graphs.bellman_ford import Graph as BellmanFordGraph, bellman_ford
# g_bf = BellmanFordGraph(5)
# g_bf.add_edge(0, 1, -1)
# distances, predecessors, has_negative_cycle = bellman_ford(g_bf, 0)
# print(distances)

Implemented Data Structures and Algorithms

Data Structures

  • Linked Lists
    • Singly Linked List
    • Doubly Linked List
    • Circular Singly Linked List
  • Trees
    • Binary Tree (with traversals)
    • Binary Search Tree (BST)
    • AVL Tree
  • Heaps
    • Min-Heap
  • Hash Tables
    • Hash Table (with chaining)
  • Graphs
    • Adjacency List Representation
    • Fenwick Tree (Binary Indexed Tree)
    • Segment Tree
    • Trie (Prefix Tree)
    • Disjoint Set Union (DSU)

Algorithms

  • Graph Algorithms
    • Breadth-First Search (BFS)
    • Depth-First Search (DFS)
    • Dijkstra's Algorithm
    • Prim's Algorithm
    • Bellman-Ford Algorithm
    • Kruskal's Algorithm
    • Floyd-Warshall Algorithm
    • Topological Sort
  • Sorting Algorithms
    • Bubble Sort
    • Selection Sort
    • Insertion Sort
    • Merge Sort
    • Quick Sort
    • Heap Sort
  • Searching Algorithms
    • Linear Search
    • Binary Search
  • Algorithmic Paradigms
    • Dynamic Programming (Knapsack, Longest Common Subsequence)
    • Backtracking (N-Queens, Sudoku Solver)
    • String Searching (KMP Algorithm)

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

dsaedge-0.1.0.tar.gz (21.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dsaedge-0.1.0-py3-none-any.whl (29.0 kB view details)

Uploaded Python 3

File details

Details for the file dsaedge-0.1.0.tar.gz.

File metadata

  • Download URL: dsaedge-0.1.0.tar.gz
  • Upload date:
  • Size: 21.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.11

File hashes

Hashes for dsaedge-0.1.0.tar.gz
Algorithm Hash digest
SHA256 3b0b39cacf65fef2ea0fbb1bb540437dee4d03db9b51dcbc777643933468d921
MD5 e50d42482d4aad27286b804c79ec495d
BLAKE2b-256 1be8810300e121dfdb5ca47bffafeb0724d056c453039a90c0746fc13f87fcba

See more details on using hashes here.

File details

Details for the file dsaedge-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: dsaedge-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 29.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.11

File hashes

Hashes for dsaedge-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6206ef5a56efe27845a7441b3e6269aa21c8125f008ae4167d43dd37ffe4730d
MD5 6bfa738be22bc6fe8a12d832b6e4241a
BLAKE2b-256 f3a61f2359a00b8c3a6134e1059e8468029a7992ec67965d3e7f38560dfe5c73

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page