Skip to main content

A collection of Python data structures for educational purposes

Project description

PyHelper

A collection of Python data structures for educational purposes at FOM.

Features

This package includes implementations of:

Basic Data Structures

  • Array - Array implementations
  • Linked List - Single linked list
  • Double Linked List - Doubly linked list
  • Circular Linked List - Circular linked list
  • Stack - Stack data structure
  • List - List implementations

Complex Data Structures

  • Coming soon...

Installation

Install from local directory (for development)

pip install -e .

Install from local directory (regular installation)

pip install .

Install from GitHub

pip install git+https://github.com/Djey8/PyHelper.git

Install from PyPI

pip install pyhelper-jkluess

Usage

Importable Classes (Ready to Use)

The following classes are designed to be imported and used in your projects:

LinkedList

from Basic.linked_list import LinkedList, Node

# Create an empty linked list
my_list = LinkedList()

# Create a linked list from existing data
my_list = LinkedList([1, 2, 3, 4, 5])

# Add elements
my_list.append(6)
my_list.append(7)

# Print the list
my_list.print_list()  # Output: 1 2 3 4 5 6 7

# Remove element at index
my_list.remove(2)  # Removes the element at index 2

# Get length
print(my_list.length)

DoubleLinkedList

from Basic.double_linked_list import DoubleLinkedList

# Create a doubly linked list
dll = DoubleLinkedList([10, 20, 30, 40])

# Add elements
dll.append(50)

# Print forward
dll.print_list(end=" -> ")

# Print backward
dll.print_list_backwards(end=" <- ")

# Remove element
dll.remove(1)  # Removes element at index 1

CircularLinkedList

from Basic.circular_linked_list import CircularLinkedList

# Create a circular linked list
cll = CircularLinkedList()

# Add elements
cll.append(1)
cll.append(2)
cll.append(3)

# Print the list
cll.print_list()  # Output: 1 -> 2 -> 3 -> (back to start)

# Delete by value
cll.delete(2)  # Removes the node with value 2

Educational Examples (For Learning/Reference)

The following files contain educational examples showing different ways to work with data structures. These are meant to be read and copied for learning purposes:

Array Examples (Basic/array.py)

  • Working with NumPy arrays
  • Array operations and manipulations
  • Examples of 1D and 2D arrays

Stack Examples (Basic/stack.py)

  • Stack implementation using Python list
  • Stack using collections.deque
  • Stack using queue.LifoQueue

List Examples (Basic/list.py)

  • Basic Python list operations
  • Reference for list methods

Quick Import Reference

# Import all importable classes
from Basic.linked_list import LinkedList, Node
from Basic.double_linked_list import DoubleLinkedList
from Basic.circular_linked_list import CircularLinkedList

Development

To install development dependencies:

pip install -e ".[dev]"

License

MIT License - See LICENSE file for details

Author

Jannis Kluess - FOM Student

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

pyhelper_jkluess-0.1.0.tar.gz (7.9 kB view details)

Uploaded Source

Built Distribution

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

pyhelper_jkluess-0.1.0-py3-none-any.whl (11.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyhelper_jkluess-0.1.0.tar.gz
  • Upload date:
  • Size: 7.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for pyhelper_jkluess-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a2104e6a0ea7467832bff1aae806c20e95497706e2a0d1e4635a14e91705bf4b
MD5 3078d79b912f1acaa75edb86265982d5
BLAKE2b-256 b32330692aa9d1ddb2ea99990b89765dc1f1ff29bdb6ab6dd32c013425c737aa

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyhelper_jkluess-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5d8dee608bd4a76269591ba736598e088962c72d04e4fa4743c88564f85f556b
MD5 9b88116979aec0cd5dc5edc067dc5010
BLAKE2b-256 d2918097cb1b3fccbd36faa6da45ba8799b4e98269baebe02e3434ff08a8723f

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