Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions Arrays/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Arrays

This directory contains implementations and problems related to Arrays.

## Contents

### Anagram Check
Checks if two strings are anagrams of each other.
- **Files**: [Anagram_Check_Sorted_Sol.py](Anagram_Check_Sorted_Sol.py), [Anagram_Check_manual_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](ArrayPairSumSol.py)

### Find Missing Element
Find the missing element in a shuffled second array.
- **Files**: [ArrayFindTheMissingElement_XOR_sol.py](ArrayFindTheMissingElement_XOR_sol.py), [ArrayFindTheMissingElement_brute_force_sol.py](ArrayFindTheMissingElement_brute_force_sol.py), [ArrayFindTheMissingElement_hash_table_sol.py](ArrayFindTheMissingElement_hash_table_sol.py), [ArrayFindTheMissingElement_takingSumandSubtract_sol.py](ArrayFindTheMissingElement_takingSumandSubtract_sol.py)
9 changes: 9 additions & 0 deletions Error-debug/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Error Handling

This directory demonstrates error handling techniques in Python.

## Contents

### Basic Exception Handling
Demonstrates `try-except-else-finally` blocks and user input validation.
- **File**: [ErrorExceptions.py](ErrorExceptions.py)
18 changes: 18 additions & 0 deletions GraphAlgorithms/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Graph Algorithms

This directory contains implementations of various Graph Algorithms.

## Contents

### Adjacency List Implementation
- **File**: [AdjacencyListGraphImple.py](AdjacencyListGraphImple.py)

### Breadth First Search (BFS) - Word Ladder Problem
- **Files**: [BFS.py](BFS.py), [WordLadderProblem.py](WordLadderProblem.py)

### Depth First Search (DFS) - Knight's Tour Problem
- **Files**: [DFSImpleTheKnightsTourProblem.py](DFSImpleTheKnightsTourProblem.py), [TheKnightsTourProblem.py](TheKnightsTourProblem.py)

### General DFS
A more general implementation of Depth First Search.
- **File**: [DFSGeneral.py](DFSGeneral.py)
25 changes: 25 additions & 0 deletions LinkedLists/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Linked Lists

This directory contains implementations and problems related to Linked Lists.

## Contents

### Singly Linked List Implementation
Basic skeleton for a Singly Linked List.
- **File**: [SingleLinkedListImple.py](SingleLinkedListImple.py)

### Doubly Linked List Implementation
Basic skeleton for a Doubly Linked List.
- **File**: [DoublyLinkedListImple.py](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](SinglyLinkedListCycleCheckImple.py)

### Reverse a Linked List
Reverse a linked list in-place.
- **File**: [LinkedListReversal.py](LinkedListReversal.py)

### Nth to Last Node
Find the nth to last node in a linked list.
- **File**: [LinkedListNthToLastNode.py](LinkedListNthToLastNode.py)
13 changes: 13 additions & 0 deletions Queues/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Queues

This directory contains implementations of Queues.

## Contents

### Queue Implementation
Basic queue operations (FIFO): `enqueue`, `dequeue`, `isEmpty`, `size`.
- **File**: [QueueImple.py](QueueImple.py)

### Queue with Two Stacks
Implement a queue using two stacks.
- **File**: [QueueWith2StacksImple.py](QueueWith2StacksImple.py)
33 changes: 33 additions & 0 deletions Recursion/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Recursion

This directory contains implementations and problems related to Recursion.

## Contents

### Cumulative Sum
Compute the cumulative sum from 0 to `n`.
- **File**: [RecursionCumulativeSum.py](RecursionCumulativeSum.py)

### Sum of Digits
Returns the sum of all individual digits in an integer.
- **File**: [RecursionSumOfDigits.py](RecursionSumOfDigits.py)

### Word Split
Determine if a string can be split into words found in a given list.
- **File**: [RecursionWordSplit.py](RecursionWordSplit.py)

### Reverse a String
Recursive implementation to reverse a string.
- **File**: [RecursionReverseStr.py](RecursionReverseStr.py)

### String Permutations
Output all possible permutations of a string.
- **File**: [RecursionStrPermutation.py](RecursionStrPermutation.py)

