Basic Data Structures and Operations Implemented in Python
- Python 3.5+ is currently supported
- Install from PyPI using
- pip install dat-struct-py
- Singly Linked List
- Doubly Linked List
- Circularly Singly Linked List
- Stack using Linked List
- Queue using Linked List
- Binary Search Tree
- Trie
- Heap (MinHeap and MaxHeap)
- Create a linked list through input sequence or inserts
- At the beginning
- At the end
- At any Position
- Delete a node carrying some value
- Size
- Quick check whether the list has even length
- Return nth element from the end
- Quick check whether a cycle exists
- Return cycle length(if one exists)
- Reverse in Place
- Swap Pairs - Works only for Even length linked list
- Create a stack by pushing elements one by one or through an input sequence
- Check whether the stack is empty
- Check whether the stack is full
- Push an element
- Pop an element
- Peek the top element
- Check balanced symbols
- Filter out all adjacent elements from the input
- Print the elements of the Stack
- Create a queue by queuing elements one by one or through an input sequence
- Check whether the Queue is empty
- Enqueue an element
- Dequeue an element
- Print the elements of the Queue
- Create a binary search tree by
- Inserting values one by one
- Passing in an input list
- Traversals
- Preorder
- Inorder
- Postorder
- Spiral
- Clockwise
- Anticlockwise
- Boundary
- Projections/Views
- LHS
- RHS
- Nodes at K distance away from root
- Connect Nodes at the Same Level
- Singly Linked List
- Circularly Singly Linked List
- Create a trie by inserting strings
- Insert a string into the trie
- Look up a string to check if it exists in the trie
- Prefix-based string operations
- Create a heap (MinHeap or MaxHeap)
- From an array of elements
- By inserting elements one by one
- Insert an element
- Extract the top element (min for MinHeap, max for MaxHeap)
- Get the top element without removing it
- Check if the heap is empty
- Get the size of the heap
- Heapify an array
- Full Fledged Vagrant Box in tools/DevelopDatStructPy
- Prerequisites
- Navigate to tools/DevelopDatStructPy
- Modify bootstrap.sh to contain your git username and email (MANDATORY STEP)
- Open Terminal/Command prompt
- Execute
vagrant upto bring up the VM - Execute
vagrant sshto login to the VM - Master Code will be present at
home/ubuntu/Development/Repos/ - Execute
source /home/ubuntu/Development/developEnv/bin/activateto activate Python Virtual Environment
dat_struct_py/: Core implementation directory containing Python modules for data structuresdat_struct_py/blocks/: Contains the fundamental node structures used by data structuresdat_struct_py/tests/: Contains unit tests for each data structure implementation