Skip to main content

A pedagogical Python package implementing core data structures from scratch

Project description

Data Structures Python

this Python thingy on data structures, it's a project by CHRIST SAGOMBAYE (AMMI/AIMS). Basically, it's supposed to be a learning tool – a Python package that has all the main data structures coded up (like Arrays, Stacks, Queues, Linked Lists, Binary Trees, Graphs and stuff). The whole point is to give anyone who's into coding a helpful resource for learning.

Goals

Gotta learn and actually code these basic data structures in Python. Need to get my head around Object-Oriented Programming (OOP) principles. Wanna figure out how to package this thing up and put it on PyPI. Planning to make some docs that people can actually use, probably with a website using MkDocs or Jekyll. Project Structure

Data Structures Python

Data Structures Python

PyPI version License

A Python educational package implementing fundamental data structures for learning from scratch: Arrays, Stacks, Queues, Linked Lists, Binary Trees, and Graphs.

Table des matières


Installation

Install the latest version from PyPI:

pip install data-structures-py


git clone https://github.com/CodeWithSagomb/data-structures-python.git
cd data-structures-python
python -m pip install -e .


USE CASE

from data_structures.stack import Stack

s = Stack()
s.push(10)
s.push(20)
print(s.pop())      # 20
print(s.peek())     # 10
print(s.is_empty()) # False


from data_structures.queue import Queue

q = Queue()
q.enqueue('A')
q.enqueue('B')
print(q.dequeue())  # 'A'
print(q.peek())     # 'B'


from data_structures.linked_list import LinkedList

ll = LinkedList()
ll.append(1)
ll.prepend(0)
print(ll)           # 0 -> 1
ll.delete(1)
print(ll.find(1))   # False


from data_structures.tree import BinaryTree

bt = BinaryTree()
for v in [10, 5, 15, 3, 7]:
    bt.insert(v)
print(bt.display()) # [3, 5, 7, 10, 15]




from data_structures.graph import Graph

g = Graph()
g.add_edge('A', 'B')
g.add_edge('A', 'C')
g.display()
# A --> ['B', 'C']
# B --> ['A']
# C --> ['A']

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

data_structures_sago-0.1.0.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

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

data_structures_sago-0.1.0-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for data_structures_sago-0.1.0.tar.gz
Algorithm Hash digest
SHA256 38957c6abd3f4cc0bd1f54fdfc16f12854f633864a75e2d819ba23bb1d238b59
MD5 f746e99af021526d87484883f51e0d8f
BLAKE2b-256 a492331e390bdf074d69b102dd71795476825c2507adb5d335399abcacc2579e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for data_structures_sago-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 003604be55d77d4dd5322b7836ac389f3242b6a06aaf2e44b10786fb2989824a
MD5 993938f610127fa915a3b68289fa131d
BLAKE2b-256 1f588de3c73b4ad151014429072dd27ee57968f736cf1262e10bcdf2cff7bde2

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