
gittech. site
for different kinds of informations and explorations.
Algorithms and Data Structures
Algorithms and Data Structures
Donald Knuth: "An algorithm must be seen to be believed".
Welcome to curated GitHub repository, featuring a comprehensive collection of fundamental Algorithms and Data structures organized into various categories to cater to the needs of software engineers and computer science students. Each Algorithm and Data structure is systematically classified, ensuring easy navigation and efficient learning. You will find concise explanations and clear Java implementation code, making it easy to understand and implement the concepts in your projects.
Additionally, the repository includes sample problems and solutions, designed to help practice and apply the concepts learned from each Algorithm and Data structure. These problems serve as valuable exercises to enhance your problem-solving skills.
Algorithms
Algorithms βββ Arrays β βββ Searching β β βββ Linear Search β β βββ Binary Search β β βββ Exponential Search β β βββ Jump Search β β βββ Interpolation Search β β βββ Ternary Search β βββ Sorting β β βββ Bubble Sort β β βββ Selection Sort β β βββ Insertion Sort β β βββ Merge Sort β β βββ Quick Sort β β β βββ Partition Hoare β β β βββ Partition Lomuto β β β βββ 3-Way Partitioning β β βββ Heap Sort β β βββ Counting Sort β β βββ Bucket Sort β βββ Selection β βββ Quick Select β β βββ Partition Hoare β β βββ Partition Lomuto β βββ Median of medians βββ Strings β βββ Sorting β β βββ LSD Radix Sort β βββ Compression β β βββ Huffman Coding β βββ String Matching β βββ Naive String Search β βββ Brute-force β βββ Rabin-Karp β βββ Knuth-Morris-Pratt β βββ Boyer-Moore β βββ Aho-Corasick β βββ Regular Expressions β β βββ Regular Expression Matching β β βββ Thompson NFA β βββ Edit Distance β βββ Levenshtein Distance β βββ Hamming Distance βββ Linked List β βββ Floyd's Cycle Detection βββ Tree β βββ Searching β βββ DFS β β βββ Pre-order traversal β β βββ In-order traversal β β βββ Post-order traversal β βββ BFS β βββ Level-order traversal βββ Graphs β βββ Searching β β βββ DFS β β β βββ Path β β β βββ DFS-ID β β βββ BFS β β β βββ Path β β β βββ Bidirectional BFS β β βββ Shortest Path β β βββ BFS β β βββ Dijkstra's β β β βββ Eager β β β βββ Lazy β β βββ BellmanβFord β β βββ Floyd-Warshall β β βββ A-star β βββ Minimum Spanning Tree β β βββ Primβs β β β βββ Eager β β β βββ Lazy β β βββ Kruskalβs β βββ Network Flow β β βββ Maximum Flow β β β βββ Ford-Fulkerson β β β βββ Edmonds-Karp β β β βββ Push-Relabel β β β βββ Dinic's β β βββ Minimum Cut β β β βββ Karger's β β βββ Maximum Bipartite β βββ Sorting β β βββ Topological Sort β β βββ Kahn's β β βββ Tarjan's β βββ Connectivity β β βββ Bridge β β βββ Connectivity β β βββ Connected Components β β βββ Strongly Connected Components β β β βββ Kosaraju-Sharir's β β β βββ Tarjan's β β βββ Union-Find β β βββ Quick Find β β βββ Quick Union β β βββ Weighted β β βββ Weighted with Path Compression β βββ Cycle Detection β βββ Is Bipartite β βββ Graph coloring β βββ Eulerian Path β βββ Eulerian Cycle β βββ Hamiltonian Path β βββ Hamiltonian Cycle βββ Divide and Conquer β βββ Binary Search β βββ Merge Sort β βββ Quick Sort β βββ Strassen's Matrix multiplication βββ Recursion β βββ Factorial β βββ Dynamic Programming β β βββ Approaches β β β βββ Top-Down - Memoization β β β βββ Bottom-Up - Tabulation β β βββ Fibonacci Numbers β β βββ BellmanβFord β β βββ Floyd-Warshall β β βββ Levenshtein Distance β β βββ Regular Expression Matching β β βββ Matrix Chain Multiplication β β βββ Binomial Coefficient β βββ Backtracking β βββ Combinatorics β βββ Permutations β βββ Combinations β βββ Subsets β βββ Partitions βββ Greedy β βββ Huffman Coding β βββ Dijkstra's Lazy β βββ Minimum Spanning Tree β βββ Primβs Lazy β βββ Kruskalβs βββ Randomized β βββ Randomized Quick Sort β βββ Fisher-Yates Shuffle β βββ Randomized Quick Select β βββ Las Vegas β βββ Monte Carlo βββ Game Theory β βββ Minimax β βββ Prisoner's Dilemma βββ Geometry β βββ Closest Pair of Points β βββ Line Intersection β βββ Voronoi Diagram β βββ Delaunay Triangulation β βββ Convex Hull β βββ Graham Scan β βββ Jarvis March βββ Bits Operations βββ Math βββ Fibonacci Numbers βββ Factorial βββ Prime Numbers β βββ Sieve of Eratosthenes β βββ Primality Tests β β βββ Trial Division β β βββ Fermat β β βββ Miller-Rabin β βββ Prime Factorizations β βββ Trial Division β βββ Wheel Factorization βββ GCD Euclidean Algorithm βββ Fast Exponentiation βββ Catalan Numbers βββ Binomial Coefficient βββ Pascal Triangle βββ Least Common Multiple (LCM) βββ Sum of Digits βββ Power of Two βββ Euclidean Distance βββ Matrix βββ Inversion βββ Transposition βββ Square Rotation βββ Multiplication βββ Exponentiation βββ Sparse Matrix βββ Chain βββ Strassen's
Data Structures
Data Structures βββ String βββ Arrays β βββ Array β βββ Dynamic Array β βββ Suffix Arrays βββ Linked Lists β βββ Singly β βββ Doubly β βββ Skip List βββ Stacks βββ Queues β βββ Queue β βββ Deque β βββ Circular Queue βββ Hash Tables β βββ HashMap β βββ HashSet β βββ Sparse Vector β βββ Collision Resolution β βββ Separate Chaining β βββ Open Addressing βββ Bloom Filter βββ Trees β βββ Binary Search Tree β βββ Trie-trees β β βββ Prefix Tree - Trie β β βββ Suffix Tree β βββ Heaps β β βββ Binary Heap - Priority Queue β β β βββ Min Heap β β β βββ Max Heap β β βββ Indexed Binary Heap β β βββ Fibonacci Heaps β βββ Self-balanced β β βββ AVL Tree β β βββ Red Black Tree β β βββ B Tree β β β βββ B+ Tree β β βββ 2-3 Tree β β βββ Splay Tree β β βββ Treaps β βββ Cartesian Tree β βββ K-D Tree β βββ Fenwick Tree β βββ Segment Tree βββ Graphs βββ Types β βββ Undirected Graph β βββ Directed Graph β βββ Weighted Undirected Graph β βββ Weighted Directed Graph β βββ Cyclic Graph β βββ Acyclic Graph β βββ Directed Acyclic Graph β βββ Labeled Graph β βββ Bipartite Graph β βββ Tree β βββ Forest β βββ Spanning Tree βββ Representation in memory βββ Adjacency List βββ Adjacency Matrix βββ Edge List
Coding Problems and Techniques
Problems βββ Arrays β βββ Sorting β β βββ Merge Intervals β β βββ Merge Sorted Array β βββ Searching β β βββ Binary Search β β βββ Capacity to Ship Packages Within N Days β β βββ Cutting Ribbons β β βββ Find First and Last Position of Element in Sorted Array β β βββ Find Peak Element β β βββ First Bad Version β β βββ Koko Eating Bananas β β βββ Missing Number β β βββ Search Insert Position β β βββ Search Rotated Sorted Array β βββ Selection β β βββ Kth Closest Points to Origin β β βββ Kth Largest Element in Array β βββ Sliding Window β β βββ Longest Substring Without Repeating Characters β βββ Two Pointers β β βββ Container With Most Water β βββ Matrix β β βββ Game of Life β β βββ Rotate Image β β βββ Search in 2D Matrix β β βββ Set Matrix Zeroes β βββ Maximum Sum Subarray - Kadane's β βββ Prefix Sum β βββ Range Sum βββ Strings β βββ Spelling Correction β βββ Reverse String β βββ Anagram Checking β βββ Palindromes β βββ Palindrome Checking β βββ Palindrome Substrings β βββ Longest Palindromic Substring βββ Linked List β βββ Add Two Numbers β βββ Intersection of Two Linked Lists β βββ Merge Two Sorted Lists β βββ Palindrome Linked List β βββ Remove Nth Node From End of List β βββ Sort List β βββ Cycle β β βββ Linked List Cycle β β βββ Linked List Cycle II β βββ Reversal β β βββ Reverse Linked List β β βββ Reverse Linked List II β βββ Cache β βββ LRU β βββ LFU βββ Stacks β βββ Simplify Path β βββ Valid Parentheses β βββ Basic Calculator II βββ Queues βββ Hash Table β βββ Group Anagrams β βββ Logger Rate Limiter β βββ Roman to Integer β βββ Verifying an Alien Dictionary βββ Trees β βββ Maximum Depth of Binary Tree β βββ Binary Tree Inorder Traversal β βββ Binary Tree Maximum Path Sum β βββ Binary Tree Right Side View β βββ Binary Tree Vertical Order Traversal β βββ Boundary of Binary Tree β βββ Lowest Common Ancestor of a Binary Tree β βββ Diameter of Binary Tree β βββ Invert Binary Tree β βββ Recover Binary Search Tree β βββ Same Tree β βββ Validate Binary Search Tree β βββ Heap β β βββ Merge k Sorted Lists β βββ Trie β β βββ Longest Common Prefix β βββ N-ary Tree β βββ Clone N-ary Tree β βββ Diameter of N-Ary Tree β βββ Maximum Depth of N-ary Tree βββ Graphs β βββ Is Graph Bipartite β βββ Sorting β β βββ Topological Sort β β βββ Alien Dictionary β βββ Searching β βββ BFS β β βββ Number of Islands β β βββ Word Break β β βββ Word Ladder β βββ DFS β βββ Clone Graph β βββ Island Perimeter β βββ Walls and Gates β βββ Spiral Matrix β βββ Word Search βββ Recursion β βββ Dynamic Programming β β βββ Fibonacci Numbers β β βββ Knapsack 0/1 β β βββ Knapsack Unbounded β β βββ Traveling Salesman β β βββ Longest Common Subsequence (LCS) β β βββ Longest Increasing Subsequence (LIS) β β βββ Longest Palindrome Subsequence (LPS) β β βββ Shortest Common Supersequence (SCS) β β βββ Maximum Sum Increasing Subsequence β β βββ Maximum Subarray Sum β β βββ Combination Sum β β βββ Rod Cutting β β βββ Jump Game β β βββ Partition problem β β βββ Russian Dolls Envelope β β βββ Dungeon Game β β βββ Subset Sum problem β β βββ Minimum Path Sum β β βββ Unique Paths in a Grid β β βββ Counting Paths in a Grid β β βββ Wildcard Matching β β βββ Word Break β β βββ Paint House β β βββ Palindrome Partitioning β β βββ Maximum Product Subarray β β βββ Staircase β β βββ Coin Change β βββ Backtracking β βββ Traveling Salesman β βββ N-Queens β βββ Knight's Tour β βββ Sudoku Solver β βββ Unique Paths β βββ Rat in a Maze β βββ Subset Sum β βββ Word Search βββ Greedy β βββ Knapsack β βββ Interval Scheduling β βββ Job Scheduling β βββ Coin Change βββ Game Theory β βββ Guess The Word βββ Bit Manipulation βββ NP-complete problems βββ Traveling Salesman βββ Knapsack Unbounded βββ SAT βββ Clique βββ Factorization βββ Hamiltonian Cycle
Requirements
JDK 8.0 or later.
Development
To open the project in Intellij Idea:
- Go to File menu or the Welcome Screen
- Click on Open...
- Navigate to
algorithms
root directory. - Select
setting.gradle
Georgiy Konovalov 2024 (c) MIT License