### Fibonacci Sequence
Implementations using iteration, recursion, and dynamic programming (memoization).
- **Files**: [FibonacciSeqIterative.py](FibonacciSeqIterative.py), [FibonacciSeqRecursion.py](FibonacciSeqRecursion.py), [FibonacciSeqDynamic.py](FibonacciSeqDynamic.py)

### Coin Change Problem
Find the fewest coins needed to make a change amount.
- **Files**: [CoinChangeProblemRecursion.py](CoinChangeProblemRecursion.py), [CoinChangeProblemDynamic.py](CoinChangeProblemDynamic.py)
29 changes: 29 additions & 0 deletions Sorting/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Sorting

This directory contains implementations of various Sorting Algorithms.

## Contents

### Bubble Sort
- **File**: [BubbleSortImple.py](BubbleSortImple.py)
- **Complexity**: $O(n^2)$ worst and average case, $O(n)$ best case.

### Selection Sort
- **File**: [SelectionSortImple.py](SelectionSortImple.py)
- **Complexity**: $O(n^2)$ for all cases.

### Insertion Sort
- **File**: [InsertionSortImple.py](InsertionSortImple.py)
- **Complexity**: $O(n^2)$ worst and average case, $O(n)$ best case.

### Merge Sort
- **File**: [MergeSortImple.py](MergeSortImple.py)
- **Complexity**: $O(n \log n)$ for all cases.

### Quick Sort
- **File**: [QuickSortImple.py](QuickSortImple.py)
- **Complexity**: $O(n^2)$ worst case, $O(n \log n)$ average/best case.

### Shell Sort
- **File**: [ShellSortImple.py](ShellSortImple.py)
- **Complexity**: Between $O(n)$ and $O(n^2)$ depending on increment sequence.
13 changes: 13 additions & 0 deletions Stacks/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Stacks

This directory contains implementations and problems related to Stacks.

## Contents

### Stack Implementation
Basic stack operations (LIFO): `push`, `pop`, `peek`, `isEmpty`, `size`.
- **File**: [StackImple.py](StackImple.py)

### Balanced Parentheses Check
Check if a string of opening and closing parentheses is balanced.
- **File**: [BalanceParenthlessCheckImple.py](BalanceParenthlessCheckImple.py)
35 changes: 35 additions & 0 deletions Trees/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Trees

This directory contains implementations and problems related to Trees.

## Contents

### Binary Search Tree Implementation
- **File**: [BinarySearchTreesImple.py](BinarySearchTreesImple.py)

### Binary Heap Implementation
- **File**: [BinaryHeapImple.py](BinaryHeapImple.py)

### Binary Search
Recursive and iterative implementations.
- **Files**: [BinarySearchImple.py](BinarySearchImple.py), [BinarySearchRecursiveImple.py](BinarySearchRecursiveImple.py)

### Validate BST
Check if a binary tree is a valid Binary Search Tree.
- **Files**: [BinarySearchTreeCheckImpleSol1.py](BinarySearchTreeCheckImpleSol1.py), [BinarySearchTreeCheckImpleSol2.py](BinarySearchTreeCheckImpleSol2.py)

### Trim a BST
Trim a BST so all nodes are within a given range `[min, max]`.
- **File**: [TrimBinarySearchTreeImple.py](TrimBinarySearchTreeImple.py)

### Tree Representation (Nodes & References)
Implementing a tree using classes and references.
- **File**: [TreeRepresentationWithNodesReferences.py](TreeRepresentationWithNodesReferences.py)

### Tree Level Order Print
Print a binary tree in level order.
- **File**: [TreeLevelOrderPrintImple.py](TreeLevelOrderPrintImple.py)

### Build Tree Test
Build a tree and fetch nodes and insert using list of lists.
- **File**: [buildTreeTest.py](buildTreeTest.py)
9 changes: 9 additions & 0 deletions deque/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Deque

This directory contains an implementation of Deque (Double-ended queue).

## Contents

### Deque Implementation
Double-ended queue operations: `addFront`, `addRear`, `removeFront`, `removeRear`, `isEmpty`, `size`.
- **File**: [DequeImple.py](DequeImple.py)