From 739dbdc598b1605615245e7fd20c0b9ce1eb6e38 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Wed, 25 Mar 2026 01:42:46 +0000 Subject: [PATCH] Add sub-directory READMEs, update root README, and add LICENSE - Created localized README.md files for all 10 sub-directories (Arrays, Error-debug, GraphAlgorithms, LinkedLists, Queues, Recursion, Sorting, Stacks, Trees, and deque). - Updated the root README.md to include 'Trees/buildTreeTest.py'. - Added an MIT LICENSE file as mentioned in the project documentation. Co-authored-by: ppant <149585+ppant@users.noreply.github.com> --- Arrays/README.md | 17 +++++++++++++++++ Error-debug/README.md | 9 +++++++++ GraphAlgorithms/README.md | 18 ++++++++++++++++++ LICENSE | 21 +++++++++++++++++++++ LinkedLists/README.md | 25 +++++++++++++++++++++++++ Queues/README.md | 13 +++++++++++++ README.md | 4 ++++ Recursion/README.md | 33 +++++++++++++++++++++++++++++++++ Sorting/README.md | 29 +++++++++++++++++++++++++++++ Stacks/README.md | 13 +++++++++++++ Trees/README.md | 35 +++++++++++++++++++++++++++++++++++ deque/README.md | 9 +++++++++ 12 files changed, 226 insertions(+) create mode 100644 Arrays/README.md create mode 100644 Error-debug/README.md create mode 100644 GraphAlgorithms/README.md create mode 100644 LICENSE create mode 100644 LinkedLists/README.md create mode 100644 Queues/README.md create mode 100644 Recursion/README.md create mode 100644 Sorting/README.md create mode 100644 Stacks/README.md create mode 100644 Trees/README.md create mode 100644 deque/README.md diff --git a/Arrays/README.md b/Arrays/README.md new file mode 100644 index 0000000..76a37f4 --- /dev/null +++ b/Arrays/README.md @@ -0,0 +1,17 @@ +# Arrays + +This directory contains implementations of various array-related algorithms. + +## Contents + +### Anagram Check +Checks if two strings are anagrams of each other. +- **Files**: `Anagram_Check_Sorted_Sol.py`, `Anagram_Check_manual_Sol.py` + +### Array Pair Sum +Given an integer array, output all unique pairs that sum up to a specific value `k`. +- **File**: `ArrayPairSumSol.py` + +### Find Missing Element +Find the missing element in a shuffled second array. +- **Files**: `ArrayFindTheMissingElement_XOR_sol.py`, `ArrayFindTheMissingElement_brute_force_sol.py`, `ArrayFindTheMissingElement_hash_table_sol.py`, `ArrayFindTheMissingElement_takingSumandSubtract_sol.py` diff --git a/Error-debug/README.md b/Error-debug/README.md new file mode 100644 index 0000000..7a209f6 --- /dev/null +++ b/Error-debug/README.md @@ -0,0 +1,9 @@ +# Error Handling + +This directory contains examples of error handling and debugging in Python. + +## Contents + +### Basic Exception Handling +Demonstrates `try-except-else-finally` blocks and user input validation. +- **File**: `ErrorExceptions.py` diff --git a/GraphAlgorithms/README.md b/GraphAlgorithms/README.md new file mode 100644 index 0000000..fc993ac --- /dev/null +++ b/GraphAlgorithms/README.md @@ -0,0 +1,18 @@ +# Graph Algorithms + +This directory contains implementations of various graph-related algorithms. + +## Contents + +### Adjacency List Implementation +- **File**: `AdjacencyListGraphImple.py` + +### Breadth First Search (BFS) - Word Ladder Problem +- **Files**: `BFS.py`, `WordLadderProblem.py` + +### Depth First Search (DFS) - Knight's Tour Problem +- **Files**: `DFSImpleTheKnightsTourProblem.py`, `TheKnightsTourProblem.py` + +### General DFS +A more general implementation of Depth First Search. +- **File**: `DFSGeneral.py` diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..cecd15e --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017 Pradeep K. Pant + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/LinkedLists/README.md b/LinkedLists/README.md new file mode 100644 index 0000000..8cf6b73 --- /dev/null +++ b/LinkedLists/README.md @@ -0,0 +1,25 @@ +# Linked Lists + +This directory contains implementations of various linked list structures and algorithms. + +## Contents + +### Singly Linked List Implementation +Basic skeleton for a Singly Linked List. +- **File**: `SingleLinkedListImple.py` + +### Doubly Linked List Implementation +Basic skeleton for a Doubly Linked List. +- **File**: `DoublyLinkedListImple.py` + +### Singly Linked List Cycle Check +Check if a singly linked list contains a cycle using the "two runners" (slow and fast pointers) strategy. +- **File**: `SinglyLinkedListCycleCheckImple.py` + +### Reverse a Linked List +Reverse a linked list in-place. +- **File**: `LinkedListReversal.py` + +### Nth to Last Node +Find the nth to last node in a linked list. +- **File**: `LinkedListNthToLastNode.py` diff --git a/Queues/README.md b/Queues/README.md new file mode 100644 index 0000000..98b56fe --- /dev/null +++ b/Queues/README.md @@ -0,0 +1,13 @@ +# Queues + +This directory contains implementations of queue data structures. + +## Contents + +### Queue Implementation +Basic queue operations (FIFO): `enqueue`, `dequeue`, `isEmpty`, `size`. +- **File**: `QueueImple.py` + +### Queue with Two Stacks +Implement a queue using two stacks. +- **File**: `QueueWith2StacksImple.py` diff --git a/README.md b/README.md index 790acf4..5dcd3e7 100644 --- a/README.md +++ b/README.md @@ -149,6 +149,10 @@ Implementing a tree using classes and references. Print a binary tree in level order. - **File**: `Trees/TreeLevelOrderPrintImple.py` +### Build Tree Test +Build a tree and fetch nodes and insert using list of lists. +- **File**: `Trees/buildTreeTest.py` + --- ## Sorting diff --git a/Recursion/README.md b/Recursion/README.md new file mode 100644 index 0000000..f99b078 --- /dev/null +++ b/Recursion/README.md @@ -0,0 +1,33 @@ +# Recursion + +This directory contains various examples of recursive algorithms. + +## Contents + +### Cumulative Sum +Compute the cumulative sum from 0 to `n`. +- **File**: `RecursionCumulativeSum.py` + +### Sum of Digits +Returns the sum of all individual digits in an integer. +- **File**: `RecursionSumOfDigits.py` + +### Word Split +Determine if a string can be split into words found in a given list. +- **File**: `RecursionWordSplit.py` + +### Reverse a String +Recursive implementation to reverse a string. +- **File**: `RecursionReverseStr.py` + +### String Permutations +Output all possible permutations of a string. +- **File**: `RecursionStrPermutation.py` + +### Fibonacci Sequence +Implementations using iteration, recursion, and dynamic programming (memoization). +- **Files**: `FibonacciSeqIterative.py`, `FibonacciSeqRecursion.py`, `FibonacciSeqDynamic.py` + +### Coin Change Problem +Find the fewest coins needed to make a change amount. +- **Files**: `CoinChangeProblemRecursion.py`, `CoinChangeProblemDynamic.py` diff --git a/Sorting/README.md b/Sorting/README.md new file mode 100644 index 0000000..3948aa6 --- /dev/null +++ b/Sorting/README.md @@ -0,0 +1,29 @@ +# Sorting Algorithms + +This directory contains implementations of various sorting algorithms. + +## Contents + +### Bubble Sort +- **File**: `BubbleSortImple.py` +- **Complexity**: $O(n^2)$ worst and average case, $O(n)$ best case. + +### Selection Sort +- **File**: `SelectionSortImple.py` +- **Complexity**: $O(n^2)$ for all cases. + +### Insertion Sort +- **File**: `InsertionSortImple.py` +- **Complexity**: $O(n^2)$ worst and average case, $O(n)$ best case. + +### Merge Sort +- **File**: `MergeSortImple.py` +- **Complexity**: $O(n \log n)$ for all cases. + +### Quick Sort +- **File**: `QuickSortImple.py` +- **Complexity**: $O(n^2)$ worst case, $O(n \log n)$ average/best case. + +### Shell Sort +- **File**: `ShellSortImple.py` +- **Complexity**: Between $O(n)$ and $O(n^2)$ depending on increment sequence. diff --git a/Stacks/README.md b/Stacks/README.md new file mode 100644 index 0000000..f8fbaea --- /dev/null +++ b/Stacks/README.md @@ -0,0 +1,13 @@ +# Stacks + +This directory contains implementations of stack data structures and related algorithms. + +## Contents + +### Stack Implementation +Basic stack operations (LIFO): `push`, `pop`, `peek`, `isEmpty`, `size`. +- **File**: `StackImple.py` + +### Balanced Parentheses Check +Check if a string of opening and closing parentheses is balanced. +- **File**: `BalanceParenthlessCheckImple.py` diff --git a/Trees/README.md b/Trees/README.md new file mode 100644 index 0000000..7c186f3 --- /dev/null +++ b/Trees/README.md @@ -0,0 +1,35 @@ +# Trees + +This directory contains implementations of various tree structures and related algorithms. + +## Contents + +### Binary Search Tree Implementation +- **File**: `BinarySearchTreesImple.py` + +### Binary Heap Implementation +- **File**: `BinaryHeapImple.py` + +### Binary Search +Recursive and iterative implementations. +- **Files**: `BinarySearchImple.py`, `BinarySearchRecursiveImple.py` + +### Validate BST +Check if a binary tree is a valid Binary Search Tree. +- **Files**: `BinarySearchTreeCheckImpleSol1.py`, `BinarySearchTreeCheckImpleSol2.py` + +### Trim a BST +Trim a BST so all nodes are within a given range `[min, max]`. +- **File**: `TrimBinarySearchTreeImple.py` + +### Tree Representation (Nodes & References) +Implementing a tree using classes and references. +- **File**: `TreeRepresentationWithNodesReferences.py` + +### Tree Level Order Print +Print a binary tree in level order. +- **File**: `TreeLevelOrderPrintImple.py` + +### Build Tree Test +Build a tree and fetch nodes and insert using list of lists. +- **File**: `buildTreeTest.py` diff --git a/deque/README.md b/deque/README.md new file mode 100644 index 0000000..70cc1d4 --- /dev/null +++ b/deque/README.md @@ -0,0 +1,9 @@ +# Deque + +This directory contains implementations of deque data structures. + +## Contents + +### Deque Implementation +Double-ended queue operations: `addFront`, `addRear`, `removeFront`, `removeRear`, `isEmpty`, `size`. +- **File**: `DequeImple.py`