Skip to main content

Python package that implements common data structures.

Project description

Data Structures Package

This package implements fundamental data structures in Python, including Array, LinkedList, Stack, Queue, Graph, and Tree.


Classes Included

1. Array

A dynamic array implementation similar to Python’s built-in list.

Features:

  • append(value) – Adds an element at the end.
  • insert(index, value) – Inserts an element at a specific index.
  • delete(index) – Removes an element at a specific index.
  • search(value) – Returns the index of the value, or -1 if not found.
  • display() – Displays the current elements.
  • Automatically resizes when capacity is exceeded.

2. LinkedList

A singly linked list with support for insertions, deletions, search, and update.

Features:

  • add_Node(data, post=0) – Adds a new node at the beginning or specified position.
  • delete_Node(data, post=0) – Deletes a node at the beginning or a given position.
  • search(data) – Searches for a node and returns its position.
  • get_node(position) – Returns the node at a given position.
  • update(val, new_val) – Updates a node's value.
  • display() – Prints the entire list.

3. Stack

A simple stack using a Python list (LIFO).

Features:

  • push(data) – Adds data to the top of the stack.
  • pop() – Removes and returns the top item.
  • top() – Returns the current top without removing it.
  • display() – Prints stack content.
  • size() – Returns the number of elements.

4. Queue

A FIFO queue using a Python list.

Features:

  • enqueue(data) – Adds data to the end.
  • dequeue() – Removes and returns the front item.
  • is_empty() – Checks if the queue is empty.
  • size() – Returns the queue length.
  • display() – Displays the queue elements.

5. Graph

An undirected graph implemented using an adjacency list.

Features:

  • add_node(data) – Adds a new node.
  • add_edge(data1, data2) – Creates a two-way connection between nodes.
  • display() – Shows all nodes and their neighbors.

6. Tree

A binary search tree (BST) implementation.

Features:

  • insert(data) – Inserts a value into the tree.
  • search(data) – Searches for a value.
  • in_order() – Prints the tree in in-order traversal.

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

tiana_data_structures-0.0.1.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

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

tiana_data_structures-0.0.1-py3-none-any.whl (3.1 kB view details)

Uploaded Python 3

File details

Details for the file tiana_data_structures-0.0.1.tar.gz.

File metadata

  • Download URL: tiana_data_structures-0.0.1.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.6

File hashes

Hashes for tiana_data_structures-0.0.1.tar.gz
Algorithm Hash digest
SHA256 99389618a82728570f4fe5b7e5572a858751e969e805b381512f0a190c5cbc15
MD5 6920e6a95075b2cc1035049611bf9bb1
BLAKE2b-256 ec8bfba63f6bfc3c7f81f6c076e7aedd6358ebdb50cce9d0431c3d0b845af6e1

See more details on using hashes here.

File details

Details for the file tiana_data_structures-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for tiana_data_structures-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 910ead5c712156cc8959a39875c29e7ea2c6701bbf8514b6fa1a0fd64770a7aa
MD5 f4f98a9bdecef72d7f928197179a5e3d
BLAKE2b-256 2b9c9669321ab476e24ca650b2a7510ec48c3af7c81e61f2de33e841f33fbf0e

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