From e8f77a4cdc0b96e689134c5b59e578965e905602 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Mon, 18 May 2026 01:47:18 +0000 Subject: [PATCH] Standardize project naming conventions and update documentation - Renamed directories 'deque' to 'Deque' and 'Error-debug' to 'ErrorHandling' for consistency. - Renamed various snake_case Python scripts in 'Arrays' and 'Trees' to PascalCase. - Updated root README.md with corrected paths, improved Table of Contents slugs, and added time complexities. - Updated subdirectory READMEs (Arrays, Deque, ErrorHandling, Trees) to match new filenames and standardized headers. - Verified all Markdown links and confirmed that all non-interactive scripts execute successfully. Co-authored-by: ppant <149585+ppant@users.noreply.github.com> --- ...manual_Sol.py => AnagramCheckManualSol.py} | 0 ...Sorted_Sol.py => AnagramCheckSortedSol.py} | 0 ...rrayFindTheMissingElementBruteForceSol.py} | 0 ...ArrayFindTheMissingElementHashTableSol.py} | 0 ...py => ArrayFindTheMissingElementSumSol.py} | 0 ...py => ArrayFindTheMissingElementXORSol.py} | 0 Arrays/README.md | 12 +++--- {deque => Deque}/DequeImple.py | 0 {deque => Deque}/README.md | 2 +- Error-debug/README.md | 7 ---- .../ErrorExceptions.py | 0 ErrorHandling/README.md | 7 ++++ README.md | 42 +++++++++---------- Trees/{buildTreeTest.py => BuildTreeTest.py} | 0 Trees/README.md | 29 +++++-------- 15 files changed, 46 insertions(+), 53 deletions(-) rename Arrays/{Anagram_Check_manual_Sol.py => AnagramCheckManualSol.py} (100%) rename Arrays/{Anagram_Check_Sorted_Sol.py => AnagramCheckSortedSol.py} (100%) rename Arrays/{ArrayFindTheMissingElement_brute_force_sol.py => ArrayFindTheMissingElementBruteForceSol.py} (100%) rename Arrays/{ArrayFindTheMissingElement_hash_table_sol.py => ArrayFindTheMissingElementHashTableSol.py} (100%) rename Arrays/{ArrayFindTheMissingElement_takingSumandSubtract_sol.py => ArrayFindTheMissingElementSumSol.py} (100%) rename Arrays/{ArrayFindTheMissingElement_XOR_sol.py => ArrayFindTheMissingElementXORSol.py} (100%) rename {deque => Deque}/DequeImple.py (100%) rename {deque => Deque}/README.md (71%) delete mode 100644 Error-debug/README.md rename {Error-debug => ErrorHandling}/ErrorExceptions.py (100%) create mode 100644 ErrorHandling/README.md rename Trees/{buildTreeTest.py => BuildTreeTest.py} (100%) diff --git a/Arrays/Anagram_Check_manual_Sol.py b/Arrays/AnagramCheckManualSol.py similarity index 100% rename from Arrays/Anagram_Check_manual_Sol.py rename to Arrays/AnagramCheckManualSol.py diff --git a/Arrays/Anagram_Check_Sorted_Sol.py b/Arrays/AnagramCheckSortedSol.py similarity index 100% rename from Arrays/Anagram_Check_Sorted_Sol.py rename to Arrays/AnagramCheckSortedSol.py diff --git a/Arrays/ArrayFindTheMissingElement_brute_force_sol.py b/Arrays/ArrayFindTheMissingElementBruteForceSol.py similarity index 100% rename from Arrays/ArrayFindTheMissingElement_brute_force_sol.py rename to Arrays/ArrayFindTheMissingElementBruteForceSol.py diff --git a/Arrays/ArrayFindTheMissingElement_hash_table_sol.py b/Arrays/ArrayFindTheMissingElementHashTableSol.py similarity index 100% rename from Arrays/ArrayFindTheMissingElement_hash_table_sol.py rename to Arrays/ArrayFindTheMissingElementHashTableSol.py diff --git a/Arrays/ArrayFindTheMissingElement_takingSumandSubtract_sol.py b/Arrays/ArrayFindTheMissingElementSumSol.py similarity index 100% rename from Arrays/ArrayFindTheMissingElement_takingSumandSubtract_sol.py rename to Arrays/ArrayFindTheMissingElementSumSol.py diff --git a/Arrays/ArrayFindTheMissingElement_XOR_sol.py b/Arrays/ArrayFindTheMissingElementXORSol.py similarity index 100% rename from Arrays/ArrayFindTheMissingElement_XOR_sol.py rename to Arrays/ArrayFindTheMissingElementXORSol.py diff --git a/Arrays/README.md b/Arrays/README.md index 707a82e..6a3de28 100644 --- a/Arrays/README.md +++ b/Arrays/README.md @@ -4,10 +4,10 @@ This directory contains Python implementations of common array-based algorithms ## Contents -- [Anagram Check (Sorted Solution)](Anagram_Check_Sorted_Sol.py): Checks if two strings are anagrams by comparing their sorted versions. -- [Anagram Check (Manual Solution)](Anagram_Check_manual_Sol.py): Checks if two strings are anagrams using a hash table (dictionary) to count character frequencies. -- [Array Find Missing Element (XOR Solution)](ArrayFindTheMissingElement_XOR_sol.py): Efficiently finds a missing element in a shuffled array using bitwise XOR. -- [Array Find Missing Element (Brute Force Solution)](ArrayFindTheMissingElement_brute_force_sol.py): Finds a missing element by sorting both arrays and comparing them. -- [Array Find Missing Element (Hash Table Solution)](ArrayFindTheMissingElement_hash_table_sol.py): Finds a missing element using a hash table (dictionary) to track element counts. -- [Array Find Missing Element (Sum/Subtract Solution)](ArrayFindTheMissingElement_takingSumandSubtract_sol.py): Finds a missing element by calculating the difference between the sums of the two arrays. +- [Anagram Check (Sorted Solution)](AnagramCheckSortedSol.py): Checks if two strings are anagrams by comparing their sorted versions. +- [Anagram Check (Manual Solution)](AnagramCheckManualSol.py): Checks if two strings are anagrams using a hash table (dictionary) to count character frequencies. +- [Array Find Missing Element (XOR Solution)](ArrayFindTheMissingElementXORSol.py): Efficiently finds a missing element in a shuffled array using bitwise XOR. +- [Array Find Missing Element (Brute Force Solution)](ArrayFindTheMissingElementBruteForceSol.py): Finds a missing element by sorting both arrays and comparing them. +- [Array Find Missing Element (Hash Table Solution)](ArrayFindTheMissingElementHashTableSol.py): Finds a missing element using a hash table (dictionary) to track element counts. +- [Array Find Missing Element (Sum/Subtract Solution)](ArrayFindTheMissingElementSumSol.py): Finds a missing element by calculating the difference between the sums of the two arrays. - [Array Pair Sum Solution](ArrayPairSumSol.py): Finds all unique pairs in an array that sum up to a specific value $k$ using a set for $O(n)$ complexity. diff --git a/deque/DequeImple.py b/Deque/DequeImple.py similarity index 100% rename from deque/DequeImple.py rename to Deque/DequeImple.py diff --git a/deque/README.md b/Deque/README.md similarity index 71% rename from deque/README.md rename to Deque/README.md index 046a17f..5270fec 100644 --- a/deque/README.md +++ b/Deque/README.md @@ -4,4 +4,4 @@ This directory contains Python implementations of the Deque (Double-Ended Queue) ## Contents -- [Deque Implementation](DequeImple.py): Basic implementation of a Deque using a Python list. Includes operations like `addFront`, `addRear`, `removeFront`, `removeRear`, `isEmpty`, and `size`. +- [Deque Implementation](DequeImple.py): Basic implementation of a Deque using a Python list. Includes operations like `addFront`, `addRear`, `removeFront`, `removeRear`, `isEmpty`, and `size`. Time complexity is $O(1)$ for `addFront` and `removeFront`, but $O(n)$ for `addRear` and `removeRear` due to list shifting. diff --git a/Error-debug/README.md b/Error-debug/README.md deleted file mode 100644 index c8bc4d4..0000000 --- a/Error-debug/README.md +++ /dev/null @@ -1,7 +0,0 @@ -# Error and Debugging - -This directory contains examples of error handling and debugging techniques in Python. - -## Contents - -- [Error and Exceptions](ErrorExceptions.py): Demonstrates the use of `try`, `except`, `else`, and `finally` blocks for robust error handling, specifically validating integer user input. diff --git a/Error-debug/ErrorExceptions.py b/ErrorHandling/ErrorExceptions.py similarity index 100% rename from Error-debug/ErrorExceptions.py rename to ErrorHandling/ErrorExceptions.py diff --git a/ErrorHandling/README.md b/ErrorHandling/README.md new file mode 100644 index 0000000..fc91dd5 --- /dev/null +++ b/ErrorHandling/README.md @@ -0,0 +1,7 @@ +# Error Handling & Debugging + +This directory contains examples of error handling and debugging in Python. + +## Contents + +- [Error and Exceptions](ErrorExceptions.py): Demonstrates `try`, `except`, `else`, and `finally` blocks for robust error handling. diff --git a/README.md b/README.md index b8de7d5..701eea2 100644 --- a/README.md +++ b/README.md @@ -35,20 +35,20 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for more details. ## πŸ“– Table of Contents -- [Getting Started](#getting-started) +- [πŸš€ Getting Started](#-getting-started) - [Project Structure](#project-structure) - [Data Structures](#data-structures) - - [Arrays](#arrays) - - [Linked Lists](#linked-lists) - - [Stacks](#stacks) - - [Queues](#queues) - - [Deque](#deque) - - [Trees](#trees) + - [Arrays πŸ”€](#arrays-) + - [Linked Lists πŸ”—](#linked-lists-) + - [Stacks πŸ“š](#stacks-) + - [Queues πŸ“¦](#queues-) + - [Deque πŸ”„](#deque-) + - [Trees 🌳](#trees-) - [Algorithms](#algorithms) - - [Sorting](#sorting) - - [Recursion & Dynamic Programming](#recursion--dynamic-programming) - - [Graph Algorithms](#graph-algorithms) -- [Error Handling & Debugging](#error-handling--debugging) + - [Sorting πŸ“Š](#sorting-) + - [Recursion & Dynamic Programming πŸ”€](#recursion--dynamic-programming-) + - [Graph Algorithms πŸ—ΊοΈ](#graph-algorithms-) +- [⚠️ Error Handling & Debugging](#-error-handling--debugging) - [Usage](#usage) - [Quick Reference](#quick-reference) - [License](#license) @@ -67,7 +67,7 @@ Most scripts in this repository are standalone and can be executed directly: ```bash # Run any Python script -python3 Arrays/Anagram_Check_Sorted_Sol.py +python3 Arrays/AnagramCheckSortedSol.py # Or run from the repo root python3 Sorting/BubbleSortImple.py @@ -80,7 +80,8 @@ python3 Sorting/BubbleSortImple.py ``` . β”œβ”€β”€ Arrays/ # πŸ”€ Array-based problems and algorithms -β”œβ”€β”€ Error-debug/ # ⚠️ Error handling and debugging examples +β”œβ”€β”€ Deque/ # πŸ”„ Double-ended queue +β”œβ”€β”€ ErrorHandling/ # ⚠️ Error handling and debugging examples β”œβ”€β”€ GraphAlgorithms/ # πŸ—ΊοΈ Graph traversal (BFS, DFS) and pathfinding β”œβ”€β”€ LinkedLists/ # πŸ”— Singly and Doubly Linked Lists β”œβ”€β”€ Queues/ # πŸ“¦ Queue implementations (FIFO) @@ -88,7 +89,6 @@ python3 Sorting/BubbleSortImple.py β”œβ”€β”€ Sorting/ # πŸ“Š Common sorting algorithms β”œβ”€β”€ Stacks/ # πŸ“š Stack implementations and applications β”œβ”€β”€ Trees/ # 🌳 Binary Trees, BSTs, Heaps, and Traversals -β”œβ”€β”€ deque/ # πŸ”„ Double-ended queue β”œβ”€β”€ CONTRIBUTING.md # 🀝 Contribution guidelines β”œβ”€β”€ LICENSE # πŸ“„ MIT License └── README.md # πŸ“– This file @@ -100,9 +100,9 @@ python3 Sorting/BubbleSortImple.py ### Arrays πŸ”€ Common array-based algorithms and manipulations. -- [Anagram Check](Arrays/): [Sorted](Arrays/Anagram_Check_Sorted_Sol.py) & [Manual](Arrays/Anagram_Check_manual_Sol.py) solutions +- [Anagram Check](Arrays/): [Sorted](Arrays/AnagramCheckSortedSol.py) & [Manual](Arrays/AnagramCheckManualSol.py) solutions - [Array Pair Sum](Arrays/ArrayPairSumSol.py): Find pairs that sum to $k$ -- [Find Missing Element](Arrays/): [XOR](Arrays/ArrayFindTheMissingElement_XOR_sol.py), [Brute Force](Arrays/ArrayFindTheMissingElement_brute_force_sol.py), [Hash Table](Arrays/ArrayFindTheMissingElement_hash_table_sol.py), & [Sum](Arrays/ArrayFindTheMissingElement_takingSumandSubtract_sol.py) approaches +- [Find Missing Element](Arrays/): [XOR](Arrays/ArrayFindTheMissingElementXORSol.py), [Brute Force](Arrays/ArrayFindTheMissingElementBruteForceSol.py), [Hash Table](Arrays/ArrayFindTheMissingElementHashTableSol.py), & [Sum](Arrays/ArrayFindTheMissingElementSumSol.py) approaches ### Linked Lists πŸ”— Implementations and problems involving linked structures. @@ -123,17 +123,17 @@ FIFO (First-In-First-Out) data structures. ### Deque πŸ”„ Double-ended queue operations. -- [Deque Implementation](deque/DequeImple.py): Operations at both ends +- [Deque Implementation](Deque/DequeImple.py): Operations at both ends ### Trees 🌳 Hierarchical data structures. -- [Binary Search Tree](Trees/BinarySearchTreesImple.py): Complete BST implementation +- [Binary Search Tree](Trees/BinarySearchTreesImple.py): Complete BST implementation (Average: $O(\log n)$, Worst: $O(n)$) - [BST Validation](Trees/): [Solution 1 (In-order)](Trees/BinarySearchTreeCheckImpleSol1.py) & [Solution 2 (Range check)](Trees/BinarySearchTreeCheckImpleSol2.py) - [Binary Search](Trees/): [Iterative](Trees/BinarySearchImple.py) & [Recursive](Trees/BinarySearchRecursiveImple.py) - [Binary Heap](Trees/BinaryHeapImple.py): Min-heap implementation - [Tree Traversals](Trees/TreeLevelOrderPrintImple.py): Level order (BFS) printing - [Trim BST](Trees/TrimBinarySearchTreeImple.py): Keep nodes within a range -- [Tree Representations](Trees/): [Nodes & References](Trees/TreeRepresentationWithNodesReferences.py) & [List of Lists](Trees/buildTreeTest.py) +- [Tree Representations](Trees/): [Nodes & References](Trees/TreeRepresentationWithNodesReferences.py) & [List of Lists](Trees/BuildTreeTest.py) --- @@ -144,7 +144,7 @@ Algorithms for arranging elements in order. - [Bubble Sort](Sorting/BubbleSortImple.py) - $O(n^2)$ - [Selection Sort](Sorting/SelectionSortImple.py) - $O(n^2)$ - [Insertion Sort](Sorting/InsertionSortImple.py) - $O(n^2)$ -- [Shell Sort](Sorting/ShellSortImple.py) - $O(n \log n)$ +- [Shell Sort](Sorting/ShellSortImple.py) - $O(n^2)$ - [Merge Sort](Sorting/MergeSortImple.py) - $O(n \log n)$ - [Quick Sort](Sorting/QuickSortImple.py) - $O(n \log n)$ average @@ -168,7 +168,7 @@ Algorithms for graph traversal and pathfinding. ## ⚠️ Error Handling & Debugging -- [Error and Exceptions](Error-debug/ErrorExceptions.py): Demonstrates `try`, `except`, `else`, and `finally` blocks for robust error handling. +- [Error and Exceptions](ErrorHandling/ErrorExceptions.py): Demonstrates `try`, `except`, `else`, and `finally` blocks for robust error handling. --- diff --git a/Trees/buildTreeTest.py b/Trees/BuildTreeTest.py similarity index 100% rename from Trees/buildTreeTest.py rename to Trees/BuildTreeTest.py diff --git a/Trees/README.md b/Trees/README.md index 2047225..bbbd31d 100644 --- a/Trees/README.md +++ b/Trees/README.md @@ -1,23 +1,16 @@ # Trees -This directory contains Python implementations of various tree-based data structures and algorithms. +This directory contains Python implementations of tree-based data structures and algorithms. ## Contents -### Binary Search Trees (BST) -- [Binary Search Tree Implementation](BinarySearchTreesImple.py): A comprehensive implementation of a BST with `TreeNode` and `BinarySearchTree` classes, including insertion, deletion, and search. -- [Validate BST (Solution 1)](BinarySearchTreeCheckImpleSol1.py): Validates a BST by performing an in-order traversal and checking if the resulting values are sorted. -- [Validate BST (Solution 2)](BinarySearchTreeCheckImpleSol2.py): Validates a BST by keeping track of the minimum and maximum allowable values for each node. -- [Trim a BST](TrimBinarySearchTreeImple.py): Trims a BST so that all node values fall within a specified range $[min, max]$. - -### Search Algorithms -- [Binary Search (Iterative)](BinarySearchImple.py): Iterative implementation of the binary search algorithm on a sorted list. -- [Binary Search (Recursive)](BinarySearchRecursiveImple.py): Recursive implementation of the binary search algorithm. - -### Heaps -- [Binary Heap Implementation](BinaryHeapImple.py): Implements a min-heap using a recursive approach, including `insert`, `delMin`, and `buildHeap`. - -### Tree Representations & Traversals -- [Nodes and References Representation](TreeRepresentationWithNodesReferences.py): A simple implementation of a binary tree using a class-based nodes and references approach. -- [List of Lists Representation](buildTreeTest.py): Demonstrates building and manipulating a tree using a "list of lists" approach. -- [Tree Level Order Print](TreeLevelOrderPrintImple.py): Prints a binary tree in level order (breadth-first) using a queue, with each level on a new line. +- [Binary Search Tree Implementation](BinarySearchTreesImple.py): Complete BST implementation with search, insert, and delete operations. Average time complexity: $O(\log n)$, Worst case: $O(n)$. +- [BST Validation (In-order)](BinarySearchTreeCheckImpleSol1.py): Validates if a binary tree is a BST using in-order traversal. +- [BST Validation (Range check)](BinarySearchTreeCheckImpleSol2.py): Validates if a binary tree is a BST by checking if each node falls within a valid range. +- [Binary Search (Iterative)](BinarySearchImple.py): Iterative implementation of the binary search algorithm with $O(\log n)$ complexity. +- [Binary Search (Recursive)](BinarySearchRecursiveImple.py): Recursive implementation of the binary search algorithm with $O(\log n)$ complexity. +- [Binary Heap Implementation](BinaryHeapImple.py): Min-heap implementation with `insert`, `delMin`, and `buildHeap` operations. +- [Tree Level Order Print](TreeLevelOrderPrintImple.py): Implementation of level order traversal (BFS) for binary trees. +- [Trim a Binary Search Tree](TrimBinarySearchTreeImple.py): Trims a BST so that all its elements are within a given range $[L, R]$. +- [Tree Representation (Nodes & References)](TreeRepresentationWithNodesReferences.py): Basic tree representation using nodes and references. +- [Tree Representation (List of Lists)](BuildTreeTest.py): Tree representation using a list of lists approach.