Full Code of ahampriyanshu/algo_ds_101 for AI

main ea880b13c09d cached
1380 files
1.9 MB
574.1k tokens
4063 symbols
1 requests
Download .txt
Showing preview only (2,281K chars total). Download the full file or copy to clipboard to get everything.
Repository: ahampriyanshu/algo_ds_101
Branch: main
Commit: ea880b13c09d
Files: 1380
Total size: 1.9 MB

Directory structure:
gitextract_qpjjgosa/

├── .github/
│   ├── ISSUE_TEMPLATE/
│   │   ├── Documentation.yml
│   │   ├── New-Submission.yml
│   │   └── config.yml
│   ├── pull_request_template.md
│   └── workflows/
│       ├── contributors.yml
│       └── welcome.yml
├── 404.md
├── Algorithms/
│   ├── Array/
│   │   ├── Arr4 right shift.c
│   │   ├── InsertArray.c
│   │   ├── LinearSearch.java
│   │   ├── Merge-Sorted-Array.c
│   │   ├── Merge-Sorted-Array.cpp
│   │   ├── Merge-Sorted-Array.js
│   │   ├── Merge-Sorted-Array.py
│   │   ├── Merge_Sorted_Arrays.rb
│   │   ├── Rearrange-High-Low.js
│   │   ├── Rearrange-High-Low.kt
│   │   ├── Remove-Dublicate.js
│   │   ├── Remove-Duplicates-from-Sorted-Array.c
│   │   ├── Remove-Duplicates-from-Sorted-Array.cpp
│   │   ├── Shuffle.c
│   │   ├── Two-Arrays-And-Swaps.c
│   │   ├── check_two_equal_array.cpp
│   │   ├── copyarray.c
│   │   ├── counting_frequency_of_char_in_string.c
│   │   ├── findpos.py
│   │   ├── high-low-rearrangement.c
│   │   ├── high-low-rearrangement.c++
│   │   ├── high-low-rearrangement.py
│   │   ├── largest-smallest-number-and-sum-of-all-elements-in-array.java
│   │   ├── merge-sorted-arrays-algo-only.py
│   │   ├── merge_without_extraspace.cpp
│   │   ├── merging_2_arrays.c
│   │   ├── rearrange-high-low.java
│   │   ├── revering_array.c
│   │   ├── rotate_matrix_90degree.cpp
│   │   ├── rotated_sorted_array_search.cpp
│   │   ├── twoSum.cpp
│   │   ├── twoSum.kt
│   │   └── wave_form_array
│   ├── Backtracking/
│   │   ├── Crossword/
│   │   │   └── Crossword.cpp
│   │   ├── Nqueen/
│   │   │   ├── N_Queen.java
│   │   │   ├── Nqueens.c
│   │   │   ├── Nqueens.cpp
│   │   │   ├── Nqueens_optimized.cpp
│   │   │   ├── nqueen.cpp
│   │   │   └── nqueens.py
│   │   ├── Permutation/
│   │   │   ├── Permutations.c
│   │   │   ├── permutation.py
│   │   │   ├── permutations.cpp
│   │   │   └── permutations.js
│   │   ├── README.md
│   │   └── Rat-In-A-Maze/
│   │       └── Rat-In-A-Maze.cpp
│   ├── Cryptography/
│   │   ├── AES_Cipher/
│   │   │   ├── AES_Cipher.py
│   │   │   └── README.md
│   │   ├── Affine_Cipher/
│   │   │   ├── Affine_Cipher.cpp
│   │   │   ├── Affine_Cipher.py
│   │   │   ├── README.md
│   │   │   └── affine_cipher.c
│   │   ├── Bifid_Cipher/
│   │   │   ├── Bifid_Cipher.py
│   │   │   └── README.md
│   │   ├── CIA_Triad_Ciper/
│   │   │   └── README.md
│   │   ├── Caesar_Cipher/
│   │   │   ├── Caesar Cypher.cpp
│   │   │   ├── Caesar Cypher.py
│   │   │   ├── CaesarCipher.java
│   │   │   ├── Caesar_Cipher.c
│   │   │   ├── Caesar_Cipher.cs
│   │   │   ├── Caesar_Cipher.js
│   │   │   ├── Caesar_Cipher.php
│   │   │   ├── Caesar_Cypher.rb
│   │   │   └── README.md
│   │   ├── README.md
│   │   ├── RSA_Cipher/
│   │   │   ├── README.md
│   │   │   ├── RSA_Cipher.py
│   │   │   ├── RSA_cipher.cpp
│   │   │   └── RSA_cipher.java
│   │   ├── Shamir_Cipher/
│   │   │   ├── Shamir_Cipher.c
│   │   │   └── Shamir_Cipher.cpp
│   │   ├── Vernam_Cipher/
│   │   │   ├── README.md
│   │   │   ├── Vernam_Cipher.cpp
│   │   │   ├── Vernam_Cipher.js
│   │   │   └── Vernam_Cipher.py
│   │   └── Vigenere_Cipher/
│   │       ├── README.md
│   │       ├── Vigenere_Cipher.cpp
│   │       ├── Vigenere_Cipher.py
│   │       ├── Vignere_Cipher.cs
│   │       └── vigenereCipher.py
│   ├── DP/
│   │   ├── 0-1_Knapsack_Problem/
│   │   │   ├── 0-1 Knapsack Problem.java
│   │   │   ├── Branch_And_Bound/
│   │   │   │   └── 0-1_knapsack.cpp
│   │   │   ├── knapsackProblem.java
│   │   │   ├── knapsack_problem_0_1.cpp
│   │   │   └── knapsack_problem_0_1.py
│   │   ├── AdjacentBitCounts.cpp
│   │   ├── AdjacentBitCounts.js
│   │   ├── Bitmask DP/
│   │   │   └── TravellingSalesman.cpp
│   │   ├── Branch_And_Bound/
│   │   │   ├── 0_1_KnapSack.py
│   │   │   └── Knapsack_Branch_and_Bound.java
│   │   ├── Count_Square_Matrices.cpp
│   │   ├── Count_Square_Matrices.py
│   │   ├── Edit_Distance/
│   │   │   ├── Edit_Distance.js
│   │   │   ├── Edit_distance.cpp
│   │   │   ├── README.md
│   │   │   └── edit_distance.py
│   │   ├── Egg_Drop/
│   │   │   ├── Egg_Drop.cpp
│   │   │   ├── Egg_Drop.cs
│   │   │   ├── egg drop.java
│   │   │   ├── egg_drop.py
│   │   │   └── egg_drop.ts
│   │   ├── Fibonacci_Series/
│   │   │   ├── Fibonacci.c
│   │   │   ├── Fibonacci.php
│   │   │   ├── fibonacci.go
│   │   │   ├── fibonacci.js
│   │   │   └── fibonacci.py
│   │   ├── Gauss_Easter_Date/
│   │   │   ├── CalculateEasterDate.java
│   │   │   ├── Gauss_Easter_Date.cpp
│   │   │   ├── Gauss_Easter_Date.php
│   │   │   ├── Gauss_Easter_Date.py
│   │   │   ├── Gauss_Easter_Date.rb
│   │   │   ├── easterDate.cpp
│   │   │   ├── easterDate.go
│   │   │   ├── easterDate.java
│   │   │   └── easterDate.js
│   │   ├── Generate_ATM_Codes.py
│   │   ├── Gold_Mine_Problem/
│   │   │   ├── goldmine.java
│   │   │   └── goldmine.py
│   │   ├── Golomb_Sequence/
│   │   │   ├── Golomb Sequence.cpp
│   │   │   ├── Golomb.cpp
│   │   │   ├── Golomb.java
│   │   │   └── golomb.py
│   │   ├── Knight_Probability/
│   │   │   ├── Knight_Probability_in_a_ChessBoard.cpp
│   │   │   └── Problem_Statement.md
│   │   ├── LCS/
│   │   │   ├── LCS_of_three_strings.py
│   │   │   ├── LongestCommonSubsequence.cpp
│   │   │   ├── LongestCommonSubsequenceLength.java
│   │   │   ├── Longest_Common_Subsequence_of_Three_String.java
│   │   │   ├── Longest_Common_Subsequence_of_Two_Sequences.c
│   │   │   ├── Longest_Common_Subsequence_of_Two_Sequences.cpp
│   │   │   ├── lcs.py
│   │   │   └── lcs_of_3_strings.cpp
│   │   ├── LIS/
│   │   │   ├── LIS.c
│   │   │   ├── LIS.cpp
│   │   │   ├── LIS.go
│   │   │   ├── LIS.java
│   │   │   ├── LongestIncreaseSubSequence.cpp
│   │   │   ├── README.md
│   │   │   └── lis.py
│   │   ├── LSCS/
│   │   │   ├── LSCS.c
│   │   │   ├── LSCS.cpp
│   │   │   ├── lscs.go
│   │   │   ├── lscs.py
│   │   │   └── shortest_common_supersequence.c
│   │   ├── Largest Divisible Subset.cpp
│   │   ├── Largest divisible subset in array/
│   │   │   └── file.py
│   │   ├── Largest_Divisible_Subset.js
│   │   ├── Largest_Divisible_Subsets.java
│   │   ├── Largest_Divisible_Subsets.py
│   │   ├── Largest_Sum_Contiguous_Subarray/
│   │   │   ├── .vscode/
│   │   │   │   ├── c_cpp_properties.json
│   │   │   │   ├── launch.json
│   │   │   │   └── tasks.json
│   │   │   ├── C++_Implementation/
│   │   │   │   ├── Kadane
│   │   │   │   ├── makefile
│   │   │   │   ├── obj/
│   │   │   │   │   ├── functions.o
│   │   │   │   │   └── main.o
│   │   │   │   └── src/
│   │   │   │       ├── functions.cpp
│   │   │   │       ├── include/
│   │   │   │       │   └── functions.h
│   │   │   │       └── main.cpp
│   │   │   ├── Kadane's Algorithm.cpp
│   │   │   ├── LSCS.cpp
│   │   │   ├── LSCS.js
│   │   │   ├── LSCS.swift
│   │   │   └── lscs.c
│   │   ├── MOS_Algorithm.cpp
│   │   ├── Max_Product_Subarray/
│   │   │   └── max_product_subarray.py
│   │   ├── Maximum_Achievable_Coins/
│   │   │   ├── Maximum_Achievable_Coins.php
│   │   │   ├── Maximum_Achievable_coins.c
│   │   │   ├── Maximum_Achievable_coins.java
│   │   │   ├── Maximum_Achievable_coins.py
│   │   │   └── maximum_achievable_coins.cpp
│   │   ├── Minimum_Sum_Descent/
│   │   │   ├── min-sum.c
│   │   │   ├── minsum.cs
│   │   │   ├── minsum.go
│   │   │   └── minsum.ts
│   │   ├── Partition_Sum/
│   │   │   ├── DP_PartitionSum.java
│   │   │   ├── partition_sum.c
│   │   │   ├── partition_sum.cpp
│   │   │   ├── partition_sum.cs
│   │   │   └── partition_sum.php
│   │   ├── README.md
│   │   ├── Recaman's Sequence.c
│   │   ├── Scramble Strings/
│   │   │   └── ScrambleString.cpp
│   │   ├── Shortest_Common_Supersequence/
│   │   │   ├── shortest_common_sequence.java
│   │   │   ├── shortest_common_supersequence.cpp
│   │   │   ├── shortest_common_supersequence.cs
│   │   │   ├── shortest_common_supersequence.js
│   │   │   └── shortest_common_supersequence.py
│   │   ├── Sudoku_Solver/
│   │   │   ├── README.md
│   │   │   ├── SudokuSolver.java
│   │   │   ├── SudokuSolver.py
│   │   │   ├── Sudoku_Solver.cpp
│   │   │   ├── Sudoku_Solver.cs
│   │   │   └── Sudoku_Solver.js
│   │   ├── Target_Sum/
│   │   │   ├── Target_Sum.c
│   │   │   ├── Target_Sum.cpp
│   │   │   ├── Target_Sum.java
│   │   │   ├── Target_Sum.js
│   │   │   └── Target_Sum.py
│   │   ├── Tower_Of_Hanoi/
│   │   │   ├── README.md
│   │   │   ├── TOH.java
│   │   │   ├── Tower_Of_Hanoi.cs
│   │   │   ├── Tower_Of_Hanoi.js
│   │   │   ├── Tower_of_hanoi.ts
│   │   │   ├── tower_of_hanoi.c
│   │   │   ├── tower_of_hanoi.cpp
│   │   │   ├── tower_of_hanoi.go
│   │   │   └── tower_of_hanoi.py
│   │   ├── TrappingWater/
│   │   │   └── TrappingWater.cpp
│   │   ├── Water_Area/
│   │   │   ├── QUESTION.md
│   │   │   ├── Water-area.py
│   │   │   └── water_area.rb
│   │   ├── Z_Algorithm/
│   │   │   ├── README.md
│   │   │   ├── Z-Algorithm.c++
│   │   │   └── Z_Algo.py
│   │   ├── creating an string input function in C.c
│   │   ├── partition_sum.py
│   │   └── rod-cutting-problem.cpp
│   ├── Graph/
│   │   ├── A_Star/
│   │   │   ├── A_star.cpp
│   │   │   ├── A_star.cs
│   │   │   ├── A_star.py
│   │   │   ├── A_star.ts
│   │   │   └── astar.py
│   │   ├── BFS/
│   │   │   ├── BFS.c
│   │   │   ├── BFS.cpp
│   │   │   ├── BFS.go
│   │   │   ├── BFS.java
│   │   │   ├── BFS.py
│   │   │   ├── BFS.rb
│   │   │   ├── README.md
│   │   │   └── bfs.js
│   │   ├── Bellman_Ford/
│   │   │   ├── BellMan_Ford.py
│   │   │   ├── README.md
│   │   │   ├── bellmanFord.cpp
│   │   │   └── bellman_ford.c
│   │   ├── Bidirectional_search/
│   │   │   ├── Bidirectional_Search.py
│   │   │   └── Bidirectional_search.cpp
│   │   ├── Bidirectional_search_algo.py
│   │   ├── DFS/
│   │   │   ├── DFS.cpp
│   │   │   ├── DFS.java
│   │   │   ├── Depth First Search[DFS].cpp
│   │   │   ├── README.md
│   │   │   ├── dfs.js
│   │   │   └── dfs.py
│   │   ├── DSU/
│   │   │   ├── dsu.cpp
│   │   │   └── dsu.py
│   │   ├── Depth First Transversal/
│   │   │   └── DFT.py
│   │   ├── Dijkstra/
│   │   │   ├── Dijikstra.java
│   │   │   ├── Dijkstra.c
│   │   │   ├── Dijkstra.cpp
│   │   │   ├── Dijkstra.cs
│   │   │   ├── Dijkstra.go
│   │   │   ├── Dijkstra.js
│   │   │   ├── Dijkstra.php
│   │   │   ├── README.md
│   │   │   ├── dijkstra_leftist_heap/
│   │   │   │   ├── README.txt
│   │   │   │   ├── WDGraph.cpp
│   │   │   │   ├── WDGraph.h
│   │   │   │   ├── dijkstra.cpp
│   │   │   │   ├── leftistHeap.cpp
│   │   │   │   └── leftistHeap.h
│   │   │   └── djikstra.py
│   │   ├── Flood_Fill/
│   │   │   ├── Flood_Fill.cpp
│   │   │   ├── Flood_Fill.java
│   │   │   ├── Flood_Fill.js
│   │   │   └── flood_fill_algorithm.cs
│   │   ├── Floyd_Warshall/
│   │   │   ├── Floyd_Warshall.c
│   │   │   ├── Floyd_Warshall.cpp
│   │   │   ├── Floyd_Warshall.java
│   │   │   ├── Floyd_Warshall.py
│   │   │   └── README.md
│   │   ├── Hopcroft_Karp/
│   │   │   └── Hopcroft_Karp_algorithm.cpp
│   │   ├── Hungarian_algorithm/
│   │   │   └── Hungarian_algorithm.cpp
│   │   ├── Johnson_algorithm/
│   │   │   └── Johnson_algorithm.cpp
│   │   ├── Karger_algorithm/
│   │   │   ├── Karger_algorithm.cpp
│   │   │   └── sample.txt
│   │   ├── Kosarajus_Algorithm/
│   │   │   ├── kosajaru.rs
│   │   │   ├── kosaraju.ts
│   │   │   └── kosaraju_algorithm_strongly_connected_components.cpp
│   │   ├── Kruskal's_MST/
│   │   │   ├── KruskalMST.c
│   │   │   ├── Kruskal_Algorithm.cpp
│   │   │   ├── README.md
│   │   │   ├── cpp/
│   │   │   │   └── kruskal.cpp
│   │   │   ├── python/
│   │   │   │   └── KruskalMST.py
│   │   │   └── rust/
│   │   │       └── kruskal.rs
│   │   ├── LIS/
│   │   │   └── README.md
│   │   ├── Level order traversal.cpp
│   │   ├── Lowest_Common_Manager/
│   │   │   ├── Lowest_Common_Manager.py
│   │   │   └── QUESTION.md
│   │   ├── Prim's_MST/
│   │   │   ├── Prim's_MST.py
│   │   │   ├── Prims_MST.java
│   │   │   └── README.md
│   │   ├── README.md
│   │   ├── Tarjan's Algorithm/
│   │   │   └── StronglyConnectedComponents.cpp
│   │   ├── Topological Sort/
│   │   │   ├── QUESTION.md
│   │   │   └── topo_sort.py
│   │   ├── Topological sort/
│   │   │   ├── README.md
│   │   │   └── Topological_sort.cpp
│   │   ├── Youngest_Common_Ancestor/
│   │   │   ├── QUESTION.md
│   │   │   ├── YoungerCommonAncestor.cpp
│   │   │   ├── YoungestCommonAncestor.java
│   │   │   └── youngest-comm-anc.py
│   │   ├── articulation_points.py
│   │   ├── flood_fill.py
│   │   ├── lagrange_interpolation.cpp
│   │   ├── lowest_common_manager/
│   │   │   └── lowest_common_manager.java
│   │   └── newton_raphson_method.c
│   ├── Hashing/
│   │   ├── Amicable/
│   │   │   ├── Amicable_Number.rb
│   │   │   ├── Amicable_Numbers..c
│   │   │   ├── Amicable_Numbers.cpp
│   │   │   ├── Amicable_Numbers.java
│   │   │   ├── amicable.cs
│   │   │   ├── amicable.js
│   │   │   ├── amicable.swift
│   │   │   ├── amicable_numbers.php
│   │   │   └── amicable_numbers.py
│   │   ├── Brick_Wall/
│   │   │   ├── Brick_wall.cpp
│   │   │   └── QUESTION.md
│   │   ├── Chaining/
│   │   │   └── chainingHashing.cpp
│   │   ├── Cuckoo_Hashing/
│   │   │   ├── Cuckoo_Hashing.cpp
│   │   │   └── Cuckoo_Hashing.java
│   │   ├── Divisible_Pair_Count/
│   │   │   ├── DivisiblePairCount.c
│   │   │   ├── DivisiblePairCount.go
│   │   │   ├── DivisiblePairCount.java
│   │   │   ├── DivisiblePairCount.js
│   │   │   ├── DivisiblePairCount.py
│   │   │   └── DivsiblePairCount.cpp
│   │   ├── Group_Anagrams/
│   │   │   ├── Group_Anagrams.cpp
│   │   │   ├── QUESTIONS.md
│   │   │   ├── group_anagrams.js
│   │   │   └── group_anagrams.py
│   │   ├── Open Addressing/
│   │   │   ├── doubleHashHashingTable.cpp
│   │   │   ├── linearProbingHashTable.cpp
│   │   │   └── quadraticProbingHashTable.cpp
│   │   └── Recaman_Sequence/
│   │       ├── Recamans_Sequence.java
│   │       ├── Recamans_Sequence.ts
│   │       ├── recaman.py
│   │       ├── recaman_sequence.cpp
│   │       └── recamans_sequence.cs
│   ├── Heap/
│   │   └── README.md
│   ├── LinkedList/
│   │   └── Floyd_Cylce_detection/
│   │       ├── floyd_cycle_detection.cpp
│   │       ├── floyd_cycle_detection.java
│   │       ├── floyd_cycle_detection.kt
│   │       ├── floyd_cycle_detection.py
│   │       └── floyd_cycle_detection.swift
│   ├── Matrix/
│   │   ├── README.md
│   │   └── Spiral-Matrix/
│   │       └── Spiral-Matrix.cpp
│   ├── Merging-Interval/
│   │   ├── #999 merging_intervals.py
│   │   ├── Merging_Intervals.java
│   │   ├── README.md
│   │   ├── merge_intervals.cpp
│   │   └── merge_intervals.js
│   ├── Pattern-Searching/
│   │   ├── Aho-Corasick/
│   │   │   └── Readme.md
│   │   ├── Binary_Search/
│   │   │   └── search_in_2D_matrix.java
│   │   ├── README.md
│   │   └── Substring_Check/
│   │       └── search.php
│   ├── Queue/
│   │   ├── first_negative_integer_in_window.cpp
│   │   ├── first_nonrepeating_char_in_stream.cpp
│   │   └── reversing a queue.cpp
│   ├── README.md
│   ├── Recursion/
│   │   ├── All_Subsets.c
│   │   ├── Combination_Sum/
│   │   │   ├── Combination_Sum.php
│   │   │   └── combination_sum.cpp
│   │   ├── Factorial/
│   │   │   ├── Factorial.c
│   │   │   ├── Factorial.cs
│   │   │   ├── Factorial.go
│   │   │   ├── Factorial_Algorithm.cpp
│   │   │   ├── Factorial_Algorithm.py
│   │   │   ├── factorial.js
│   │   │   └── factorial.py
│   │   ├── Josephus/
│   │   │   ├── Josephus.c
│   │   │   ├── Josephus.cs
│   │   │   ├── Josephus.java
│   │   │   ├── josephus.cpp
│   │   │   └── josephus.kt
│   │   ├── Keypadcodes.cpp
│   │   ├── Permutation/
│   │   │   ├── Permutation.cs
│   │   │   ├── Permutation.js
│   │   │   ├── Permutation.ts
│   │   │   ├── Permutations_Recursion.cpp
│   │   │   └── Permutations_Recursion.py
│   │   └── README.md
│   ├── Searching/
│   │   ├── A-Star Search/
│   │   │   ├── A_Star.ipynb
│   │   │   └── README.md
│   │   ├── Binary-Search/
│   │   │   ├── Binary_Search_CubicRoot.cpp
│   │   │   ├── Binary_search_javascript.js
│   │   │   ├── Koko_Eating_Bananas/
│   │   │   │   ├── KEB.java
│   │   │   │   ├── Koko_Eating_Bananas.cpp
│   │   │   │   ├── Koko_Eating_Bananas.py
│   │   │   │   └── QUESTION.md
│   │   │   ├── README.md
│   │   │   ├── Rotated-Sorted-Array-Search.cs
│   │   │   ├── Rotated-Sorted-Array-Search.js
│   │   │   ├── Rotated-Sorted-Array-Search.py
│   │   │   ├── binarySearch.c
│   │   │   ├── binarySearch.cpp
│   │   │   ├── binarySearch.js
│   │   │   ├── binarySearch.kt
│   │   │   ├── binarySearch.scala
│   │   │   ├── binary_search.cpp
│   │   │   ├── binary_search.java
│   │   │   ├── binarysearch.java
│   │   │   ├── binarysearch.js
│   │   │   ├── binarysearch.php
│   │   │   ├── binarysearch.py
│   │   │   ├── binarysearch.sh
│   │   │   ├── matrix_binary_search.py
│   │   │   └── search_in_2d_matrix.cpp
│   │   ├── Exponential-Search/
│   │   │   ├── exponential_search.cpp
│   │   │   ├── exponential_search.php
│   │   │   └── exponential_search.py
│   │   ├── Fibonacci-Search/
│   │   │   ├── Fibonacci_Search.cpp
│   │   │   ├── Fibonacci_search.java
│   │   │   ├── Fibonacci_search.php
│   │   │   ├── Fibonacci_search_in_C.c
│   │   │   ├── fibonacciSearch.py
│   │   │   ├── fibonacci_search.c
│   │   │   └── fibonacci_search.js
│   │   ├── Interpolation-Search/
│   │   │   ├── IS.cpp
│   │   │   └── IS.py
│   │   ├── Jump-Search/
│   │   │   ├── JumpSearch.java
│   │   │   ├── Jump_Search.cpp
│   │   │   ├── jumpSearch.cs
│   │   │   ├── jumpSearch.go
│   │   │   ├── jumpSearch.js
│   │   │   ├── jumpSearch.ts
│   │   │   └── jump_search.py
│   │   ├── Linear-Search/
│   │   │   ├── LINEAR_SEARH.cpp
│   │   │   ├── LinearSearch.js
│   │   │   ├── Linear_Search.cpp
│   │   │   ├── Linear_Search.go
│   │   │   ├── Linear_Search.py
│   │   │   ├── Linearsearch.c
│   │   │   ├── README.md
│   │   │   ├── linear_search.java
│   │   │   └── linear_search.sh
│   │   ├── README.md
│   │   ├── Sublist-Search/
│   │   │   ├── Sublist_Search.php
│   │   │   ├── sublist_search.cpp
│   │   │   ├── sublist_search.cs
│   │   │   ├── sublist_search.java
│   │   │   ├── sublist_search.js
│   │   │   └── sublist_search.py
│   │   ├── Ternary-Search/
│   │   │   ├── README.md
│   │   │   ├── Ternary-String.c
│   │   │   ├── ternarySearch.cpp
│   │   │   ├── unimodal_func.cpp
│   │   │   ├── unimodal_func.java
│   │   │   ├── unimodal_func.js
│   │   │   └── unimodal_func.py
│   │   └── Trie-Search/
│   │       ├── Trie Data Structure.cpp
│   │       ├── Trie1_HashMap.java
│   │       ├── TrieDataStructure.java
│   │       ├── Trie_Search.cpp
│   │       ├── Trie_Search.go
│   │       └── Trie_Search.py
│   ├── Sorting/
│   │   ├── 3-Way_Quick_Sort/
│   │   │   ├── 3-Way_Quick_Sort.cpp
│   │   │   ├── 3-Way_Quick_Sort.cs
│   │   │   ├── 3-Way_Quick_Sort.java
│   │   │   └── 3_Way_Quick_Sort.c
│   │   ├── Bead_Sort/
│   │   │   ├── Bead_Sort.php
│   │   │   ├── Bead_Sort.rb
│   │   │   ├── Bead_sort.cpp
│   │   │   ├── README.md
│   │   │   └── bead_sort.py
│   │   ├── Binary_Insertion_Sort/
│   │   │   ├── Binary Insertion Sort.c
│   │   │   ├── Binary_Insertion_Sort.cpp
│   │   │   ├── Binary_Insertion_Sort.py
│   │   │   └── Readme.md
│   │   ├── Bitonic_Search/
│   │   │   ├── BitonicSort.java
│   │   │   ├── Bitonic_sort.c
│   │   │   ├── Readme.md
│   │   │   └── bitonic_search.py
│   │   ├── Brick_Sort/
│   │   │   ├── BrickSort.js
│   │   │   ├── Brick_Sort.c
│   │   │   ├── Readme.md
│   │   │   └── brickSort.py
│   │   ├── Bubble_Sort/
│   │   │   ├── BubbleSort.js
│   │   │   ├── BubbleSort.scala
│   │   │   ├── Bubble_Sort.c
│   │   │   ├── Bubble_Sort.cs
│   │   │   ├── Bubble_Sort.py
│   │   │   ├── Bubble_sort_optimised.cpp
│   │   │   ├── bubbleSort.cpp
│   │   │   ├── bubble_sort.java
│   │   │   ├── bubble_sort.sh
│   │   │   └── readme.md
│   │   ├── Bucket_Sort/
│   │   │   ├── BucketSort.c
│   │   │   ├── BucketSort.java
│   │   │   ├── BucketSort.js
│   │   │   ├── BucketSort.py
│   │   │   ├── README.md
│   │   │   ├── bucket_sort.cpp
│   │   │   ├── bucketsort.php
│   │   │   ├── bucketsort.rb
│   │   │   └── bucketsortinC.c
│   │   ├── Circle_Sort/
│   │   │   ├── Circle_Sort.c
│   │   │   ├── Circle_Sort.cs
│   │   │   ├── Circle_Sort.java
│   │   │   ├── Circle_Sort.rb
│   │   │   └── README.md
│   │   ├── Cocktail_Sort/
│   │   │   ├── Cocktail_Sort.c
│   │   │   ├── Cocktail_Sort.cpp
│   │   │   ├── Cocktail_Sort.java
│   │   │   ├── Cocktail_Sort.py
│   │   │   ├── README.md
│   │   │   └── cocktail_sort.js
│   │   ├── Comb_Sort/
│   │   │   ├── Comb_Sort.c
│   │   │   ├── Comb_Sort.cpp
│   │   │   ├── README.md
│   │   │   ├── comb.py
│   │   │   └── comb_sort.rb
│   │   ├── Counting_Sort/
│   │   │   ├── Count_sort.py
│   │   │   ├── Counting_Sort.c
│   │   │   ├── Counting_Sort.cs
│   │   │   ├── Counting_Sort.java
│   │   │   ├── Counting_sort.js
│   │   │   ├── README.md
│   │   │   ├── counting_sort.py
│   │   │   └── countingsort.py
│   │   ├── Cycle_Sort/
│   │   │   ├── CYCLESort.cs
│   │   │   ├── Cyclesort.py
│   │   │   ├── README.md
│   │   │   ├── cyclesort.c
│   │   │   └── stoogesort.java
│   │   ├── Gnome_Sort/
│   │   │   ├── Gnome_Sort.cs
│   │   │   ├── Gnome_Sort.java
│   │   │   ├── Gnome_Sort.php
│   │   │   ├── Gnome_Sort.py
│   │   │   └── gnomeSort.java
│   │   ├── Heap_Sort/
│   │   │   ├── Heap_Sort.js
│   │   │   ├── Heap_Sort.swift
│   │   │   ├── Max_heap_sort.cpp
│   │   │   ├── README.md
│   │   │   ├── heap-sort.c
│   │   │   ├── heap-sort.php
│   │   │   ├── heap-sort.py
│   │   │   ├── heap-sort.rb
│   │   │   ├── heap_sort.cpp
│   │   │   ├── heap_sort.go
│   │   │   ├── heap_sort.java
│   │   │   └── heapsorting.py
│   │   ├── Insertion_Sort/
│   │   │   ├── InsertSort.py
│   │   │   ├── Insertion Sort.cpp
│   │   │   ├── InsertionSort.java
│   │   │   ├── InsertionSort.py
│   │   │   ├── InsertionSort.scala
│   │   │   ├── Insertion_Sort.cpp
│   │   │   ├── Insertion_Sort.swift
│   │   │   ├── Insertion_sort_2.cpp
│   │   │   ├── README.md
│   │   │   ├── insertion_sort.py
│   │   │   └── insertion_sort.ts
│   │   ├── Merge_Sort/
│   │   │   ├── Application of Merge Sort/
│   │   │   │   ├── Count_Inversions.c
│   │   │   │   └── Count_Inversions.cpp
│   │   │   ├── MERGE_SORT.c
│   │   │   ├── MERGE_SORT.cpp
│   │   │   ├── MERGE_SORT.java
│   │   │   ├── MERGE_SORT.js
│   │   │   ├── MergeSort.scala
│   │   │   ├── Non_recursive_merge_sort.cpp
│   │   │   ├── README.md
│   │   │   ├── mergeSort.py
│   │   │   ├── merge_Sort.rb
│   │   │   ├── mergesort.sh
│   │   │   ├── non_recursive_merge_sort.c
│   │   │   ├── non_recursive_merge_sort.cs
│   │   │   └── non_recursive_merge_sort.py
│   │   ├── Merge_Sort_on_Doubly_Linked_List/
│   │   │   ├── Mergesort_doubly.c
│   │   │   ├── Mergesort_doubly.cpp
│   │   │   ├── Mergesort_doubly.java
│   │   │   └── Mergesort_doubly.py
│   │   ├── Pancake_Sort/
│   │   │   ├── PancakeSort.java
│   │   │   ├── Pancake_Sort.c
│   │   │   ├── Pancake_Sort.c++
│   │   │   ├── Pancake_Sort.cs
│   │   │   ├── Pancake_Sort.js
│   │   │   ├── Pancake_Sort.py
│   │   │   ├── Pancake_Sort.rb
│   │   │   └── README.md
│   │   ├── Patience_Sort/
│   │   │   ├── PatienceSort.cs
│   │   │   ├── Patience_sort.cpp
│   │   │   └── README.md
│   │   ├── Patience_sort.py
│   │   ├── Pigeonhole_Sort/
│   │   │   ├── PigeonholeSort.cpp
│   │   │   ├── PigeonholeSort.ts
│   │   │   ├── Pigeonhole_Sort.c
│   │   │   ├── Pigeonhole_Sort.java
│   │   │   └── pigeonhole.py
│   │   ├── Quick_Select/
│   │   │   ├── QuickSelect.cpp
│   │   │   ├── Quick_Select.js
│   │   │   ├── Quick_Select.php
│   │   │   ├── Quick_select.py
│   │   │   ├── README.md
│   │   │   ├── quick_select.java
│   │   │   └── quick_select.rb
│   │   ├── Quick_Sort/
│   │   │   ├── QuickSort.java
│   │   │   ├── QuickSort.js
│   │   │   ├── QuickSort.py
│   │   │   ├── Quick_Sort.cpp
│   │   │   ├── Quick_Sort.go
│   │   │   ├── Quick_Sort.sh
│   │   │   ├── README.md
│   │   │   ├── quicksort.C
│   │   │   └── quicksort.c
│   │   ├── README.md
│   │   ├── Radix_Sort/
│   │   │   ├── README.md
│   │   │   ├── Radix Sort With C (Mayukh Mitra)/
│   │   │   │   ├── Radix_sort.c
│   │   │   │   └── r
│   │   │   ├── RadixSort.java
│   │   │   ├── RadixSort.py
│   │   │   ├── Radix_Sort.js
│   │   │   ├── Radix_Sort.rb
│   │   │   ├── Radix_sort.cs
│   │   │   ├── radixSort.php
│   │   │   └── radixsort.cpp
│   │   ├── Selection_Algorithms.cpp
│   │   ├── Selection_Sort/
│   │   │   ├── README.md
│   │   │   ├── Selection Sort.py
│   │   │   ├── SelectionSort.java
│   │   │   ├── SelectionSort.py
│   │   │   ├── SelectionSort.scala
│   │   │   ├── Selection_Sort.cpp
│   │   │   ├── Selection_Sort.go
│   │   │   ├── selection sort.cs
│   │   │   ├── selection_sort.c
│   │   │   └── selection_sort.rb
│   │   ├── Shell_Sort/
│   │   │   ├── README.md
│   │   │   ├── Shell_Sort.c
│   │   │   ├── Shell_Sort.cpp
│   │   │   ├── Shell_Sort.cs
│   │   │   ├── Shell_Sort.java
│   │   │   ├── Shell_Sort.js
│   │   │   ├── Shell_Sort.swift
│   │   │   ├── shell_sort.py
│   │   │   └── shell_sort.sh
│   │   ├── Stooge_Sort/
│   │   │   ├── README.md
│   │   │   ├── Stooge_Sort.cs
│   │   │   ├── Stooge_Sort.go
│   │   │   └── Stooge_Sort.py
│   │   ├── Strand_Sort/
│   │   │   ├── README.md
│   │   │   ├── Strand_Sort.cpp
│   │   │   ├── Strand_sort.java
│   │   │   ├── strand_sort.c
│   │   │   └── strand_sort.ts
│   │   ├── Tim_Sort/
│   │   │   ├── README.md
│   │   │   ├── Tim_Sort.c
│   │   │   ├── Tim_Sort.java
│   │   │   └── Tim_Sort.py
│   │   ├── Topological_Sort/
│   │   │   ├── README.md
│   │   │   ├── Topological_Sort.cpp
│   │   │   ├── Topological_sort.cs
│   │   │   └── Topological_sort.py
│   │   ├── Tree_Sort/
│   │   │   ├── README.md
│   │   │   ├── Tree_Sort.c
│   │   │   ├── tree sort.cpp
│   │   │   └── treesort.java
│   │   └── Wave_Sort/
│   │       ├── Wave_Sort.py
│   │       ├── wave_sort.c
│   │       └── wave_sort.cpp
│   ├── Stack-Algorithm/
│   │   ├── Next_Greater_Element.cpp
│   │   ├── RemoveKDigitsToGetSmallestPossibleInteger.java
│   │   ├── Simplify-Path/
│   │   │   ├── QUESTION.md
│   │   │   └── Simplify_Path.cpp
│   │   ├── balanced_brackets_stack.cpp
│   │   ├── immediate_smaller_element.cpp
│   │   └── longest_valid_substring.cpp
│   ├── String/
│   │   ├── Anagram/
│   │   │   ├── AnagramChecker.c
│   │   │   ├── anagram c#.cs
│   │   │   ├── anagram.c
│   │   │   ├── anagram.java
│   │   │   ├── anagram.py
│   │   │   ├── anagram.swift
│   │   │   └── anagrams.sh
│   │   ├── Isomorphic/
│   │   │   ├── Isomorphic-String.java
│   │   │   └── isomorphic.cpp
│   │   ├── KMP/
│   │   │   ├── KMP_Algorithm.php
│   │   │   ├── kmp.cpp
│   │   │   └── kmp.js
│   │   ├── LCS/
│   │   │   ├── LCS.py
│   │   │   └── lcs.cpp
│   │   ├── LPS/
│   │   │   ├── longest_palindromic_substring.c
│   │   │   ├── longest_palindromic_substring.cpp
│   │   │   ├── longest_palindromic_substring.java
│   │   │   ├── longest_palindromic_substring.js
│   │   │   ├── longest_palindromic_substring.py
│   │   │   └── longest_palindromic_substring.rb
│   │   ├── Palindrome/
│   │   │   ├── Palindrome.c
│   │   │   ├── Palindrome.cs
│   │   │   ├── Palindrome.java
│   │   │   ├── isPalindrome.cpp
│   │   │   ├── isPalindrome.py
│   │   │   ├── palindrome.go
│   │   │   ├── palindrome.java
│   │   │   ├── palindrome.js
│   │   │   ├── palindrome.php
│   │   │   ├── palindrome.py
│   │   │   ├── palindrome.swift
│   │   │   ├── palindrome.ts
│   │   │   └── palindromecheck.go
│   │   ├── README.md
│   │   ├── Rabin-Karp/
│   │   │   ├── RabinKarpAlgo.java
│   │   │   ├── Rabin_Karp.cpp
│   │   │   ├── Rabin_Karp.ts
│   │   │   ├── Rabin_karp.c
│   │   │   └── rabin_karp.py
│   │   ├── SCS/
│   │   │   └── SCS.cpp
│   │   ├── ScrambleString.java
│   │   └── suffix_array.cpp
│   └── Tree/
│       ├── Binary_Lifting/
│       │   ├── Binary Lifting.py
│       │   └── Binary-Lifting.cpp
│       ├── GenericTreeImplementation/
│       │   ├── GenericTree.c
│       │   ├── GenericTree.cpp
│       │   └── GenericTree.java
│       ├── LCA/
│       │   ├── LCA.cpp
│       │   ├── LCA.cs
│       │   ├── LCA.js
│       │   └── LCA.py
│       ├── Max_Heap_Construction/
│       │   └── minmaxheap.cpp
│       ├── Max_Path_Sum_BST/
│       │   ├── Max_Path_Sum_BST.cpp
│       │   └── Max_Path_Sum_BST.py
│       ├── Min_Heap_Construction/
│       │   ├── README.md
│       │   ├── min-heap-construc.cpp
│       │   └── min-heap-construc.py
│       ├── README.md
│       ├── Sorted-Array-To-BST/
│       │   └── Sorted-Array-To-BST.cpp
│       ├── Sorted_Array_To_BST/
│       │   └── SortedArrayToBST.java
│       ├── Validate_BST/
│       │   ├── Validate_BST.cpp
│       │   ├── Validate_BST.cs
│       │   └── Validate_BST.java
│       └── level_traversing/
│           ├── level_traversing.php
│           └── level_traversing.py
├── CNAME
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── CONTRIBUTORS.md
├── Collection/
│   ├── ArrayDeque/
│   │   ├── ArrayDeque.java
│   │   └── README.md
│   ├── ArrayList/
│   │   ├── ArrayList .java
│   │   └── README.md
│   ├── HashMap/
│   │   ├── HashMap.java
│   │   └── README.md
│   ├── HashSet/
│   │   ├── HashSet.java
│   │   └── README.md
│   ├── LinkedList/
│   │   ├── LinkedHashSet/
│   │   │   └── README.md
│   │   ├── LinkedList.java
│   │   └── README.md
│   ├── Queue/
│   │   ├── Deque/
│   │   │   ├── Deque.java
│   │   │   └── README.md
│   │   ├── PriorityQueue/
│   │   │   ├── PriorityQueue.java
│   │   │   └── README.md
│   │   ├── Queue.java
│   │   └── README.md
│   ├── README.md
│   ├── Stack/
│   │   ├── README.md
│   │   └── StackCollection.java
│   └── Vector/
│       ├── README.md
│       └── Vector.java
├── DOCUMENTATION.md
├── Data-Structures/
│   ├── Array/
│   │   ├── Array.c
│   │   ├── Array.cpp
│   │   ├── Array.go
│   │   ├── Array.java
│   │   ├── Array.js
│   │   ├── Array.py
│   │   ├── Array.ts
│   │   ├── README.md
│   │   └── array_menudriven.cpp
│   ├── Graph/
│   │   ├── GraphUsingList.kt
│   │   ├── README.md
│   │   ├── UsingList.cpp
│   │   ├── UsingList.py
│   │   ├── UsingMatrix.cpp
│   │   └── graph_implementation_in_C_bfs_dfs.c
│   ├── HashMap/
│   │   └── README.md
│   ├── HashSet/
│   │   ├── Hash-Set.c
│   │   └── README.md
│   ├── Heap/
│   │   └── README.md
│   ├── LinkedList/
│   │   ├── Circular_Linked_List/
│   │   │   ├── CircularLinkedList.c
│   │   │   ├── CircularLinkedList.java
│   │   │   ├── Circular_Link_List.cpp
│   │   │   ├── README.md
│   │   │   ├── circularLinkedList.js
│   │   │   ├── circularLinkedList.py
│   │   │   └── csharp/
│   │   │       └── CircularLinkedList.cs
│   │   ├── Doubly_Linked_List/
│   │   │   ├── Double linked List circular with double headers C++/
│   │   │   │   ├── LDLCCED.cbp
│   │   │   │   ├── LDLCCED.layout
│   │   │   │   ├── dllist.cpp
│   │   │   │   ├── dllist.h
│   │   │   │   ├── dlnode.cpp
│   │   │   │   ├── dlnode.h
│   │   │   │   ├── listexception.h
│   │   │   │   ├── main.cpp
│   │   │   │   └── nodeexception.h
│   │   │   ├── DoubleLinkedList.java
│   │   │   ├── DoublyLinkedList.cs
│   │   │   ├── DoublyLinkedList.hs
│   │   │   ├── DoublyLinkedList_C++_Template/
│   │   │   │   ├── DLL.h
│   │   │   │   └── DLLtest.cpp
│   │   │   ├── Doubly_Linked_List.py
│   │   │   ├── README.md
│   │   │   ├── double_linked_list.c
│   │   │   ├── doubly.c
│   │   │   ├── doubly_ll.py
│   │   │   └── simple linked list circular without header/
│   │   │       ├── LSLCSE.cbp
│   │   │       ├── LSLCSE.layout
│   │   │       ├── main.cpp
│   │   │       ├── sllist.cpp
│   │   │       ├── sllist.h
│   │   │       ├── slnode.cpp
│   │   │       └── slnode.h
│   │   ├── README.md
│   │   ├── Singly_Linked_List/
│   │   │   ├── Delete_Kth_Node_From_End/
│   │   │   │   ├── Delete_Kth_Node_From_End.cpp
│   │   │   │   ├── Delete_Kth_Node_From_End.java
│   │   │   │   ├── Delete_Kth_Node_From_End.py
│   │   │   │   └── Delete_Kth_Node_From_End.rb
│   │   │   ├── Detect_Cycle/
│   │   │   │   ├── CycleDetection.c
│   │   │   │   ├── CycleDetection.java
│   │   │   │   ├── DetectCycle.cpp
│   │   │   │   ├── DetectCycle.py
│   │   │   │   ├── DetectCycle.ts
│   │   │   │   ├── Detect_Cycle.js
│   │   │   │   ├── detect_cycle.cs
│   │   │   │   └── detect_cycle.go
│   │   │   ├── Java/
│   │   │   │   └── PalindromeLinkedList.java
│   │   │   ├── LinkedList.cs
│   │   │   ├── LinkedList.java
│   │   │   ├── LinkedList.py
│   │   │   ├── LinkedListAndOperations.cpp
│   │   │   ├── LoopDetection.cpp
│   │   │   ├── MiddleElementLL.cpp
│   │   │   ├── MiddleElementLinkedList.java
│   │   │   ├── Palindrome.ts
│   │   │   ├── PalindromeLinkedList.cpp
│   │   │   ├── PalindromeLinkedList.js
│   │   │   ├── README.md
│   │   │   ├── Remove duplicates from linked_list.c
│   │   │   ├── Remove duplicates in a Linked List.cpp
│   │   │   ├── Remove_Duplicates_in_LL.py
│   │   │   ├── Reversed_Linked_List/
│   │   │   │   ├── ReversedLinkedList.js
│   │   │   │   └── reverseLinkedList.c
│   │   │   ├── Sublist_Search.rb
│   │   │   ├── linked list.c
│   │   │   ├── linked.cpp
│   │   │   ├── linkedlist.cpp
│   │   │   ├── merge2sortedlinkedlists.cpp
│   │   │   ├── middle.ts
│   │   │   └── singly_linked_list.hs
│   │   ├── detect_cycle.rb
│   │   └── sparce matrix/
│   │       └── sparce addition.cpp
│   ├── Queue/
│   │   ├── Circular-Queue/
│   │   │   ├── circular_queue.c
│   │   │   ├── circular_queue.cs
│   │   │   ├── circular_queue_LL.c
│   │   │   ├── circular_queue_array_implementation.c
│   │   │   └── cirqueue.cpp
│   │   ├── Deque/
│   │   │   ├── Deque.cpp
│   │   │   ├── Deque.java
│   │   │   ├── Deque.js
│   │   │   ├── Deque.py
│   │   │   ├── Deque.ts
│   │   │   └── README.md
│   │   ├── Priority-Queue/
│   │   │   ├── Priority-Queue.cpp
│   │   │   ├── PriorityQueue.php
│   │   │   ├── README.md
│   │   │   └── priorityQueue.js
│   │   ├── QueueUsingArray.c
│   │   ├── QueueUsingArray.cpp
│   │   ├── QueueUsingArray.go
│   │   ├── QueueUsingArray.java
│   │   ├── QueueUsingArray.js
│   │   ├── QueueUsingArray.py
│   │   ├── QueueUsingArray.rb
│   │   ├── QueueUsingArray.swift
│   │   ├── QueueUsingLL.c
│   │   ├── QueueUsingLL.cpp
│   │   ├── QueueUsingLL.cs
│   │   ├── QueueUsingLL.php
│   │   ├── QueueUsingStacks.cpp
│   │   └── README.md
│   ├── README.md
│   ├── Stack/
│   │   ├── Infix_to_prefix_postfix.cpp
│   │   ├── README.md
│   │   ├── StackUsingArray.c
│   │   ├── StackUsingArray.cpp
│   │   ├── StackUsingArray.cs
│   │   ├── StackUsingArray.go
│   │   ├── StackUsingArray.hs
│   │   ├── StackUsingArray.java
│   │   ├── StackUsingArray.js
│   │   ├── StackUsingArray.php
│   │   ├── StackUsingArray.rb
│   │   ├── StackUsingArray.swift
│   │   ├── StackUsingLL.cpp
│   │   ├── StackUsingLL.go
│   │   ├── StackUsingLL.java
│   │   ├── StackUsingLL.js
│   │   ├── StackUsingLL.py
│   │   ├── stackUsingLinkedList.c
│   │   └── stackusingLL.c
│   └── Tree/
│       ├── 23-Tree/
│       │   ├── 23Tree.cpp
│       │   └── 23Tree.py
│       ├── AVL-Tree/
│       │   ├── AVL_Tree.java
│       │   ├── AVL_Tree.py
│       │   ├── AVLtree.c
│       │   ├── README.md
│       │   └── avl_tree.py
│       ├── Binary-Indexed-Tree/
│       │   ├── Binary-Indexed-Tree.c
│       │   ├── Binary-Indexed-Tree.go
│       │   ├── Binary-Indexed-Tree.java
│       │   └── Binary-Indexed-Tree.py
│       ├── Binary-Search-Tree/
│       │   ├── BST.cs
│       │   ├── BST_balanced.cpp
│       │   ├── BinarySearchTree.go
│       │   ├── BinarySearchTree.java
│       │   ├── Binary_Search_Tree.cpp
│       │   ├── Binary_Search_Tree.py
│       │   ├── Binary_Search_Tree_operations.cpp
│       │   ├── LCA.py
│       │   ├── README.md
│       │   ├── Validate_BST.py
│       │   ├── Vertcal_order_traversal.py
│       │   ├── inorder_transversal.c
│       │   ├── operationBST.cpp
│       │   ├── postorder_transversal.c
│       │   └── valid BST
│       ├── Binary-Tree/
│       │   ├── BTree.cpp
│       │   ├── Binary tree using C.c
│       │   ├── Btree.java
│       │   ├── Check_duplicates_in _BTree.java
│       │   ├── Density/
│       │   │   ├── DensityBtree.c
│       │   │   └── DensityBtree.cpp
│       │   ├── Deserialize/
│       │   │   └── Deserialize.rb
│       │   ├── Duplicate_values.cs
│       │   ├── Invert_Binary_Tree/
│       │   │   ├── Invert_Binary_Tree.py
│       │   │   ├── invertBinTree.rb
│       │   │   └── invert_binary_tree.cpp
│       │   ├── Invert_Binary_tree/
│       │   │   └── invert_btree.swift
│       │   ├── Right_View/
│       │   │   ├── RightViewBTree.java
│       │   │   ├── rightViewBinTree.rb
│       │   │   ├── right_view.py
│       │   │   ├── right_view.swift
│       │   │   └── right_view_of_binary_tree.cpp
│       │   ├── Serialize/
│       │   │   ├── Serialize.cpp
│       │   │   └── Serialize.py
│       │   ├── Subtree_check/
│       │   │   └── Subtree_check.cpp
│       │   ├── SymmetricBTree.java
│       │   ├── SymmetryBTree/
│       │   │   └── SymmetryBTree.rb
│       │   ├── SymmetryBTree.cs
│       │   ├── SymmetryBTree.py
│       │   ├── Two_level_Node/
│       │   │   └── two_level_Node.cpp
│       │   ├── Two_level_Node.java
│       │   ├── VerticalOrderTraversal.java
│       │   ├── VerticalOrderTraversal.py
│       │   ├── Vertical_Sum/
│       │   │   ├── Verticle_sum_of_BinaryTree.java
│       │   │   └── Verticle_sum_of_Binary_Tree.cpp
│       │   ├── b_tree.cpp
│       │   ├── b_tree.java
│       │   ├── b_tree.js
│       │   ├── b_tree.py
│       │   ├── binary_tree_trans.cpp
│       │   ├── duplicate_values.cpp
│       │   ├── duplicate_values.py
│       │   ├── duplicate_values.rb
│       │   ├── subtree_check.cpp
│       │   ├── symmetry_bTree.cpp
│       │   └── two_level_node.py
│       ├── Expression Tree/
│       │   └── Expression_Tree.cpp
│       ├── Fibonacci-Heap/
│       │   └── Fibonacci-Heap.c
│       ├── Generic Tree/
│       │   └── GenericTree.cpp
│       ├── README.md
│       ├── Red-Black-Tree/
│       │   ├── Red-Black-Tree.c
│       │   ├── Red-Black-Tree.cpp
│       │   ├── Red-Black-Tree.java
│       │   └── Red-Black-Tree.py
│       ├── Segment-Tree/
│       │   └── Segment-Tree.c
│       ├── Splay-Tree/
│       │   └── Splay-Tree.c
│       ├── Threaded Binary Tree/
│       │   └── Threaded_Binary_Tree.cpp
│       └── Trie/
│           ├── README.md
│           ├── Trie.c
│           ├── trie.cpp
│           └── trie.py
├── LICENSE
├── Maths/
│   ├── Algebra/
│   │   ├── Babylionian/
│   │   │   ├── Babylionian.cs
│   │   │   ├── Babylionian.go
│   │   │   └── Babylonian.java
│   │   ├── Babylonian/
│   │   │   ├── Babylonian.js
│   │   │   └── babylonian_square_root.c
│   │   ├── Derivative_Of_Polynomial/
│   │   │   ├── Matrix_Multiplication.c
│   │   │   └── README.md
│   │   ├── Diophantine/
│   │   │   └── README.md
│   │   ├── Factorial/
│   │   │   ├── Factorial.hs
│   │   │   ├── Factorial.java
│   │   │   ├── README.md
│   │   │   ├── factorial.c
│   │   │   ├── factorial.cpp
│   │   │   ├── factorial.cs
│   │   │   ├── factorial.go
│   │   │   ├── factorial.js
│   │   │   ├── factorial.php
│   │   │   ├── factorial.py
│   │   │   ├── factorial.rb
│   │   │   ├── factorial.sh
│   │   │   ├── factorial.swift
│   │   │   └── factorial.ts
│   │   ├── Factorial_of_Large_Number/
│   │   │   ├── Factorial_of_Large_Number.cs
│   │   │   ├── Factorial_of_Large_Number.hs
│   │   │   ├── Factorial_of_Large_Number.js
│   │   │   ├── Factorial_of_Large_Number.php
│   │   │   ├── Factorial_of_large_number.c
│   │   │   ├── README.md
│   │   │   ├── bigfactorial.cpp
│   │   │   └── largeFactorial.java
│   │   ├── GCD/
│   │   │   ├── EuclidGCD.swift
│   │   │   ├── Euclidean_gcd.py
│   │   │   ├── EuclidianGCD.py
│   │   │   ├── GCD.cpp
│   │   │   ├── GCD.cs
│   │   │   ├── GCD.js
│   │   │   ├── GCD.php
│   │   │   ├── GCD.py
│   │   │   ├── GCD.rb
│   │   │   ├── GCD.sh
│   │   │   ├── README.md
│   │   │   └── gcd.java
│   │   ├── Inverse_of_a_Matrix/
│   │   │   └── README.md
│   │   ├── LCM/
│   │   │   ├── LCM.c
│   │   │   ├── LCM.cpp
│   │   │   ├── LCM.java
│   │   │   ├── LCM.js
│   │   │   ├── LCM.py
│   │   │   ├── LCM.sh
│   │   │   ├── LCM_GCD.c
│   │   │   ├── LCM_python.py
│   │   │   └── README.md
│   │   ├── Markov_Matrix/
│   │   │   ├── MarkovMatrix.java
│   │   │   ├── Markov_Matrix.c++
│   │   │   ├── Markov_Matrix.cs
│   │   │   └── Markov_Matrix.js
│   │   ├── Matrix_Multipication/
│   │   │   ├── MatMul.cpp
│   │   │   ├── MatrixMultipication.py
│   │   │   ├── MatrixMultiply.java
│   │   │   ├── Matrix_Multiplication.js
│   │   │   ├── README.md
│   │   │   ├── multiply.c
│   │   │   ├── multiply.cpp
│   │   │   ├── multiply.java
│   │   │   ├── multiply.php
│   │   │   └── multiply.py
│   │   ├── Permutation_And_Combination/
│   │   │   ├── Permutations_Combinations.ipynb
│   │   │   ├── README.md
│   │   │   ├── permutation_combination.cpp
│   │   │   └── permutation_combination.js
│   │   ├── Prime_Factorization/
│   │   │   ├── PrimeFactorisation.cpp
│   │   │   ├── Prime_Factor.c
│   │   │   ├── Prime_Factorisation.cpp
│   │   │   ├── Prime_Factorization.cs
│   │   │   ├── README.md
│   │   │   ├── prime-factorisation.js
│   │   │   ├── prime.cpp
│   │   │   ├── prime_factorization.cpp
│   │   │   ├── prime_factorization.java
│   │   │   ├── prime_factorization.py
│   │   │   └── prime_factorization.ts
│   │   ├── Quadratic_Formula/
│   │   │   ├── Quadratic_Formula.cpp
│   │   │   ├── Quadratic_Formula.hs
│   │   │   ├── Quadratic_Formula.sh
│   │   │   ├── README.md
│   │   │   └── quadraticformula.py
│   │   ├── README.md
│   │   ├── Sieve of Eratosthenes/
│   │   │   ├── SieveOfEratosthenes.cpp
│   │   │   ├── SieveOfEratosthenes.py
│   │   │   ├── SieveOfEratosthens.c
│   │   │   └── SieveofEratosthenes.java
│   │   ├── Strassens_Algorithm/
│   │   │   ├── README.md
│   │   │   ├── Strassen.java
│   │   │   ├── Strassens_Algorithm.c++
│   │   │   └── strassens.py
│   │   ├── Taylor-Expansion/
│   │   │   └── README.md
│   │   └── Vertex_Formula/
│   │       └── README.md
│   ├── Calculus/
│   │   ├── Euler_Approximation/
│   │   │   ├── Euler_Approximation.c
│   │   │   ├── Euler_Approximation.cpp
│   │   │   ├── Euler_Approximation.java
│   │   │   ├── Euler_Approximation.py
│   │   │   └── README.md
│   │   ├── Leibniz_formula/
│   │   │   ├── LeibnizFormula.py
│   │   │   ├── Leibniz_Formula.java
│   │   │   ├── Leibniz_formula.cpp
│   │   │   └── README.md
│   │   ├── Probability_Density_Functions/
│   │   │   └── README.md
│   │   ├── README.md
│   │   ├── Riemann_Sum/
│   │   │   ├── README.md
│   │   │   ├── Riemann.py
│   │   │   ├── Riemann_Sum.cpp
│   │   │   ├── Riemann_Sum.cs
│   │   │   └── riemann_sum.py
│   │   └── Runge–Kutta_Method/
│   │       ├── Range-Kutta.c
│   │       ├── Runge-Kutta.cpp
│   │       └── Runge-Kutta.py
│   ├── Discrete/
│   │   ├── Ackermann_Peter/
│   │   │   ├── Ackermann_Peter.c
│   │   │   ├── Ackermann_Peter.cpp
│   │   │   ├── Ackermann_Peter.js
│   │   │   ├── Ackermann_Peter.py
│   │   │   ├── Python/
│   │   │   │   └── ackermann.py
│   │   │   └── README.md
│   │   └── README.md
│   ├── Geometry/
│   │   ├── Clock_Angle/
│   │   │   ├── ClockAngle.cs
│   │   │   ├── Clock_Angle.c
│   │   │   ├── Clock_Angle.cpp
│   │   │   ├── Clock_Angle.hs
│   │   │   ├── Clock_Angle.java
│   │   │   ├── Clock_Angle.js
│   │   │   ├── README.md
│   │   │   ├── clock_angle.go
│   │   │   └── clock_angle.py
│   │   ├── Distance_Formula/
│   │   │   ├── Distance_Formula.c
│   │   │   ├── Distance_Formula.cpp
│   │   │   ├── Distance_Formula.cs
│   │   │   ├── Distance_Formula.go
│   │   │   ├── Distance_Formula.hs
│   │   │   ├── Distance_Formula.java
│   │   │   ├── Distance_Formula.js
│   │   │   ├── Distance_Formula.php
│   │   │   ├── Distance_Formula.py
│   │   │   └── README.md
│   │   ├── Manhattan_Distance/
│   │   │   ├── ManhattanDistance.java
│   │   │   ├── ManhattanDistance.js
│   │   │   ├── Manhattan_Distance.c
│   │   │   ├── Manhattan_Distance.hs
│   │   │   ├── README.md
│   │   │   ├── manhattan_dist.cpp
│   │   │   ├── manhattan_dist.go
│   │   │   ├── manhattan_dist.py
│   │   │   └── manhattan_distance.py
│   │   ├── N_Dimensional_Distance/
│   │   │   └── N_Dimensional_Distance.c
│   │   ├── Polar_Cartesian_Conversion/
│   │   │   ├── Polar_Cartesian_Conversion.go
│   │   │   ├── Polar_Cartesian_Conversion.hs
│   │   │   ├── Polar_Cartesian_Conversion.java
│   │   │   └── Polar_Cartesian_Conversion.py
│   │   ├── Pythagorean_theorem/
│   │   │   ├── PythagoreanTheorem.cs
│   │   │   ├── Pythagorean_theorem.cpp
│   │   │   ├── Pythagorean_theorem.hs
│   │   │   ├── Pythagorean_theorem.js
│   │   │   ├── Pythagorean_theorem.py
│   │   │   ├── Pythagorean_theorem.rb
│   │   │   ├── Pythagorean_theorem.swift
│   │   │   ├── README.md
│   │   │   └── pythogoras_theorem.java
│   │   ├── README.md
│   │   ├── Radians_Degrees_Conversion/
│   │   │   ├── README.md
│   │   │   ├── Radians_Degree_Conversion.c
│   │   │   ├── Radians_Degrees_Conversion.c
│   │   │   ├── Radians_Degrees_Conversion.cpp
│   │   │   ├── Radians_Degrees_Conversion.hs
│   │   │   ├── Radians_Degrees_Conversion.java
│   │   │   ├── Radians_Degrees_Conversion.js
│   │   │   └── Radians_Degrees_Conversion.py
│   │   ├── Scalar_Product/
│   │   │   ├── README.md
│   │   │   ├── Scalar_Product.c
│   │   │   ├── Scalar_Product.hs
│   │   │   ├── Scalar_Product.java
│   │   │   ├── Scalar_Product.js
│   │   │   ├── Scalar_Product.py
│   │   │   ├── scalar_product.cpp
│   │   │   └── scalar_product.rb
│   │   └── Vector_Product/
│   │       ├── README.md
│   │       ├── Vector_Product.c
│   │       ├── Vector_Product.cpp
│   │       ├── Vector_Product.hs
│   │       ├── Vector_Product.js
│   │       ├── Vector_Product.py
│   │       └── Vector_Product.ts
│   ├── MOs-Algorithm/
│   │   ├── Mos_Algorithm.c
│   │   ├── Mos_Algorithm.cpp
│   │   └── README.md
│   ├── Number-Theory/
│   │   ├── Armstrong_Number/
│   │   │   ├── ArmstrongNumber.java
│   │   │   ├── Armstrong_Number.c
│   │   │   ├── armstrong.py
│   │   │   ├── armstrongin.java
│   │   │   ├── armstrongnumber.cpp
│   │   │   └── armstrongnumber.js
│   │   ├── Extended Euclidean Algorithm/
│   │   │   ├── extendEuclid.cpp
│   │   │   └── extendEuclid.py
│   │   ├── Fibonacci_Number/
│   │   │   ├── Fibonacci.cs
│   │   │   ├── FibonacciNumbers.java
│   │   │   ├── Fibonacci_Number.clj
│   │   │   ├── Fibonacci_Number.cpp
│   │   │   ├── Fibonacci_Number.py
│   │   │   └── fibonacci.sh
│   │   ├── Perfect_Number/
│   │   │   ├── Perfect Number.cpp
│   │   │   ├── PerfectNumber.py
│   │   │   ├── Perfect_Number,sh
│   │   │   ├── Perfect_Number.java
│   │   │   ├── perfec_numper.py
│   │   │   ├── perfectnumber.cpp
│   │   │   ├── perfectnumber.js
│   │   │   └── perfectnumber.php
│   │   ├── README.md
│   │   ├── Segmented_Sieve/
│   │   │   ├── README.md
│   │   │   ├── Segmented_Sieve.php
│   │   │   ├── segmented_sieve.js
│   │   │   └── segmented_sieve.py
│   │   ├── Sieve_of_Eratosthenes/
│   │   │   ├── SieveOfEratosthenes.c
│   │   │   ├── SieveOfEratosthenes.cs
│   │   │   ├── Sieve_of_Erastosthenes.rb
│   │   │   ├── Sieve_of_Erastosthenes.ts
│   │   │   ├── Sieve_of_Eratosthenes.c
│   │   │   ├── Sieve_of_Eratosthenes.cpp
│   │   │   ├── Sieve_of_Eratosthenes.go
│   │   │   ├── SieveofErastosthenes.java
│   │   │   └── prime_and_base.py
│   │   ├── Smith_number/
│   │   │   ├── SmithNumber.py
│   │   │   └── smith_numbers_till_n.cpp
│   │   ├── Strong_Number/
│   │   │   ├── strong_number.c
│   │   │   ├── strong_number.cpp
│   │   │   ├── strong_number.java
│   │   │   ├── strong_number.py
│   │   │   └── strong_number.sh
│   │   ├── Tribonacci_Number/
│   │   │   └── nthTribonacci.kt
│   │   └── Ugly_Number/
│   │       ├── README.md
│   │       ├── UglyNumber.go
│   │       ├── UglyNumbers.sh
│   │       ├── Ugly_Number.c
│   │       ├── Ugly_Number.java
│   │       ├── Ugly_Number.js
│   │       ├── Ugly_Number.php
│   │       ├── Ugly_Number.py
│   │       ├── Ugly_Number.rb
│   │       ├── Ugly_Number_Till_N.cpp
│   │       └── Ugly_Numbers.sh
│   ├── README.md
│   ├── Series/
│   │   ├── Arithmetic_Progression/
│   │   │   ├── AP.py
│   │   │   ├── Arithematic_Progression.cpp
│   │   │   ├── Arithmetic_Progression.c
│   │   │   ├── Arithmetic_Progression.java
│   │   │   ├── Arithmetic_Progression.js
│   │   │   ├── Arithmetic_Progression.php
│   │   │   ├── Arithmetic_Progression.sh
│   │   │   ├── Arithmetic_Progression.ts
│   │   │   └── README.md
│   │   ├── Fibonacci/
│   │   │   ├── Fibonacci.c
│   │   │   ├── Fibonacci.cpp
│   │   │   ├── Fibonacci.sh
│   │   │   ├── Fiboncci.py
│   │   │   ├── README.md
│   │   │   ├── fibonacci.cpp
│   │   │   └── fibonacci.java
│   │   ├── Geometric_Progression/
│   │   │   ├── Geometric Progression.py
│   │   │   ├── GeometricProgression.cs
│   │   │   ├── GeometricProgression.java
│   │   │   ├── Geometric_Progression.sh
│   │   │   └── README.md
│   │   ├── Harmonic_Progression/
│   │   │   ├── Harmonic Progression.cpp
│   │   │   ├── HarmonicProgresion.c
│   │   │   ├── Harmonic_Expression.java
│   │   │   ├── README.md
│   │   │   ├── SumOfHP.swift
│   │   │   └── harmonic_progression.py
│   │   ├── Lucas_Series/
│   │   │   ├── Lucas_Series.c
│   │   │   ├── Lucas_Series.cpp
│   │   │   ├── Lucas_Series.go
│   │   │   ├── Lucas_Series.php
│   │   │   ├── README.md
│   │   │   ├── lucas_series.cs
│   │   │   ├── lucas_series.py
│   │   │   └── lucas_series.ts
│   │   ├── Modular_Exponentiation/
│   │   │   ├── Modular_Exponentiation.cpp
│   │   │   ├── Modular_Exponentiation.py
│   │   │   ├── README.md
│   │   │   ├── modular_exponentiation.c
│   │   │   ├── modular_exponentiation.cpp
│   │   │   └── modular_exponentiation.java
│   │   ├── README.md
│   │   ├── Relative_Primes/
│   │   │   ├── README.md
│   │   │   ├── RelativePrimes.c
│   │   │   ├── RelativePrimes.java
│   │   │   ├── RelativePrimes.php
│   │   │   ├── RelativePrimes.py
│   │   │   ├── Relative_Prime.cpp
│   │   │   └── Relative_Primes.go
│   │   ├── Sum_of_AP/
│   │   │   ├── Sum_Of_AP.CPP
│   │   │   ├── Sum_Of_AP.py
│   │   │   ├── Sum_of_AP.c
│   │   │   ├── Sum_of_AP.go
│   │   │   ├── Sum_of_AP.js
│   │   │   └── Sum_of_AP_JAVA/
│   │   │       ├── SumOfAP.ctxt
│   │   │       └── Sum_of_AP.java
│   │   ├── Sum_of_GP/
│   │   │   ├── README.md
│   │   │   ├── Sum_Of_GP.c
│   │   │   ├── Sum_Of_GP.cpp
│   │   │   ├── Sum_of_GP.java
│   │   │   └── Sum_of_GP.py
│   │   ├── Sum_of_HP/
│   │   │   ├── HP_sum.py
│   │   │   ├── Sum_of_HP.cpp
│   │   │   ├── Sum_of_HP.cs
│   │   │   └── hpSum.js
│   │   ├── Sum_of_N/
│   │   │   ├── Sum_of_n.c
│   │   │   ├── sumOfNNumbers.sh
│   │   │   ├── sum_of_n_natural_no.cpp
│   │   │   ├── sum_of_n_natural_numbers.go
│   │   │   ├── sumn.py
│   │   │   ├── sumofNnaturalnums.cs
│   │   │   └── sumofNnaturalnums.py
│   │   ├── Sum_of_N2/
│   │   │   ├── SumOf_n^2.C++
│   │   │   ├── Sum_Of_n^2.py
│   │   │   ├── Sum_of_n^2.swift
│   │   │   ├── square_sum.cs
│   │   │   ├── sumOfNSquare.js
│   │   │   ├── sumOfn_squared.py
│   │   │   └── sumofnsqaure.php
│   │   └── Sum_of_N3/
│   │       ├── Sum of n3.cpp
│   │       ├── sum of n^3.cpp
│   │       └── sumofncube.php
│   └── Statistics/
│       ├── Compound_Interest/
│       │   ├── Compound_Interest.c
│       │   ├── Compound_Interest.cpp
│       │   ├── Compound_Interest.cs
│       │   ├── Compound_Interest.html
│       │   ├── Compound_Interest.java
│       │   ├── Compound_Interest.js
│       │   ├── Compound_Interest.py
│       │   ├── Compound_Interest.rb
│       │   └── Compound_Interest.ts
│       ├── Confidence_Interval/
│       │   ├── Confidence_Interval.cpp
│       │   ├── Confidence_Inverval.c
│       │   ├── README.md
│       │   ├── confidenceInterval.js
│       │   └── confidence_interval.py
│       ├── Exponential_Smoothing/
│       │   ├── Exponential_Smoothing.cpp
│       │   ├── Exponential_Smoothing.java
│       │   ├── Exponential_Smoothing.rb
│       │   └── README.md
│       ├── K-means_Clustering/
│       │   └── K-means_Clustering.py
│       ├── Logistic_Function/
│       │   └── README.md
│       ├── Mean/
│       │   ├── mean.cpp
│       │   ├── mean.java
│       │   ├── mean.py
│       │   ├── meanOfGivenNumbers.c
│       │   ├── meanOfGivenNumbers.cs
│       │   └── meanOfGivenNumbers.js
│       ├── Median/
│       │   ├── Median.c
│       │   ├── Median.java
│       │   ├── Median.js
│       │   ├── Median.py
│       │   ├── README.md
│       │   └── meadian.cpp
│       ├── Mode/
│       │   ├── Mode.java
│       │   ├── README.md
│       │   ├── mode.c
│       │   ├── mode.cpp
│       │   ├── mode.js
│       │   ├── mode.php
│       │   └── mode.py
│       ├── README.md
│       └── Standard_Deviation/
│           ├── README.md
│           ├── Standard_Deviation.c
│           ├── Standard_Deviation.cpp
│           ├── Standard_Deviation.js
│           ├── Standard_Deviation.py
│           └── Standard_Deviation.swift
├── README.md
├── STL/
│   ├── Array/
│   │   └── Array.cpp
│   ├── Map/
│   │   ├── MultiMap/
│   │   │   └── multimap.cpp
│   │   ├── Unodered-Map/
│   │   │   └── unorderedmap.cpp
│   │   └── map.cpp
│   ├── Queue/
│   │   ├── Deque/
│   │   │   ├── README.md
│   │   │   └── deque.cpp
│   │   ├── PriorityQueue/
│   │   │   └── priority_queue.cpp
│   │   └── Queue.cpp
│   ├── README.md
│   ├── Set/
│   │   ├── Unodered-Set/
│   │   │   └── UnorderedSet.cpp
│   │   └── set.cpp
│   ├── Stack/
│   │   └── stack.cpp
│   └── Vector/
│       └── Vector.cpp
└── _config.yml

================================================
FILE CONTENTS
================================================

================================================
FILE: .github/ISSUE_TEMPLATE/Documentation.yml
================================================
name: Documentation
description: Select this to document the repo
title: "Directory You Purpose to Document"
labels: ["Hacktoberfest2021", "Hacktoberfest", "new submssion", "first timer", "good first issue", 
"documentation"]
assignees:
  - octocat
body:
  - type: markdown
    attributes:
      value: |
        Before starting please take a look at [this](https://github.com/ahampriyanshu/algo_ds_101/tree/main/DOCUMENTATION.md), [this](https://dsa.ahampriyanshu.com/DOCUMENTATION) and [this](https://dsa.ahampriyanshu.com/Data-Structures/Queue/).
  - type: input
    id: directory
    attributes:
      label: Directory
      description: Path to the readme file
      placeholder: Algorithm => Sorting => Merge-Sort => README.md
    validations:
      required: true
  - type: checkboxes
    id: language
    attributes:
      label: Things To Remember
      description: Please check the following
      options:
        - label: The content added isn't directly copied from any sources like gfg, tutorialpoint, etc. For theory, use open-source alternatives like WikiPedia.
        - label: I have used github flavoured md syntax only.
        - label: All the relative links are working.
        - label: All the absolute links are working.
        - label: I have synced-up my forked repo.
        - label: Ain't pushing from the main branch.


================================================
FILE: .github/ISSUE_TEMPLATE/New-Submission.yml
================================================
name: New Submission
description: Select this to submit new Algorithm/Data-Structure/STL/...
title: "Title of the Submission"
labels: ["Hacktoberfest", "new submission", "first timer", "good first issue"]
assignees:
  - octocat
body:
  - type: markdown
    attributes:
      value: |
        I have verified that this issue doesn't already exist.
  - type: dropdown
    id: type
    attributes:
      label: Type
      description: Type of the submission
      options:
        - Algorithm
        - Data-Structure
        - Maths
        - STL
        - Collection
    validations:
      required: true
  - type: input
    id: directory
    attributes:
      label: Directory
      description: Location of the new file
      placeholder: Algorithm => Sorting => Merge-Sort => Merge-Sort.ext
    validations:
      required: true
  - type: textarea
    id: description
    attributes:
      label: Description
      description: Describe the submission
      placeholder: A linked list is a linear collection of data elements whose ...
    validations:
      required: true
  - type: checkboxes
    id: language
    attributes:
      label: Programming Language
      description: programming language
      options:
        - label: c++
        - label: c
        - label: python
        - label: java
        - label: kotlin
        - label: javascript
        - label: typescript
        - label: c#
        - label: swift
        - label: ruby
        - label: scala
        - label: go
        - label: php
        - label: haskell
        - label: bash


================================================
FILE: .github/ISSUE_TEMPLATE/config.yml
================================================
blank_issues_enabled: false

================================================
FILE: .github/pull_request_template.md
================================================
## Assigned Issue Number ?
#Issue_Number

## Location of the file(s) ?
Folder => Sub-Folder => ... => File.extension

### Checklist

- [ ] **I've followed the [contributing guidelines](https://github.com/ahampriyanshu/algo_ds_101/blob/main/CONTRIBUTING.md)**
- [ ] The content added isn't directly copied from any sources like gfg, tutorialpoint, etc.
- [ ] Input has been taken dynamically.
- [ ] I've referred the correct issue number.
- [ ] Comments have been added
- [ ] I've  synced-up my forked repo.
- [ ] Ain't pushing from the main branch.


================================================
FILE: .github/workflows/contributors.yml
================================================
name: Add contributors
on:
  schedule:
    - cron: '0 0 * * *'

jobs:
  add-contributors:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - uses: BobAnkh/add-contributors@master
      with:
        REPO_NAME: 'ahampriyanshu/algo_ds_101'
        CONTRIBUTOR: '### Contributors'
        COLUMN_PER_ROW: '6'
        ACCESS_TOKEN: ${{secrets.GITHUB_TOKEN}}
        IMG_WIDTH: '100'
        FONT_SIZE: '14'
        PATH: '/CONTRIBUTORS.md'
        COMMIT_MESSAGE: 'Updating Contributors'
        AVATAR_SHAPE: 'square'


================================================
FILE: .github/workflows/welcome.yml
================================================
name: Welcome
on:
  pull_request:
    types: [opened, closed]
  issues:
    types: [opened]
jobs:
  run:
    runs-on: ubuntu-latest
    steps:
      - uses: bubkoo/welcome-action@v1
        with:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          FIRST_ISSUE: |
            👋 @{{ author }}
             Thanks for opening your first issue here! Be sure to follow the issue template!
             Regards @ahampriyanshu :v:

          FIRST_PR: |
            👋 @{{ author }}
            Thanks for opening this pull request! Please check out our contributing guidelines.
            Regards @ahampriyanshu :v:

          FIRST_PR_MERGED: |
            🎉 @{{ author }}
            Congrats on merging your first pull request! Happy contributing!
            Regards @ahampriyanshu :v:


================================================
FILE: 404.md
================================================
---
title: 404!
permalink: /404.html
---
<center>
<img src='https://user-images.githubusercontent.com/54521023/105541932-8f544a00-5d1e-11eb-82cb-8de5071998bc.png' alt='404'/>
</center>

================================================
FILE: Algorithms/Array/Arr4 right shift.c
================================================


#include<stdio.h>

#define MAX 5 

void AcceptArray(int *Arr1 , int n)
{
	int cnt ;
	int x ;
	int *ptr = Arr1 ;
	printf("Accept an array");
	for(cnt=0;cnt<n ; cnt++)
	{
		printf("enter the %d element \n ",cnt);
		scanf("%d",&x);
		printf("ptr is at %x \n",ptr);
		*ptr=x;
		ptr++;	
	}
	*ptr=-1;
	
}
void DisplayArray(int *Arr1[],int n )
{
	int cnt ;int x;
	int *ptr=Arr1;
	
	for(cnt=n-1; cnt>0 ; cnt--)
	{
		printf("cnt=%d ptr =%x ptr -1 %x \n ",cnt ,ptr ,(ptr-1));
		x=*(ptr-1);
		*ptr=x;
	//	printf("%d",*ptr);
		ptr--;		
	}
	*ptr=-1;

	
}
void main(void)
{
	int Arr[MAX];
	int cnt ;
	int x ;
	
	printf("in main %x ",&Arr[0]);
	printf("\n enter your array \n");
	AcceptArray(Arr,MAX);
	printf("\n you have entered \n ");
	DisplayArray(Arr,MAX );
	
	
	
}



================================================
FILE: Algorithms/Array/InsertArray.c
================================================
#include <stdio.h>
#define max 10

int main()
{
    int array[max], pos, i, n, value;
    printf("Enter number of elements in array: ");
    scanf("%d", &n);
    if (n <= max)
    {
        printf("Enter %d elements:\n", n);

        for (i = 0; i < n; i++)
        {
            scanf("%d\n", &array[i]);
        }
        printf("Enter the location where you want to insert an element: ");
        scanf("%d", &pos);

        printf("Enter the value to insert: ");
        scanf("%d", &value);

        for (i = n - 1; i >= pos - 1; i--)
            array[i + 1] = array[i];

        array[pos - 1] = value;

        printf("Resultant array:\n");

        for (i = 0; i <= n; i++)
            printf("%d\n", array[i]);
    }
    else
    {
        printf("Array out of bound.");
    }

    return 0;
}


================================================
FILE: Algorithms/Array/LinearSearch.java
================================================

public class Main {
{
   public static void main(String[] args)
   {
      // Validate command line arguments count.

      if (args.length != 2)
      {
         System.err.println("usage: java LinearSearch integers integer");
         return;
      }

      // Read integers from first command-line argument. Return if integers 
      // could not be read.

      int[] ints = readIntegers(args[0]);
      if (ints == null)
         return;

      // Read search integer; NumberFormatException is thrown if the integer
      // isn't valid.

      int srchint = Integer.parseInt(args[1]);

      // Perform the search and output the result.

      System.out.println(srchint + (search(ints, srchint) ? " found"
                                                          : " not found"));
   }

   private static int[] readIntegers(String s)
   {
      String[] tokens = s.split(",");
      int[] integers = new int[tokens.length];
      for (int i = 0; i < tokens.length; i++)
         integers[i] = Integer.parseInt(tokens[i]);
      return integers;
   }

   private static boolean search(int[] x, int srchint)
   {
      for (int i = 0; i < x.length; i++)
         if (srchint == x[i])
            return true;

      return false;
   }
}
}


================================================
FILE: Algorithms/Array/Merge-Sorted-Array.c
================================================
#include<stdio.h>
#include<stdlib.h>
int cmpfunc (const void * a, const void * b) {
   return ( *(int*)a - *(int*)b );
}

int main()
{
 	int aSize, bSize, cSize, mSize, i, j;
	int a[10], b[10], c[10], Merged[20];
  
 	printf("\n Please Enter the First Array Size  :  ");
 	scanf("%d", &aSize);
 
 	printf("\nPlease Enter the First Array Elements :  ");
 	for(i = 0; i < aSize; i++)
  	{
      	scanf("%d", &a[i]);
  	}
  	printf("\n Please Enter the Second Array Size  :  ");
 	scanf("%d", &bSize);
   
 	printf("\nPlease Enter the Second Array Elements  :  ");
 	for(i = 0; i < bSize; i++)
  	{
      	scanf("%d", &b[i]);
  	}
  	printf("\n Please Enter the Third Array Size  :  ");
 	scanf("%d", &cSize);
 	printf("\nPlease Enter the Third Array Elements  :  ");
    for(i = 0; i < cSize; i++)
  	{
      	scanf("%d", &c[i]);
  	}
  	for(i = 0; i < aSize; i++)
  	{
      	Merged[i] = a[i];
  	}
	mSize = aSize + bSize;
 
 	for(i = 0, j = aSize; j < mSize && i < bSize; i++, j++)
  	{
  		Merged[j] = b[i];
  	}
  	mSize = aSize + bSize + cSize;
  	for(i = 0, j = aSize + bSize; j < mSize && i < cSize; i++, j++)
  	{
  		Merged[j] = c[i];
  	}
    qsort(Merged,mSize,sizeof(int),cmpfunc);
 	printf("\n a[%d] Array Elements After Merging \n", mSize); 
 	for(i = 0; i < mSize; i++)
  	{
    	printf(" %d \t ",Merged[i]);
  	}
 
  	return 0;
}

================================================
FILE: Algorithms/Array/Merge-Sorted-Array.cpp
================================================
#include<bits/stdc++.h> 
using namespace std; 
#define n 4 


void printArray(int arr[], int size) 
{ 
for (int i=0; i < size; i++) 
	cout << arr[i] << " "; 
} 

void mergeKArrays(int arr[][n], int a, int output[]) 
{ 
	int c=0; 
	
	for(int i=0; i<a; i++) 
	{ 
		for(int j=0; j<n ;j++) 
			output[c++]=arr[i][j]; 
	} 
	
	sort(output,output + n*a); 
	
} 


int main() 
{
	int arr[][n] = {{2, 6, 12, 34}, 
					{1, 9, 20, 1000}, 
					{23, 34, 90, 2000}}; 
	int k = sizeof(arr)/sizeof(arr[0]); 
	
	int output[n*k]; 
	
	mergeKArrays(arr, 3, output); 

	cout << "Merged array is " << endl; 
	printArray(output, n*k); 

	return 0; 
} 


================================================
FILE: Algorithms/Array/Merge-Sorted-Array.js
================================================
// Merge_sorted_array

function mergeSorted(a, b) {
    var answer = new Array(a.length + b.length), i = 0, j = 0, k = 0;
    while (i < a.length && j < b.length) {
      if (a[i] < b[j]) {
          answer[k] = a[i];
          i++;
      }else {
          answer[k] = b[j];
          j++;
      }
      k++;
    }
    while (i < a.length) {
      answer[k] = a[i];
      i++;
      k++;
    }
    while (j < b.length) {
      answer[k] = b[j];
      j++;
      k++;
    }
    return answer;
  }


  // Merge All array that we pass.
  var mergeAll = function(){
      return Array.prototype.slice.call(arguments).reduce(mergeSorted);
  };
  

  //Number of Sorted_Array to be merge
  var a = [2, 4, 7,9];
  var b = [3, 6, 11, 12];
  var c = [5, 8, 10, 13];
  
  console.log(mergeAll(a,b,c).map(function(x){return x;}));


  /* input arrays :
   * a = [2, 4, 7,9];
   * b = [3, 6, 11, 12];
   * c = [5, 8, 10, 13];
   * output single_array :
   * 2 3 4 5 6 7 8 9 10 11 12 13
   * /

================================================
FILE: Algorithms/Array/Merge-Sorted-Array.py
================================================

from heapq import merge 
def mergeK(arr, k):     
    l = arr[0] 
    for i in range(k-1): 
        l = list(merge(l, arr[i + 1])) 
    return l 
  
def printArray(arr): 
    print(*arr) 
  

arr =[[3, 4, 16 ],  
    [ 5, 9 ],  
    [22, 54, 94, 200 ]] 
k = 3

out = mergeK(arr, k) 
printArray(out) 


================================================
FILE: Algorithms/Array/Merge_Sorted_Arrays.rb
================================================
def merge_sorted_arrays(arrays)
    return [] if arrays.length == 0
    return arrays[0] if arrays.length == 1
  
    # 1. Using built-in methods
    # arrays.flatten.sort!

    # 2. Not using built-in methods
    full_array = arrays.inject([], :+)
    sort(full_array)
end

def sort(num_arr)
    return num_arr if num_arr.size <= 1

    mid = num_arr.length / 2
    left = num_arr[0...mid]
    right = num_arr[mid...num_arr.size]

    merge(sort(left), sort(right))
end
  
def merge(left, right)
    sorted = []
    until left.empty? || right.empty?
        if left.first <= right.first
            sorted << left.shift
        else
            sorted << right.shift
        end
    end
    sorted.concat(left).concat(right)
end

# Test example
arrays = [
    [1, 4, 5],
    [1, 3, 220],
    [2, 6, 15, 1000],
    [4, 10, 33]
]

p merge_sorted_arrays(arrays)


================================================
FILE: Algorithms/Array/Rearrange-High-Low.js
================================================
function swap(arr, i, j)
{
    var temp = arr[i];
    arr[i] = arr[j];
    arr[j] = temp;
}
 
// Function to rearrange the array such that every second element
// of the array is greater than its left and right elements
function rearrangeArray(arr, n)
{

    for (let i = 1; i < n; i += 2)
    {
        // if the previous element is greater than the current element,
        // swap the elements
        if (arr[i - 1] > arr[i]) {
            swap(arr, i - 1, i);
        }
 
        // if the next element is greater than the current element,
        // swap the elements
        if (i + 1 < n && arr[i + 1] > arr[i]) {
            swap(arr, i + 1, i);
        }
    }
}

const arr = [ 1, 2, 3, 4, 5, 6, 7 ];
const n = arr.length;

rearrangeArray(arr, n);

// print output array
for (let i = 0; i < n; i++) {
    console.log(arr[i]);
}

/* 
    Output:

            1
            3
            2
            5
            4
            7
            6

*/


================================================
FILE: Algorithms/Array/Rearrange-High-Low.kt
================================================
// main function
fun main(args: Array<String>) {
  
  // pre defined array
    val arr=arrayOf(3, 6, 5, 10, 7, 20)
    
    // size of array
    val n=arr.size
  
  // sort the array
    arr.sort()
    
    // swap the alternate positions and increment in steps of 2
    for (i in 0 until n step 2)
    {
        arr[i]=arr[i]+arr[i+1];
        arr[i+1]=arr[i]-arr[i+1];
        arr[i]=arr[i]-arr[i+1];
    }
    
    // output the array
    for(i in 0 until n)
    println(arr[i])
    
}
/* 
    Output:
            5
            3
            7
            6
            20
            10
*/


================================================
FILE: Algorithms/Array/Remove-Dublicate.js
================================================
// RemoveDuplicateItem

function RemoveDuplicateItem(arr) {
    let newAr = [];


    arr.forEach((item) => {
        if (!newAr.includes(item)) {
            newAr.push(item)
        }
    })
    return newAr
}



================================================
FILE: Algorithms/Array/Remove-Duplicates-from-Sorted-Array.c
================================================

/*
Given a sorted array nums, remove the duplicates in-place such that each element appears only once and returns the new length.
Do not allocate extra space for another array, you must do this by modifying the input array in-place with O(1) extra memory.
*/

#include <iostream>
#include<stdio.h> 
#include <bits/stdc++.h> 
#include <cmath>
#include <vector>
#include <map>
#include <string>
#include <algorithm>
#include <iomanip>
#include<utility>
using namespace std;
#define ll long long
#define len length()
#define vi vector<int>
#define vl vector<ll>

#define fr(i,n) for(ll i=0;i<n;i++)
ll max(ll i,ll j){
    return i>j?i:j;
}


int removeDuplicates(vector<int>& nums) {
        int ind=1;
        int n=nums.size();
        if (n<=1) return n;
        for(int i=0;i<n-1;i++){

            if(nums[i+1]!=nums[i]){
                nums[ind]=nums[i+1];
                if(ind<n)
                ind++;
            }


        }
        nums.resize(ind);
        return ind;
}

int main(){
    int n;
    cin>>n;
 vector<int> v(n,0);
  fr(i,n){
      int x; cin>>x;
      v[i]=x;
  }

 sort(v.begin(),v.end());
 removeDuplicates(v);
for(int u =0;u<h;u++){
    cout<<v[u];
 }
 return 0;

}


================================================
FILE: Algorithms/Array/Remove-Duplicates-from-Sorted-Array.cpp
================================================
/*
Given a sorted array nums, remove the duplicates in-place such that each element appears only once and returns the new length.
Do not allocate extra space for another array, you must do this by modifying the input array in-place with O(1) extra memory.
*/
#include<iostream> 

using namespace std; 

int removeDuplicates(int arr[], int n) 

{ 

    if (n==0 || n==1) 

        return n; 

    int j = 0; 

    for (int i=0; i < n-1; i++) 

        if (arr[i] != arr[i+1]) 

            arr[j++] = arr[i]; 

    arr[j++] = arr[n-1]; 

    return j; 

}  

int main() 

{ 
    int n;
    cin>>n;
    int arr[n];

    for(int i=0;i<n;i++){
        cin>>a[i];
        }

    n = removeDuplicates(arr, n); 

    for (int i=0; i<n; i++) 

        cout << arr[i] << " "; 

    return 0; 

} 







================================================
FILE: Algorithms/Array/Shuffle.c
================================================
/*
You are given an array consisting of n integers a1, a2, ..., an. Initially ax=1, all other elements are equal to 0.
You have to perform m operations. During the i-th operation, you choose two indices c and d such that li≤c,d≤ri, and swap ac and ad.
Calculate the number of indices k such that it is possible to choose the operations so that ak=1 in the end.
*/

#include <iostream>
#include<stdio.h> 
#include <bits/stdc++.h> 
#include <cmath>
#include <vector>
#include <map>
#include <string>
#include <algorithm>
#include <iomanip>
#include<utility>
using namespace std;
#define ll long long
#define len length()
#define vi vector<int>
#define vl vector<ll>

#define fr(i,n) for(ll i=0;i<n;i++)
ll max(ll i,ll j){
    return i>j?i:j;
}
 
 
int main(){
    
int t; 
//t=1;
cin>>t;    
while(t--){

ll n,x,m; cin>>n>>x>>m; 
ll mx=x, mn=x;

while(m--){
    ll l,r;
    cin>>l>>r;
    
    if(mn>=l&&mn<=r || mx>=l&&mx<=r){
        
        mn=min(mn,l); mx=max(mx,r);
        
    }
    
    
}
ll ans=(mx-mn)+1;
cout<<ans<<endl;
  
}
 
}


================================================
FILE: Algorithms/Array/Two-Arrays-And-Swaps.c
================================================
/*
You are given two arrays a and b both consisting of n positive (greater than zero) integers. You are also given an integer k.
In one move, you can choose two indices i and j (1≤i,j≤n) and swap ai and bj (i.e. ai becomes bj and vice versa). Note that i and j can be equal or different (in particular, swap a2 with b2 or swap a3 and b9 both are acceptable moves).
Your task is to find the maximum possible sum you can obtain in the array a if you can do no more than (i.e. at most) k such moves (swaps).
You have to answer t independent test cases.
*/

#include <iostream>
#include<stdio.h> 
#include <bits/stdc++.h> 
#include <cmath>
#include <vector>
#include <map>
#include <string>
#include <algorithm>
#include <iomanip>
#include<utility>
using namespace std;
#define ll long long
#define len length()
#define vi vector<int>
#define vl vector<ll>

#define fr(i,n) for(ll i=0;i<n;i++)

int main(){
    
int t; cin>>t;
    
while(t--){
ll n,k; cin>>n>>k;
 
vl a(n,0),b(n,0);
fr(i,n){
    cin>>a[i];
}
 
fr(i,n){
    cin>>b[i];
}
 
sort(a.begin(),a.end());
sort(b.begin(),b.end(),greater<int>());
ll s=0,ans=0;
ll j=0;
fr(i,n){
    if(s<k){
       ll mx=max(a[i],b[j]);
       ans+=mx;
       if(mx==b[j]){
           j++;
           s++;
       }
    }
    else{
        ans+=a[i];
    }
}
 
cout<<ans<<endl;
}
 
}


================================================
FILE: Algorithms/Array/check_two_equal_array.cpp
================================================
#include <bits/stdc++.h>
using namespace std;
#define  LL long long
#define F first
#define S second
#define fast_io ios::sync_with_stdio(false);cin.tie(NULL)
int main()
{
	int t;
	cin >> t;
	while(t--)
	{
		int n,ans=1;
		cin >> n;
		int a[n+5],b[n+5];
		int h1[10005]={0},h2[10005]={0};
		for(int i=0;i<n;i++)
		{
			cin >> a[i];
			h1[a[i]]++;
		}
		for(int i=0;i<n;i++)
		{
			cin >> b[i];
			h2[b[i]]++;
		}
		for(int i=0;i<=10000;i++)
		{
			if(h1[i] != h2[i])
			{
				ans = 0;
				break;
			}
		}
		cout << ans << endl;

	}
}

================================================
FILE: Algorithms/Array/copyarray.c
================================================
#include<stdio.h>
int main()
{
    int arr1[40],n,i,arr2[40];

    printf("How many number :");
    scanf("%d",&n);

    // scan  array_1 Elements;
    for (i=0;i<n;i++)
        {
            scanf("%d",&arr1[i]);
        }

    // Print Array_1
    printf("Array_1 : ");
    for(i=0;i<n;i++)

    {
        printf("%d ",arr1[i]);
    }
    printf("\n");

// copy all Elements
    for (i=0;i<n;i++)
    {
        arr2[i]=arr1[i];
    }


    // Print Array_2
    printf("Array_2 : ");
    for (i=0;i<n;i++)
    {
     printf("%d ",arr2[i]);
    }


 getchar();
}


================================================
FILE: Algorithms/Array/counting_frequency_of_char_in_string.c
================================================
#include <stdio.h>
int main() {
    char str[1000], ch;
    int i,count = 0;
    printf("Enter a string: ");
    fgets(str, sizeof(str), stdin);

    printf("Enter a character to find its frequency: ");
    scanf("%c", &ch);

    for ( i = 0; str[i] != '\0'; ++i) 
	{
        if (ch == str[i])
            ++count;
    }
    printf("Frequency of %c = %d", ch, count);
    return 0;
}


================================================
FILE: Algorithms/Array/findpos.py
================================================
def findposition(arr, x) :
    flag = True
    for i in range(0, len(arr)) :
        if (x != arr[i]) :
            continue
        if (flag==True) :
            first = i
        last = i
        flag = False
     
    if (flag==False) :
        print( "First Occurrence in array = ", first , "\n" + " Last Occurrence in array = ", last)
    else :
        print("Element Not Found")
         
arr = [1, 2, 2, 2, 2, 3, 4, 7, 8, 8 ]
x=int(input("Enter the Element : "))
findposition(arr, x)

================================================
FILE: Algorithms/Array/high-low-rearrangement.c
================================================
#include <stdio.h>
//swap of elements
void swap(int arr[], int i, int j)
{
    int temp = arr[i];
    arr[i] = arr[j];
    arr[j] = temp;
}
//arrange the array in high low order
void rearrange(int arr[], int n)
{
    for (int i = 1; i < n; i += 2)
    {
        if (arr[i - 1] > arr[i]) {
            swap(arr, i - 1, i);
        }
        if (i + 1 < n && arr[i + 1] > arr[i]) {
            swap(arr, i + 1, i);
        }
    }
}
 
int main(void)
{
    //take input from user
    int n;
    printf("Enter array length : \n");
    scanf("%d",&n);
    
    int arr[n];
    
     printf("Enter array elements:\n");
     for(int i = 0; i < n;  i++){
        scanf("%d", &arr[i]);
     }
 
    rearrange(arr, n);
    for (int i = 0; i < n; i++) {
        printf("%d ", arr[i]);
    }
 
    return 0;
}


================================================
FILE: Algorithms/Array/high-low-rearrangement.c++
================================================
#include <bits/stdc++.h>
using namespace std;
//swap of elements
void swap(int arr[], int i, int j)
{
    int temp = arr[i];
    arr[i] = arr[j];
    arr[j] = temp;
}
//rearrange elements high and low
void rearrange(int arr[], int n)
{
    for (int i = 1; i < n; i += 2)
    {
        if (arr[i - 1] > arr[i]) {
            swap(arr, i - 1, i);
        }
        if (i + 1 < n && arr[i + 1] > arr[i]) {
            swap(arr, i + 1, i);
        }
    }
}
 
int main()
{
    //enter array by user
    int n;
    cout<<"Enter the number of elements:"<<endl;
    cin>>n;
    
    int arr[n];
    
     cout<<"Enter array elements:"<<endl;
     for(int i = 0; i < n;  i++){
        cin>>arr[i];
     }
 
    rearrange(arr, n);
    for (int i = 0; i < n; i++) {
        cout<<arr[i]<<endl;
    }
 
    return 0;
}


================================================
FILE: Algorithms/Array/high-low-rearrangement.py
================================================
# Swap functions
def swap(A, i, j):
    temp = A[i]
    A[i] = A[j]
    A[j] = temp 
# reaggrange array
def rearrangeArray(A):
    for i in range(1, len(A), 2):
        if A[i - 1] > A[i]:
            swap(A, i - 1, i)
        if i + 1 < len(A) and A[i + 1] > A[i]:
            swap(A, i + 1, i)
if __name__ == '__main__': 
    A = []
    n = int(input("Enter number of elements : ")) 
    A = list(map(int,input("\nEnter the numbers:").strip().split()))[:n] 
    rearrangeArray(A)
print(A)


================================================
FILE: Algorithms/Array/largest-smallest-number-and-sum-of-all-elements-in-array.java
================================================
import java.io.*;
class t17question7
{
    public static void main(String args[])throws IOException
    {
        InputStreamReader in = new InputStreamReader(System.in);
        BufferedReader y = new BufferedReader(in);
        int i,ln=0,sn=0,s=0;
        int n[]=new int[20];
        System.out.println("Input 20 integers");
        for(i=0;i<20;i++)
        {
            n[i]=Integer.parseInt(y.readLine());
        }
        ln=n[0];
        for(i=1;i<20;i++)
        {
        if(n[i]>ln)
        ln=n[i];
    }
    System.out.println(" The largest number is "+ln);
    sn=n[0];
    for(i=1;i<20;i++)
    {
        if(n[i]<sn)
        sn=n[i];
    }
    System.out.println(" The smallest number is "+sn);
    for(i=0;i<20;i++)
    {
        s=s+n[i];
    }
    System.out.println(" Sum of all the elements of the array is "+s);
}
}





================================================
FILE: Algorithms/Array/merge-sorted-arrays-algo-only.py
================================================
# O(nk) time | O(n+k) space - where n is the total number of array elements and k is the nunber of arrays

def mergeSortedArrays(arrays):
    sortedList = []
    elementIdxs = [0 for array in arrays]
    while True:
        smallestItems = []
        for arrayIdx in range(len(arrays)):
            relevantArray = arrays[arrayIdx]
            elementIdx = elementIdxs[arrayIdx]
            if elementIdx == len(relevantArray):
                continue
            smallestItems.append(
                {"arrayIdx": arrayIdx, "num": relevantArray[elementIdx]})
        if len(smallestItems) == 0:
            break
        nextItem = getMinValue(smallestItems)
        sortedList.append(nextItem["num"])
        elementIdxs[nextItem["arrayIdx"]] += 1
    return sortedList


def getMinValue(items):
    minValueIdx = 0
    for i in range(1, len(items)):
        if items[i]["num"] < items[minValueIdx]["num"]:
            minValueIdx = i
    return items[minValueIdx]


================================================
FILE: Algorithms/Array/merge_without_extraspace.cpp
================================================
#include <bits/stdc++.h>
using namespace std;

/*
    Author : codewithmini
*/

/* Problem Statement
We are given two sorted arrays. We need to merge these two arrays such that the initial numbers (after complete sorting) are in the first array and the remaining numbers are in the second array. Extra space allowed in O(1).
*/

int main()
{
    int m,n;

    // input as length of array 1
    cout<<"Enter the length of array 1 : ";
    cin>>m;

    // input as length of array 2
    cout<<"\nEnter the length of array 2 : ";
    cin>>n;

    int arr1[m],arr2[n];

    // array 1
    cout<<"\nEnter the values of array 1 \n";
    for(int i=0;i<m;i++)
    {
        cin>>arr1[i];
    }
    // array 2
    cout<<"\nEnter the values of array 2 \n";
    for(int i=0;i<n;i++)
    {
        cin>>arr2[i];
    }

    int i = 0, j = 0, k = m - 1;

    // Till when i less than equal to k or j is less tha m
    // while traversing the two sorted arrays parallelly, if we encounter the jth second array element is smaller than ith first array element, then jth element is to be included and replace some kth element in the first array
    while (i <= k && j < n) 
    {
        if (arr1[i] < arr2[j])
        {    
            i++;
        }
        else 
        {
            swap(arr2[j++], arr1[k--]);
        }
    }

    // sort both arr1 and arr2 
    sort(arr1, arr1 + m);
    sort(arr2, arr2 + n);

    cout << "After Merging \nFirst Array: ";
    for (int i = 0; i < m; i++)
        cout << arr1[i] << " ";
    cout << "\nSecond Array: ";
    for (int i = 0; i < n; i++)
        cout << arr2[i] << " ";
    return 0;
}


/* 
OUTPUT :
Enter the length of array 1 : 6
Enter the length of array 2 : 4
Enter the values of array 1 
1
5
9
10
15
20
Enter the values of array 2 
2
3
8
13
After Merging 
First Array: 1 2 3 5 8 9 
Second Array: 10 13 15 20
*/  


================================================
FILE: Algorithms/Array/merging_2_arrays.c
================================================
#include<stdio.h>
int main()
{
 	int n1, n2, n3, i, j;
 	printf("\n Enter the number of elements for  First Array  :  ");
 	scanf("%d", &n1);     //Array Size Declaration
    int a[n1];      //Array Declaration
 	printf("\nEnter the elements for First Array :  ");
 	for(i = 0; i < n1; i++)
  	{
      	scanf("%d", &a[i]);
  	}
  	printf("\n Enter the number of elements for  Second Array  :  ");
 	scanf("%d", &n2);    //Array Size Declaration
    int b[n2];       //Array Declaration
 	printf("\nEnter the elements for Second Array  :  ");
 	for(i = 0; i < n2; i++)
  	{
      	scanf("%d", &b[i]);
  	}
	n3 = n1 + n2;     //Array Size Declaration
    int c[n3];       //Array Declaration
  	for(i = 0; i < n1; i++)
  	{
      	c[i] = a[i];
  	}
 	for(i = 0, j = n1; j < n3 && i < n2; i++, j++)
  	{
  		c[j] = b[i];
  	}
 	printf("\n a[%d] Array Elements After Merging \n", n3); 
 	for(i = 0; i < n3; i++)
  	{
    	printf(" %d \t ",c[i]);
  	}
  	return 0;
}




================================================
FILE: Algorithms/Array/rearrange-high-low.java
================================================
import java.util.Scanner;
class Main
{
    // swap
    private static void swap(int[] A, int i, int j)
    {
        int temp = A[i];
        A[i] = A[j];
        A[j] = temp;
    }
 
    // rearrange
    public static void rearrangeArray(int[] A)
    {
        for (int i = 1; i < A.length; i += 2)
        {
            if (A[i - 1] > A[i]) {
                swap(A, i - 1, i);
            }
            if (i + 1 < A.length && A[i + 1] > A[i]) {
                swap(A, i + 1, i);
            }
        }
    }
    public static void main (String[] args)
    {
        int n;
        Scanner sc = new Scanner(System.in);
        System.out.println("Enter no. of elements in array:");
        n = sc.nextInt();
        int A[] = new int[n];
        System.out.println("Enter all the elements:");
        for(int i = 0; i < n; i++)
        {
            A[i] = sc.nextInt();
        }
 
        rearrangeArray(A);
        System.out.println(Arrays.toString(A));
    }
}


================================================
FILE: Algorithms/Array/revering_array.c
================================================
#include<stdio.h>
#include<stdlib.h>
struct Array
{
int A[10];
int size;
int length;
};
void Display(struct Array arr)
{
int i;
printf("\nElements are\n");
for(i=0;i<arr.length;i++)
printf("%d ",arr.A[i]);
}
void swap(int *x,int *y)
{
int temp=*x;
*x=*y;
*y=temp;
}
void Reverse(struct Array *arr)
{
int *B;
int i,j;
B=(int *)malloc(arr->length*sizeof(int));
for(i=arr->length-1,j=0;i>=0;i--,j++)
B[j]=arr->A[i];
for(i=0;i<arr->length;i++)
arr->A[i]=B[i];
}
void Reverse2(struct Array *arr)
{
int i,j;
for(i=0,j=arr->length-1;i<j;i++,j--)
{
swap(&arr->A[i],&arr->A[j]);
}
}
int main()
{
	struct Array arr1={{2,3,9,16,18,21,28,32,35},10,9};
Reverse(&arr1);
Display(arr1);
return 0;
}


================================================
FILE: Algorithms/Array/rotate_matrix_90degree.cpp
================================================
#include <bits/stdc++.h>
using namespace std;

/*
    Author : codewithrathi
*/

/*
Problem Statement :
Rotate a matrix by 90 degree in clockwise or anticlockwise direction without using any extra space
*/

int main()
{
    int n;

    // Dimension of square matrix
    cout<<"\nEnter the dimension of Matrix : ";
    cin>>n;

    int arr[n][n],ch;

    // matrix
    cout<<"\nEnter the values of Matrix \n";
    for(int i=0;i<n;i++)
    {
        for(int j=0;j<n;j++)
        {
            cin>>arr[i][j];
        }
    }

    cout<<"Enter your choice (1 or 2) : \n";
    cout<<"[1] anti-clockwise rotation \n";
    cout<<"[2] clockwise rotation \n";

    cin>>ch;

    cout<<"Matrix before rotation :\n\n";
    for(int i=0;i<n;i++)
    {
        for(int j=0;j<n;j++)
        {
            cout<<arr[i][j]<<" ";
        }
        cout<<endl;
    }

    if(ch==1)
    {
        for (int i = 0; i < n / 2; i++) 
        { 
            // Consider elements in group of 4 in 
            // current square 
            for (int j = i; j < n-i-1; j++) 
            { 
                // store current cell in temp variable 
                int temp = arr[i][j]; 

                // move values from right to top 
                arr[i][j] = arr[j][n-1-i]; 

                // move values from bottom to right 
                arr[j][n-1-i] = arr[n-1-i][n-1-j]; 

                // move values from left to bottom 
                arr[n-1-i][n-1-j] = arr[n-1-j][i]; 

                // assign temp to left 
                arr[n-1-j][i] = temp; 
            } 
        }
    }
    else if(ch==2)
    {
        for (int i = 0; i < n / 2; i++) 
        { 
            // Consider elements in group of 4 in 
            // current square 
            for (int j = i; j < n-i-1; j++) 
            { 
                // store current cell in temp variable 
                int temp = arr[i][j]; 

                // move values from right to top 
                arr[i][j] = arr[n-1-j][i]; 

                // move values from bottom to right 
                arr[n-1-j][i] = arr[n-1-i][n-1-j]; 

                // move values from left to bottom 
                arr[n-1-i][n-1-j] = arr[j][n-1-i]; 

                // assign temp to left 
                arr[j][n-1-i] = temp; 
            } 
        }
    }
    else
    {
        cout<<"Invalid input";
    }
    if(ch==1 || ch==2)
    {
        cout<<"Matrix after rotation :\n\n";
        for(int i=0;i<n;i++)
        {
            for(int j=0;j<n;j++)
            {
                cout<<arr[i][j]<<" ";
            }
            cout<<endl;
        }

    }

    return 0;
}


/* 
OUTPUT :
Enter the dimension of Matrix : 4
Enter the values of Matrix 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Enter your choice (1 or 2) : 
[1] anti-clockwise rotation 
[2] clockwise rotation 
2
Matrix before rotation :
1 2 3 4 
5 6 7 8 
9 10 11 12 
13 14 15 16 
Matrix after rotation :
13 9 5 1 
14 10 6 2 
15 11 7 3 
16 12 8 4 
...Program finished with exit code 0
Press ENTER to exit console.
*/ 


================================================
FILE: Algorithms/Array/rotated_sorted_array_search.cpp
================================================
#include<bits/stdc++.h> 
using namespace std;

int rotatedSearch(vector<int> &A, int B) {

    //low and high are the indices between which we search-
    int low=0; 
    int high=A.size()-1;
    
    //finding the pivot of rotation-
    for(int i=0; i<A.size()-1; i++){
        if(A[i]>A[i+1]){                
            
            if(B>=A[0])
                high=i;                //search only in the left of pivot
            
            else if(B<=A[A.size()-1])
                low=i+1;              //search only in the right of pivot
            
            break;    
        }
    }
    
    //implementing Binary Search-
    while(high>=low){                  
        int mid=low+(high-low)/2;
        if(A[mid]==B) return mid;     //B is found
        else if(A[mid]>B) high=mid-1;
        else if(A[mid]<B) low=mid+1;
    }
    return -1;                       //B is not found
}


================================================
FILE: Algorithms/Array/twoSum.cpp
================================================
#include<bits/stdc++.h>
using namespace std;

/*Naive Approach: Check for all pairs if they adds up to the target or not
TC: O(n*n) SC: O(1)
*/
pair<int, int> findTwoSumNaive(vector<int> nums, int target){
    int n = nums.size();
    for(int i = 0; i < n; i++){
        for(int j = i + 1; j < n; j++){
            if(nums[i] + nums[j] == target)
                return {nums[i], nums[j]};
        }
    }
    return {-1, -1};
}
/*Better Approach: Sort the given array
->create two pointers one of which points to the first element and another one to the last element.
->check if both the values pointed to by these pointers adds up to the target or not.
->if yes, return the result.
->otherwise, if the sum is lesser than the target increment left pointer
->           otherwise decrement the right pointer.
->The above intuition works because the array is sorted.
TC: O(nlogn) SC: O(n)
*/
pair<int, int> findTwoSumBetter(vector<int> nums, int target){
    sort(nums.begin(), nums.end());
    int lo = 0;
    int hi = nums.size() - 1;
    while(lo < hi){
        if(nums[lo] + nums[hi] == target)
            return {nums[lo],nums[hi]};
        nums[lo] + nums[hi] < target ? lo++ : hi--;
    }
    return {-1, -1};
}

/*Optimal Approach: 
->Use a hashmap to store the numbers as you traverse.
->At any point if you had added a value equal to the target - current_number in the hashmap.
->Then we have our ans as {current_number, target - current_number} which adds up to the target value.
->otherwise return {-1, -1} as the result.
TC: O(n) SC: O(n)
considering the hashmap works in O(1) on an average.
*/
pair<int, int> findTwoSumOptimal(vector<int> nums, int target){
    unordered_map<int, int>mp;
    for(auto &a : nums){
        if(mp[target - a])
            return {target - a, a};
        mp[a]++;
    }
    return {-1, -1};
}
int main(){
    
    //get the input array as a line of string
    string s;
    getline(cin, s);
    
    //get the target value 
    int target;
    cin >> target;
    
    stringstream ss(s);
    
    vector<int> nums;
    int value;
    
    //string values to integer values and add it the nums array
    while(ss >> value)nums.push_back(value);
    
    //a pair of values to store the result
    pair<int, int> values = findTwoSumOptimal(nums, target);
    
    //if both the values of the result are -1
    //it means no such pair exists that adds up to the target value
    //otherwise, print a valid pair of values
    if(values.first == -1 and values.second == -1){
        cout << "No such pair exists" << endl;
    } else{
        cout << values.first <<" and " << values.second
            <<" adds up to " << target << endl;
    }
      
    
}

================================================
FILE: Algorithms/Array/twoSum.kt
================================================
import java.util.*

/*Naive Approach: Check for all pairs if they adds up to the target or not
TC: O(n*n) SC: O(1)
*/
fun findTwoSumNaive(nums: List<Int>, target: Int): IntArray{
    val n = nums.size
    for(i in 0 until n){
        for(j in (i+1) until n){
            if(nums[i] + nums[j] == target)
                return intArrayOf(nums[i], nums[j])
        }
    }
    return intArrayOf(-1, -1)
}

/*Better Approach: Sort the given array
->create two pointers one of which points to the first element and another one to the last element.
->check if both the values pointed to by these pointers adds up to the target or not.
->if yes, return the result.
->otherwise, if the sum is lesser than the target increment left pointer
->           otherwise decrement the right pointer.
->The above intuition works because the array is sorted.
TC: O(nlogn) SC: O(n)
*/
fun findTwoSumBetter(nums: List<Int>, target: Int): IntArray{
    Collections.sort(nums)
    var (lo, hi) = Pair(0, nums.size - 1)
    while(lo < hi){
        val sum = nums[lo] + nums[hi]
        if(sum == target){
            return intArrayOf(nums[lo], nums[hi]);
        }
        if(sum < target) lo++ else hi--
    }
    return intArrayOf(-1, -1)
}

/*Optimal Approach: 
->Use a hashmap to store the numbers as you traverse.
->At any point if you had added a value equal to the target - current_number in the hashmap.
->Then we have our ans as {current_number, target - current_number} which adds up to the target value.
->otherwise return {-1, -1} as the result.
TC: O(n) SC: O(n)
considering the hashmap works in O(1) on an average.
*/
fun findTwoSumOptimal(nums: List<Int>, target: Int): IntArray{
    val map = mutableMapOf<Int, Boolean>()
    for(num in nums){
        if(map.containsKey(target - num))
            return intArrayOf(target - num, num)
        map[num] = true
    }
    return intArrayOf(-1, -1)
}

//main function
fun main(){
    //get the input array
    val nums = readLine()!!.split(' ').map{it.toInt()}

    //get the target value
    val target = readLine()!!.toInt()

    //a pair of values to store the result
    val values = findTwoSumOptimal(nums, target)

    //if both the values of the result are -1
    //it means no such pair exists that adds up to the target value
    //otherwise, print a valid pair of values
    if(values[0] == -1 && values[1] == -1)
        println("No such pair exists")
    else 
        println("${values[0]} and ${values[1]} adds up to $target")
}

================================================
FILE: Algorithms/Array/wave_form_array
================================================
//Print a 2d array in wave form i.e. \/\/\/\/
#include <iostream>
using namespace std;
int main()
{
    int a[1000][1000];
    int m,n;
    cin>>m>>n;
    for(int i=0;i<m;i++){
        for(int j=0;j<n;j++){
            cin>>a[i][j];
        }
    }
    cout<<"The 2-D Array is:"<<endl;
    for(int i=0;i<m;i++){
        for(int j=0;j<n;j++){
            cout<<a[i][j]<<" ";
        }
    cout<<endl;
    }
    cout<<"The wave form of 2-D array is :"<<endl;
    //coloumn is constant row is changing
    //row will be the inner loop because its changing
    for(int j=0;j<n;j++){
        if(j%2==0){
            //topdown in even col
            for(int i=0;i<m;i++){
                cout<<a[i][j]<<" ";
            }
        }
        else{
            //bottom down in odd col
            for(int i=m-1;i>=0;i--){
                cout<<a[i][j]<<" ";
            }
        }
    }
}



================================================
FILE: Algorithms/Backtracking/Crossword/Crossword.cpp
================================================
/*
  Problem description:
  A 10 x 10 Crossword grid is provided,along with 
  a set of words (or names of places) which need 
  to be filled into the grid.The cells in the grid 
  are initially,either + signs or – signs.
  Cells marked with a ‘+’ have to be left as they are.
  Cells marked with a ‘-‘ need to be filled up with an 
  appropriate character.
*/

#include <bits/stdc++.h>
using namespace std;
#define N 10

//Return index of word which is not filled in crossword
bool findString(vector<bool> &visited, int &index)
{
  int n = visited.size();
  for (int i = 0; i < n; i++)
    if (visited[i] == 0)
    {
      index = i;
      return false;
    }
  return true;
}

//check if word can be filled in a column
bool isPossible_col(vector<vector<char>> &grid, int row, int col, string word)
{
  int len = word.size();
  for (int i = 0; i < len; i++)
  {
    if ((col + i) >= 10)
      return false;
    if (grid[row][col + i] != '-' && grid[row][col + i] != word[i])
      return false;
  }
  return true;
}

//check if word can be filled in a row.
bool isPossible_row(vector<vector<char>> &grid, int row, int col, string word)
{
  int len = word.size();
  for (int i = 0; i < len; i++)
  {
    if ((row + i) >= 10)
      return false;
    if (grid[row + i][col] != '-' && grid[row + i][col] != word[i])
      return false;
  }
  return true;
}

// Fill all words in crossword & return true if all words can be filled in the grid.
bool crossword(vector<vector<char>> &grid, vector<bool> &visited, vector<string> &words)
{
  int index;
  if (findString(visited, index))
    return true;
  for (int i = 0; i < 10; i++)
  {
    for (int j = 0; j < 10; j++)
    {
      if (grid[i][j] == '-' || grid[i][j] == words[index][0])
      {
        if (isPossible_col(grid, i, j, words[index]))
        {
          string prev_state = "";
          for (int k = 0; k < words[index].size(); k++)
            prev_state += grid[i][j + k], grid[i][j + k] = words[index][k];
          visited[index] = 1;
          bool flag = crossword(grid, visited, words);
          if (flag)
            return true;
          visited[index] = 0;
          for (int k = 0; k < words[index].size(); k++)
            grid[i][j + k] = prev_state[k];
        }
        if (isPossible_row(grid, i, j, words[index]))
        {
          string prev_state = "";
          for (int k = 0; k < words[index].size(); k++)
            prev_state += grid[i + k][j], grid[i + k][j] = words[index][k];
          visited[index] = 1;
          bool flag = crossword(grid, visited, words);
          if (flag)
            return true;
          visited[index] = 0;
          for (int k = 0; k < words[index].size(); k++)
            grid[i + k][j] = prev_state[k];
        }
      }
    }
  }
  return false;
}
int main()
{ //1. given crossword grid
  vector<vector<char>> grid(N, vector<char>(N));
  for (int i = 0; i < N; i++)
    for (int j = 0; j < N; j++)
      cin >> grid[i][j];
  
  //2. given words to be filled in Crossword
  int num_of_words;
  vector<string> words;
  string word;
  cin>>num_of_words;
  for(int i=0;i<num_of_words;i++)
  {
  	cin>>word;
  	words.push_back(word);
  }

  //3. calling function crossword to fill the grid
  vector<bool> visited(num_of_words, 0);
  if (crossword(grid, visited, words))
  {
    for (int i = 0; i < N; i++)
    {
      for (int j = 0; j < N; j++)
        cout << grid[i][j];
      cout << endl;
    }
  }
  else
  {
    cout << "We Cannot fill all the words in the grid" << endl;
  }
}

================================================
FILE: Algorithms/Backtracking/Nqueen/N_Queen.java
================================================
import java.util.*;
public class N_Queen {
	final int N=4;
	public boolean solveNQUtil(int board[][],int col) {
		if(col>=N)
			return  true;
		for(int i=0;i<N;i++) {
			if(isSafe(board,i,col)) {
				board[i][col]=1;
			if(solveNQUtil(board,col+1)) 
				return true;
			board[i][col]=0;
			}
		}
		return false;
		
	}
boolean isSafe(int board[][],int row,int col) {
	int i,j;
	for(i=0;i<col;i++) 
		if(board[row][i]==1)
			return false;
		for(i=row,j=col;i>=0&&j>=0;i--,j--)
			if(board[i][j]==1)
				return false;
		return true;
	
}


boolean solveNQ() {
	int board[][]= {{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}
			
	};

	if(solveNQUtil(board,0)==false) {
		System.out.println("solution does nor exist");
		return false;
	}
	
	printsolution(board);
	return true;
	
}


void printsolution(int board[][]) {
	for(int i=0;i<N;i++) {
		for(int j=0;j<N;j++) 
			System.out.print(" "+board[i][j]+"  ");
		System.out.println();
 }
}
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		
		N_Queen Queen= new N_Queen();
		Queen.solveNQ();
	}

}


================================================
FILE: Algorithms/Backtracking/Nqueen/Nqueens.c
================================================
#include<stdio.h>
#include<math.h>
 
char a[10][10];
int n;
 
void printmatrix() {
   int i, j;
   printf("\n");
 
   for (i = 0; i < n; i++) {
      for (j = 0; j < n; j++)
         printf("%c\t", a[i][j]);
      printf("\n\n");
   }
}
 
int getmarkedcol(int row) {
   int i;
   for (i = 0; i < n; i++)
      if (a[row][i] == 'Q') {
         return (i);
         break;
      }
}
 
int feasible(int row, int col) {
   int i, tcol;
   for (i = 0; i < n; i++) {
      tcol = getmarkedcol(i);
      if (col == tcol || abs(row - i) == abs(col - tcol))
         return 0;
   }
   return 1;
}
 
void nqueen(int row) {
   int i, j;
   if (row < n) {
      for (i = 0; i < n; i++) {
         if (feasible(row, i)) {
            a[row][i] = 'Q';
            nqueen(row + 1);
            a[row][i] = '.';
         }
      }
   } else {
      printf("\nThe solution is:- ");
      printmatrix();
   }
}
 
int main() {
   int i, j;
 
   printf("\nEnter the no. of queens:- ");
   scanf("%d", &n);
 
   for (i = 0; i < n; i++)
      for (j = 0; j < n; j++)
         a[i][j] = '.';
 
   nqueen(0);
   return (0);
}


================================================
FILE: Algorithms/Backtracking/Nqueen/Nqueens.cpp
================================================
#include<bits/stdc++.h>
#define ll long long
#define mod 1000000007;
using namespace std;
bool isvalid(int board[][10],int i,int j,int n)
{
    for(int k=0;k<i;k++)
    {
        if(board[k][j]==1)
        {
            return false;
        }
    }
    int x=i;
    int y=j;
    while(x>=0&&y>=0)
    {
        if(board[x][y]==1)
        {
            return false;
        }
        x--;
        y--;
    }
     x=i;
     y=j;
    while(x>=0&&y<n)
    {
        if(board[x][y]==1)
        {
            return false;
        }
        x--;
        y++;
    }
    return true;
}
bool showNqueen(int board[][10],int i,int n)
{
    if(i==n)
    {
       for(int a=0;a<n;a++)
       {
           for(int b=0;b<n;b++)
           {
               if(board[a][b]==1)
               {
                   cout<<"1 ";
               }else
               {
                   cout<<"0 ";
               }
           }
           cout<<endl;
       }


        return true;
    }
    for(int j=0;j<n;j++)
    {
        if(isvalid(board,i,j,n))
        {
            board[i][j]=1;
            if(showNqueen(board,i+1,n))
            {
                return true;
            }
            board[i][j]=0;
        }
    }
    return false;
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int board[10][10]={0};
    int n;
    cin>>n;
    bool f=showNqueen(board,0,n);
    return 0;
}


================================================
FILE: Algorithms/Backtracking/Nqueen/Nqueens_optimized.cpp
================================================
#include<bits/stdc++.h>
#define ll long long
#define mod 1000000007;
using namespace std;
int c=0;
int column[100]={0},d1[100]={0},d2[100]={0};

void solve(int i,int n)
{
    if(i==n)
    {
        c++;
        return ;
    }
    for(int j=0;j<n;j++)
    {
        if(column[j]==0&&d1[i-j+n-1]==0&&d2[i+j]==0)
        {
            column[j]=1;
            d1[i-j+n-1]=1;
            d2[i+j]=1;
            solve(i+1,n);
            column[j]=0;
            d1[i-j+n-1]=0;
            d2[i+j]=0;
        }
    }
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int n;
    cin>>n;
    solve(0,n);
    cout<<c<<endl;
    return 0;
}


================================================
FILE: Algorithms/Backtracking/Nqueen/nqueen.cpp
================================================
//N-queen program using Backtracking in C++ by Apurva
#include<iostream>
using namespace std;
int grid[10][10];
//print the solution
void print(int n) {
    for (int i = 0;i <= n-1; i++) {
        for (int j = 0;j <= n-1; j++) {
            
                cout <<grid[i][j]<< " ";
            
        }
        cout<<endl;
    }
    cout<<endl;
    cout<<endl;
}
bool isSafe(int col, int row, int n) {
  //check for same column
    for (int i = 0; i < row; i++) {
        if (grid[i][col]) {
            return false;
        }
    }
    for (int i = row,j = col;i >= 0 && j >= 0; i--,j--) {
        if (grid[i][j]) {
            return false;
        }
    }
    for (int i = row, j = col; i >= 0 && j < n; j++, i--) {
        if (grid[i][j]) {
            return false;
        }
    }
    return true;
}
bool solve (int n, int row) {
    if (n == row) {
        print(n);
        return true;
    }
    bool res = false;
    for (int i = 0;i <=n-1;i++) {
        if (isSafe(i, row, n)) {
            grid[row][i] = 1;
            res = solve(n, row+1) || res;//if res ==false then backtracking will occur 
            grid[row][i] = 0;
        }
    }
    return res;
}
int main()
{
  ios_base::sync_with_stdio(false);
    cin.tie(NULL);
        int n;
        cout<<"Enter the number of queen"<<endl;
        cin >> n;
        for (int i = 0;i < n;i++) {
            for (int j = 0;j < n;j++) {
                grid[i][j] = 0;
            }
        }
        bool res = solve(n, 0);
        if(res == false) {
            cout << -1 << endl;
        } else {
            cout << endl;
        }
  return 0;
}


================================================
FILE: Algorithms/Backtracking/Nqueen/nqueens.py
================================================
global N 
N = 4

def printSolution(board): 
	for i in range(N): 
		for j in range(N): 
			print(board[i][j],end=",")
		print(" ")
  
def isSafe(board, row, col): 

	# Check this row on left side 
	for i in range(col): 
		if board[row][i] == 1: 
			return False

	# Check upper diagonal on left side 
	for i, j in zip(range(row, -1, -1), range(col, -1, -1)): 
		if board[i][j] == 1: 
			return False

	# Check lower diagonal on left side 
	for i, j in zip(range(row, N, 1), range(col, -1, -1)): 
		if board[i][j] == 1: 
			return False

	return True

def solveNQUtil(board, col): 
	if col >= N: 
		return True
	for i in range(N): 

		if isSafe(board, i, col): 
			# Place this queen in board[i][col] 
			board[i][col] = 1

			# recur to place rest of the queens 
			if solveNQUtil(board, col + 1) == True: 
				return True
			board[i][col] = 0

	return False
def solveNQ(): 
	board = [ [0, 0, 0, 0], 
			[0, 0, 0, 0], 
			[0, 0, 0, 0], 
			[0, 0, 0, 0] 
			] 

	if solveNQUtil(board, 0) == False: 
		print("Solution does not exist")
		return False

	printSolution(board) 
	return True

# driver program to test above function 
solveNQ() 




================================================
FILE: Algorithms/Backtracking/Permutation/Permutations.c
================================================
#include<stdio.h>
#include<stdlib.h>
#include<conio.h>

void swap(int *ar, int i, int j)
{
  int temp = ar[i];
  ar[i] = ar[j];
  ar[j] = temp;
}

void printar(int *ar, int n)
{
  for (int i = 0; i < n; i++)
    printf("%d ", ar[i]);

  printf("\n");
}

void permute(int *ar, int i, int n)
{
  if (n == i) {

    printar(ar, n);
    return;
  }

  int j = i;
  for (j = i; j < n; j++)
  {
    swap(ar, i, j);
    permute(ar , i + 1, n);
    swap(ar, i, j);
  }

  return;
}

int main()
{
  int n;
  scanf("%d", &n);

  int ar[n];

  for (int i = 0; i < n; i++)
    scanf("%d", &ar[i]);

  permute(ar, 0, n);

}

================================================
FILE: Algorithms/Backtracking/Permutation/permutation.py
================================================
def permutation(arr):
    if(len(arr) == 1):
        return [arr]
    
    result = []

    for i in arr:
        #Array excluding i element
        sub_arr = [j for j in arr if j != i]
        p = permutation(sub_arr)

        for k in p:
            temp = [i]+k
            result.append(temp)

    return result


================================================
FILE: Algorithms/Backtracking/Permutation/permutations.cpp
================================================
#include<iostream>
using namespace std;
void solve(vector<int>& nums, vector<int>& curr, vector<vector<int>> &res, int i){
   if(curr.size()==nums.size())
        //one possible permutation obtained-
        res.push_back(curr);
   else {
        //backtracking algorithm implementation-
        for(int j=i; j<nums.size(); j++){
           curr.push_back(nums[j]);
           swap(nums[j], nums[i]);
           solve(nums, curr, res, i+1);
           swap(nums[j], nums[i]);
           curr.pop_back();
        }
   }
   return;
}
vector<vector<int>> permute(vector<int>& nums) {
   vector<vector<int>>res;
   vector<int>curr;
   solve(nums, curr, res, 0);
   return res;
}
int main() {
   int n;
   cin >> n;
   vector<int>arr(n);
   for(int i=0; i<n; i++)
       cin >> arr[i];
   vector<vector<int>> answer = permute(arr);
   //printing all the possible permutation arrays -
   for(int i=0; i<answer.size(); i++){
       cout << "[ " ;
       for(int j=0; j<n; j++){
           cout << answer[i][j] << " " ;
       }
       cout << "]" << "\n";
   }
   return 0;
}


================================================
FILE: Algorithms/Backtracking/Permutation/permutations.js
================================================
//Heap's Algorithm

//Print Function
function print(list,length){
  empty_list = []
  for(var i=0;i<length;i++){
    empty_list.push(list[i])
  }
  console.log(empty_list)
}

function permutation(list,size,length){
  // if size 1, print self
  if(size==1) print(list,length)

  for(var j=0;j<size;j++){

    //recursive function
    permutation(list,size-1,length)

    //if size is odd, swap first and last element
    if(size % 2 == 1){
      var temp = list[0]
      list[0] = list[size-1]
      list[size-1] = temp
    }

    //else swap ith and last element
    else{
      var temp = list[j]
      list[j] = list[size-1]
      list[size-1] = temp
    }
      
  }

}

//Test
var list = [4,5,6]
size = list.length
permutation(list,size,size)


================================================
FILE: Algorithms/Backtracking/README.md
================================================
# This folder is empty.


================================================
FILE: Algorithms/Backtracking/Rat-In-A-Maze/Rat-In-A-Maze.cpp
================================================
//https://practice.geeksforgeeks.org/problems/rat-in-a-maze-problem/1 - Link to problem statement

#include <bits/stdc++.h>
using namespace std;

//function that returns the list of paths in lexicographically increasing order
void rat_in_a_maze(int i, int j, int n, vector<vector<int>> &grid, vector<string> &paths, string &path)
{
    //base case
    if (i == n - 1 && j == n - 1) {
        paths.push_back(path);
        return;
    }

    //if grid[0][0] is -1, no recursion takes place...
    if (grid[i][j] == 0) {
        return;
    }

    //moving down('D')
    if ((i + 1) < n && grid[i + 1][j] == 1)
    {
        int x = grid[i][j];
        path.push_back('D');
        grid[i][j] = -1; //indicates this to be visited
        rat_in_a_maze(i + 1, j, n, grid, paths, path);
        path.pop_back(); //undoing change
        grid[i][j] = x; //restoring the grid
    }

    //moving down('L')
    if ((j - 1) >= n && grid[i][j - 1] == 1)
    {
        int x = grid[i][j];
        path.push_back('L');
        grid[i][j] = -1; //indicates this to be visited
        rat_in_a_maze(i, j - 1, n, grid, paths, path);
        path.pop_back(); //undoing change
        grid[i][j] = x; //restoring the grid
    }

    //moving down('R')
    if ((j + 1) < n && grid[i][j + 1] == 1)
    {
        int x = grid[i][j];
        path.push_back('R');
        grid[i][j] = -1; //indicates this to be visited
        rat_in_a_maze(i, j + 1, n, grid, paths, path);
        path.pop_back(); //undoing change
        grid[i][j] = x; //restoring the grid
    }

    //moving down('U')
    if ((i - 1) >= 0 && grid[i - 1][j] == 1)
    {
        int x = grid[i][j];
        path.push_back('U');
        grid[i][j] = -1; //indicates this to be visited
        rat_in_a_maze(i - 1, j, n, grid, paths, path);
        path.pop_back(); //undoing change
        grid[i][j] = x; //restoring the grid
    }
}

int main()
{
    int n;//size of the grid (n * n)
    cin >> n;

    vector<vector<int>> grid(n, vector<int> (n, 0));
    for (int i = 0; i < n; ++i)
    {
        for (int j = 0; j < n; ++j)
        {
            cin >> grid[i][j];
        }
    }

    vector<string> paths;
    string path;

    rat_in_a_maze(0, 0, n, grid, paths, path);

    cout<<"The Paths from the Top Right to Bottom Left are : \n";

    for (string s : paths) {
        cout << s << " ";
    }
    cout << endl;
}

================================================
FILE: Algorithms/Cryptography/AES_Cipher/AES_Cipher.py
================================================
import sys, base64, json, math
try:
   from Crypto.Cipher import AES
except ImportError:
   print ("Error!! Module AES is required. Run either or following commands")
   print("pip install pycrypto")
   print("---------OR--------")
   print("pip3 install pycrypto")
   sys.exit()

KEY=""
PADDING_CHARACTER="S"
VECTOR_FOR_AES="SUDESH1611GITHUB"

def GetKey():
    global KEY
    tempKey = input("Enter password(min length: 8, max length: 32)")
    while(len(tempKey.strip())<8 or len(tempKey.strip())>32 or ' ' in tempKey):
        if(' ' in tempKey):
            print("White spaces are not allowed!")
        else:
            print("Password must be at least 8 characters long and at max 32 characters long. Try Again!")
    while(len(tempKey)%8!=0):
        tempKey+=PADDING_CHARACTER
    KEY=tempKey

def AES_Encryption(cleartext):
    if(len(KEY)<8 or len(KEY)%8!=0):
        print("Password is corrupted. Exiting!")
        sys.exit()
        return
    AES_Encryptor = AES.new(KEY,AES.MODE_CBC,VECTOR_FOR_AES)
    cleartext_length = len(cleartext)
    nearest_multiple_of_16 = 16 * math.ceil(cleartext_length/16)
    padded_cleartext = cleartext.rjust(nearest_multiple_of_16)
    raw_ciphertext = AES_Encryptor.encrypt(padded_cleartext)
    return base64.b64encode(raw_ciphertext).decode('utf-8')

def AES_Decryption(ciphertext):
    if(len(KEY)<8 or len(KEY)%8!=0):
        print("Password is corrupted. Exiting!")
        sys.exit()
        return
    AES_Decryptor = AES.new(KEY,AES.MODE_CBC,VECTOR_FOR_AES)
    raw_ciphertext = base64.b64decode(ciphertext)
    decrypted_message_with_padding = AES_Decryptor.decrypt(raw_ciphertext)
    return decrypted_message_with_padding.decode('utf-8').strip()

if __name__ == "__main__":
    type="S"
    while(type not in "ed"):
        type = input("Encrypt or Decrypt the text(e/d): ")
        type = type.strip().lower()
        if(len(type)!=1):
            type="S"
    GetKey()
    if(type=="e"):
        print("NOTE: If you forget this password, you will not be able to decrypt text correctly. So, DO NOT FORGET PASSWORD!!")
        message = input("Enter message in single line: ")
        ciphertext = AES_Encryption(message)
        print("Encrypted Message: %s" % ciphertext)
    else:
        encText = input("Enter encrypted message: ")
        message = AES_Decryption(encText)
        print("Original Message: %s" % message)


================================================
FILE: Algorithms/Cryptography/AES_Cipher/README.md
================================================
## AES
The Advanced Encryption Standard (AES), also known by its original name Rijndael is a specification for the encryption of electronic data with different key and block sizes.


================================================
FILE: Algorithms/Cryptography/Affine_Cipher/Affine_Cipher.cpp
================================================
// In the affine cipher the letters of an alphabet of size m are first mapped to the integers in the range 0 … m − 1. 
// It then uses modular arithmetic to transform the integer that each plaintext letter corresponds to into another 
// integer that correspond to a ciphertext letter.

// ENCYPTION 
// E(x) = (a*x + b) % 26
// DECRYPTION
// D(x) = a^-1(x - b) % 26
// where a^-1 is modular multiplicative inverse of a




#include<bits/stdc++.h> 
using namespace std; 
  
int a = 5; 
int b = 8; 
int inv_a;


// encryptMessage: encrypt the given text using affine ciper

// param text: the text which need to pe encrypted
// type test: string
// param func: custom func can be passed by the user which will be used in affine cipher
// type func: function (int) ->int
// default func: x: a*x + b
  
string encryptMessage(string text, int (*func)(int)=NULL) 
{ 

    string encrypted_text = "";
    if(func==NULL){
        func = [](int x){   return a*x + b; };
    }

    int mod = 26;
    for(const char character : text)
    {

        //to check the case and convert the character in that specific case
        //else if characte is not a alphabet don't change it
        int ascii_val, new_ascii_val;
        if (isupper(character))
        {
            ascii_val = int(character) - int('A');
            new_ascii_val = func(ascii_val) % mod;
            new_ascii_val += int('A');
        }

        else if (islower(character))
        {   
            ascii_val = int(character) - int('a');
            new_ascii_val = func(ascii_val) % mod;
            new_ascii_val += int('a');
        }

        else 
        {
            ascii_val = int(character);
            new_ascii_val = ascii_val;
        }

        encrypted_text = encrypted_text + char(new_ascii_val);
    }
    
    return encrypted_text;

} 


  
// decryptMessage: decrypt the given text using affine ciper

//  param text: the encrypted text which need to pe decrypted
//  type test: str
//  param func: custom func can be passed by the user which will be used in affine cipher
//  type func: function 
//  default func: x: inv_a*(x - b)
  
string decryptMessage(string text, int (*func)(int)=NULL) 
{ 
    
// finding modular multiplicative inverse of a
    for(int i = 0; i < 26; i++)
    {
        if((i*a)%26 == 1){   inv_a = i; break;   }
    }

    string decyrpted_text = "";
    if(func==NULL){
        func = [](int x){   
            return inv_a*(x - b); 
        };
    }

    int mod = 26;
    for(const char character : text)
    {

        //to check the case and convert the character in that specific case
        //else if characte is not a alphabet don't change it
        int ascii_val, new_ascii_val;
        if (isupper(character))
        {
            ascii_val = int(character) - int('A');
            new_ascii_val = func(ascii_val) % mod;
            new_ascii_val = new_ascii_val<0 ? mod + new_ascii_val : new_ascii_val;
            new_ascii_val += int('A');
        }

        else if (islower(character))
        {   
            ascii_val = int(character) - int('a');
            new_ascii_val = func(ascii_val) % mod;
            new_ascii_val = new_ascii_val<0 ? mod + new_ascii_val : new_ascii_val;
            new_ascii_val += int('a');
        }

        else 
        {
            ascii_val = int(character);
            new_ascii_val = ascii_val;
        }

        decyrpted_text = decyrpted_text + char(new_ascii_val);
    }
    
    return decyrpted_text;

} 
  

int main(void) 
{ 
    string msg;
    getline(cin,msg); 

    // custom function can also be used   
    string cipherText = encryptMessage(msg); 
    cout << "Encrypted Message is : " << cipherText<<endl; 
    cout << "Decrypted Message is: " << decryptMessage(cipherText); 
  
    return 0; 
} 


================================================
FILE: Algorithms/Cryptography/Affine_Cipher/Affine_Cipher.py
================================================
'''
In the affine cipher the letters of an alphabet of size m are first mapped to the integers in the range 0 … m − 1. 
It then uses modular arithmetic to transform the integer that each plaintext letter corresponds to into another 
integer that correspond to a ciphertext letter.

ENCYPTION 
E(x) = (a*x + b) % 26
DECRYPTION
D(x) = a^-1(x - b) % 26
where a^-1 is modular multiplicative inverse of a
'''

# custom constants 
''' these are the custom constants which can be edited'''
a = 5
b = 10



'''
    encryptMessage: encrypt the given text using affine ciper

    param text: the text which need to pe encrypted
    type test: str
    param func: custom func can be passed by the user which will be used in affine cipher
    type func: function 
    default func: x: a*x + b
'''
def encryptMessage(text, func = lambda x: a*x + b):

    encrypted_text = ""
    mod = 26
    for character in text:


        # to check the case and convert the character in that specific case
        # else if characte is not a alphabet don't change it
        if character.isupper():
            ascii_val = ord(character) - ord('A')
            new_ascii_val = func(ascii_val) % mod
            new_ascii_val += ord('A')

        elif character.islower():
            ascii_val = ord(character) - ord('a')
            new_ascii_val = func(ascii_val) % mod
            new_ascii_val += ord('a')
        else:
            ascii_val = ord(character)
            new_ascii_val = ascii_val

        encrypted_text = encrypted_text + chr(new_ascii_val)

    
    return encrypted_text


# finding modular multiplicative inverse of a
inv_a = a
for i in range(26):
    if i*a%26 == 1: inv_a = i; break



'''
   decryptMessage: decrypt the given text using affine ciper

    param text: the encrypted text which need to pe decrypted
    type test: str
    param func: custom func can be passed by the user which will be used in affine cipher
    type func: function 
    default func: x: inv_a*(x - b)
'''
def decryptMessage(text, func = lambda x: inv_a*(x - b)):

    decrypted_text = ""
    mod = 26
    for character in text:


        # to check the case and convert the character in that specific case
        # else if characte is not a alphabet don't change it
        if character.isupper():
            ascii_val = ord(character) - ord('A')
            new_ascii_val = func(ascii_val) % mod
            new_ascii_val += ord('A')

        elif character.islower():
            ascii_val = ord(character) - ord('a')
            new_ascii_val = func(ascii_val) % mod
            new_ascii_val += ord('a')
        else:
            ascii_val = ord(character)
            new_ascii_val = ascii_val

        decrypted_text = decrypted_text + chr(new_ascii_val)

    
    return decrypted_text


#--------------------------------------------------------------------

def  main():
    
    text = input("enter your text: ")

    # custom function can also be used 
    # eg. encryptMessage(text, func = lambda x: 7*x + 11 ) 
    cipher = encryptMessage(text)
    print("encrypted text : " + cipher)
    print("decypted text : " + decryptMessage(cipher))

    
main()

================================================
FILE: Algorithms/Cryptography/Affine_Cipher/README.md
================================================
## This folder is empty.


================================================
FILE: Algorithms/Cryptography/Affine_Cipher/affine_cipher.c
================================================
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<ctype.h>
#include<stdlib.h>
#define MAX 100000

int CalcGCD(int);

int CalcGCD(int alpha)
{
	int x;
	int temp1 = alpha;
	int temp2 = 26;

	while (temp2 != 0)
	{
		x = temp2;
		temp2 = temp1 % temp2;
		temp1 = x;
	}
	return (temp1);
}

int main()
{
	int i, j, k, gcd, alpha, beta, numstr[100], numcipher[100];

	char str[100], cipher[100];

	printf("Enter a string\n");

	fgets(str, MAX, stdin);

	for (i = 0, j = 0; i < strlen(str); i++)
	{
		if (str[i] != ' ')
		{
			str[j] = toupper(str[i]);
			j++;
		}
		else
		{
			str[j] = ' ';
			j++;
		}
	}

	str[j] = '\0';

	printf("Enter Alpha value and must be between 1 and 25 both included\n");
	scanf("%d", &alpha);

	if (alpha < 1 || alpha > 25)
	{
		printf("Alpha should lie in between 1 and 25\nSorry Try again !\n");
		exit(0);
	}

	gcd = CalcGCD(alpha);

	if (gcd != 1)
	{
		printf("gcd(alpha,26)=1 but \n gcd(%d,26)=%d\nSorry Try again !\n", alpha, gcd);
		exit(0);
	}

	printf("Enter Beta value and must be between 0 and 25 both included\n");
	scanf("%d", &beta);

	if (beta < 0 || beta > 25)
	{
		printf("Beta value should lie between 0 and 25\nSorry Try again !\n");
		exit(0);
	}

	for (i = 0; i < strlen(str); i++)
	{
		if (str[i] != ' ')
			numstr[i] = str[i] - 'A';
		else
			numstr[i] = -20;
	}

	printf("Affine Cipher text is: ");

	for (i = 0; i < strlen(str); i++)
	{
		if (numstr[i] != -20)
		{
			numcipher[i] = ((alpha * numstr[i]) + beta) % 26;
			printf("%c", (numcipher[i] + 'A'));
		}
		else
		{
			printf(" ");
		}
	}

	printf("\n");

}


================================================
FILE: Algorithms/Cryptography/Bifid_Cipher/Bifid_Cipher.py
================================================
 
"""
@author: Abhinav Tiwari

@github: abhinav-idle
"""

"""
Bifid Cipher was invented in 1901 by Felix Delastelle.

Bifid cipher is a cipher in which we combine polybius 
square with transposition and fractionation i.e 
we use regular system to shift the letters of input-text
so that the cipher-text constitutes
of permutaion of different plaintext(transposition) as in 
here we replace each letter of input text with respect to 
it co-ordinates in polybius square (fractionation).
the co-ordinates are stored in row by column arrays 
respectively.
After performing these steps for every letter in input text
we have two arrays of equal length constituting of rows and 
columns of each letter, we then concatinate both the arrays
making one array, then we make couples of two and get the 
character according to the polybius square and concatinate 
each character to the encrypted text.
Voila, we have done bifid encryption, to cross verify you can 
decrypt the encrypted message to get back the originat text, by 
reverting each step and using the same polybius square.


In this cipher I'll use a custom 8x8 polybis square to 
cover complex encryption/decryption that includes any 
alpha-numeric combination of the following characters i.e 
        A-Z, a-z, 0-9, ?, @
One can use their own customized polybius square to 
encrypt even more complex input text.
"""

def find_pos(polybius_square, character):
    #returns the co-ordinates of character according to polybius square created as a 
    #tuple of co-ordinates, indexing is done from 1 and not from 0.
    
    for i in range(8):
        
        #to avoid error we've used try exceplt block, as index function raises ValueError 
        #when elemnt is not found in list.
        
        try:
            j = polybius_square[i].index(character)
            return i + 1, j + 1
        
        except ValueError:
            pass

def get_word(a, b, polybius_square):
    
    #returns the character present at (a - 1, b - 1) co-ordinate
    #indexing is from 1 so, we're substracting 1 to get actual co-ordinates.
    
    return polybius_square[a-1][b-1]   
     
def create_polybius_square():
    
    #create and return polybius square as a list
    
    arr = []
    num = 48    #for numeric characters 0-9.
    upper_case = 63    #for uppercase alphabets A-Z and ?,@.
    lower_case = 97    #for lowercase alphabets a-z. 
    
    for i in range(8):
        
        sub_arr = []
        cnt = 0
        
        while(cnt<8):
        
            if num<=57 and cnt<8:
                sub_arr.append(chr(num))
                num += 1 
                cnt += 1
            
            if upper_case<=90 and cnt<8:
                sub_arr.append(chr(upper_case))
                upper_case += 1
                cnt+=1
                
            if lower_case<=122 and cnt<8:
                sub_arr.append(chr(lower_case))
                lower_case += 1
                cnt+=1
            
        arr.append(sub_arr)
    
    return arr

def bifid_encryption(polybius_square, text):
    #implementing bifid-encryption
    
    #to store co-ordinates
    row = []
    column = []

    for letter in text:
        i,j = find_pos(polybius_square, letter)
        row.append(i)
        column.append(j)

    array = []    
    array.extend(row)
    array.extend(column)

    encrypted_text = ""
    
    for i in range(0,len(array),2):
        character = get_word(array[i], array[i+1], polybius_square)
        encrypted_text += character

    return encrypted_text   
 
def decryption(polybius_square, encrypted_text):    
    #decrypt message
    
    array = []
    for text in encrypted_text:
        array.extend(list(find_pos(polybius_square,text)))

    row  = array[:len(array)//2]
    column  = array[len(array)//2:]

    original_text = ""
    
    for i in range(len(row)):
        original_text += get_word(row[i],column[i],polybius_square)
    
    return original_text    


def main():
    
    #Enter text to encrypt

    text = input()

    #created polybius square
    polybius_square = create_polybius_square()

    print("Encrypted text : ",bifid_encryption(polybius_square, text))
    print("Original text : ",decryption(polybius_square, bifid_encryption(polybius_square, text)))

main()


================================================
FILE: Algorithms/Cryptography/Bifid_Cipher/README.md
================================================
## This folder is empty.


================================================
FILE: Algorithms/Cryptography/CIA_Triad_Ciper/README.md
================================================
## This folder is empty.


================================================
FILE: Algorithms/Cryptography/Caesar_Cipher/Caesar Cypher.cpp
================================================
#include<iostream>
#include<string.h>
using namespace std;
int main() {
   cout<<"Enter the message:\n";
   char msg[100];
   cin.getline(msg,100); //take the message as input
   int i, j, length,choice,key;
   cout << "Enter key: ";
   cin >> key; //take the key as input
   length = strlen(msg);
   cout<<"Enter your choice \n1. Encryption \n2. Decryption \n";
   cin>>choice;
   if (choice==1) //for encryption{
      char ch;
      for(int i = 0; msg[i] != '\0'; ++i) {
         ch = msg[i];
         //encrypt for lowercase letter
         If (ch >= 'a' && ch <= 'z'){
            ch = ch + key;
            if (ch > 'z') {
               ch = ch - 'z' + 'a' - 1;
            }  
            msg[i] = ch;
         }
         //encrypt for uppercase letter
         else if (ch >= 'A' && ch <= 'Z'){
            ch = ch + key;
            if (ch > 'Z'){
               ch = ch - 'Z' + 'A' - 1;
            }
            msg[i] = ch;
         }
      }
      printf("Encrypted message: %s", msg);
   }
   else if (choice == 2) { //for decryption
      char ch;
      for(int i = 0; msg[i] != '\0'; ++i) {
         ch = msg[i];
         //decrypt for lowercase letter
         if(ch >= 'a' && ch <= 'z') {
            ch = ch - key;
            if(ch < 'a'){
               ch = ch + 'z' - 'a' + 1;
            }
            msg[i] = ch;
         }
         //decrypt for uppercase letter
         else if(ch >= 'A' && ch <= 'Z') {
            ch = ch - key;
            if(ch < 'A') {
               ch = ch + 'Z' - 'A' + 1;
            }
            msg[i] = ch;
         }
      }
      cout << "Decrypted message: " << msg;
   }
}

================================================
FILE: Algorithms/Cryptography/Caesar_Cipher/Caesar Cypher.py
================================================
def encrypt(text,s):
result = ""
   # transverse the plain text
   for i in range(len(text)):
      char = text[i]
      # Encrypt uppercase characters in plain text
      
      if (char.isupper()):
         result += chr((ord(char) + s-65) % 26 + 65)
      # Encrypt lowercase characters in plain text
      else:
         result += chr((ord(char) + s - 97) % 26 + 97)
      return result
#check the above function
text = input()
s = input()

print "Plain Text : " + text
print "Shift pattern : " + str(s)
print "Cipher: " + encrypt(text,s)

================================================
FILE: Algorithms/Cryptography/Caesar_Cipher/CaesarCipher.java
================================================
import java.util.Scanner;

public class CaesarCipher {
    public static final int SHIFT_MAX = 26;

    public static int shiftChar(int c, int shift) {
        shift = (shift+SHIFT_MAX)%SHIFT_MAX;

        if ('a' <= c && c <= 'z') {
            return ((c - 'a' + shift)%SHIFT_MAX + 'a');
        } else if ('A' <= c && c <= 'Z') {
            return ((c - 'A' + shift)%SHIFT_MAX + 'A');
        } else {
            return c;
        }
    }

    public static String cipher(String str, int shift) {
        return str.chars().map(c->shiftChar(c, shift)).collect(
                StringBuilder::new,
                StringBuilder::appendCodePoint,
                StringBuilder::append).toString();
    }

    public static String cipher(String str) {
        return cipher(str, 13);
    }

    public static String decipher(String str, int shift) {
        return cipher(str, SHIFT_MAX - shift);
    }

    public static String decipher(String str) {
        return decipher(str, 13);
    }

    public static void main(String [] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.print("Enter shift (Caesar's = 13): ");
        int shift = scanner.nextInt();
        System.out.println("Enter text to be encrypted:");
        System.out.print("> ");

        String text = scanner.nextLine(); // We read empty newline
        text = scanner.nextLine();

        String crypt = cipher(text, shift);
        System.out.println(crypt);
        System.out.println(decipher(crypt, shift));
    }
}


================================================
FILE: Algorithms/Cryptography/Caesar_Cipher/Caesar_Cipher.c
================================================
#include<stdio.h>

int main() {
    char message[100], ch;
    int i, key;

    printf("Message to encrypt: ");
    gets(message);
    do {
        printf("Key: ");
        scanf("%d", & key);
    } while (key < 0 || key > 26);

    for (i = 0; message[i] != '\0'; ++i) {
        ch = message[i];

        if (ch >= 'a' && ch <= 'z') {
            ch = ch + key;

            if (ch > 'z') {
                ch = ch - 'z' + 'a' - 1;
            }

            message[i] = ch;
        } else if (ch >= 'A' && ch <= 'Z') {
            ch = ch + key;

            if (ch > 'Z') {
                ch = ch - 'Z' + 'A' - 1;
            }

            message[i] = ch;
        }
    }

    printf("Encrypted message: %s\n", message);

    return 0;
}


================================================
FILE: Algorithms/Cryptography/Caesar_Cipher/Caesar_Cipher.cs
================================================
using System;

class Program
{
    /// <summary>
    /// Shifts every character of a given string by a specified amount
    /// and returns the shifted string.
    /// </summary>
    private static string CaesarCipher(string text, int shiftAmount)
    {
        char[] characters = text.ToCharArray();

        for (int i = 0; i < characters.Length; i++)
        {
            char character = characters[i];

            if (char.IsLetter(character) == false) { continue; }

            int offsetCharacter = (char.IsLower(character) ? 'a' : 'A');

            characters[i] = (char)((((character + shiftAmount) - offsetCharacter) % 26) + offsetCharacter);
        }

        return string.Join(string.Empty, characters);
    }

    /// <summary>
    /// Encrypts the given text using the Caesar cipher.
    /// </summary>
    private static string Encrypt(string text, int shiftAmount)
    {
        return Program.CaesarCipher(text, shiftAmount);
    }

    /// <summary>
    /// Decrypts the given text using the Caesar cipher.
    /// </summary>
    private static string Decrypt(string text, int shiftAmount)
    {
        return Program.CaesarCipher(text, (26 - shiftAmount));
    }

    /// <summary>
    /// Main application function.
    /// </summary>
    static void Main()
    {
        bool shouldEncrpyt;
        int shiftAmount;
        string textToProcess, userInput;
        
        Console.WriteLine("Do you want to [E]ncrypt or [D]ecrypt? (Enter \"E\" or \"D\"):");
        userInput = Console.ReadLine().ToLower();
        
        if ((userInput != "e") && (userInput != "d")) { Program.ExitAfterInvalidInput(); }
        
        shouldEncrpyt = (userInput == "e");

        Console.WriteLine(string.Format("Enter the text to {0}:", (shouldEncrpyt ? "encrypt" : "decrypt")));
        userInput = Console.ReadLine();
        
        if (string.IsNullOrWhiteSpace(userInput)) { Program.ExitAfterInvalidInput(); }
        
        textToProcess = userInput;

        Console.WriteLine("Enter an integer for the shift amount (key):");
        userInput = Console.ReadLine();
        
        if (int.TryParse(userInput, out shiftAmount) == false) { Program.ExitAfterInvalidInput(); }

        string result = (shouldEncrpyt ? Program.Encrypt(textToProcess, shiftAmount) : Program.Decrypt(textToProcess, shiftAmount));
        
        Console.WriteLine();
        Console.WriteLine(string.Format("Result: {0}", result));
    }
    
    /// <summary>
    /// Informs the user that an invalid value has been entered and exits the program.
    /// </summary>
    private static void ExitAfterInvalidInput()
    {
        Console.WriteLine("You've entered an invalid value. Exiting...");
        Environment.Exit(1);
    }
}


================================================
FILE: Algorithms/Cryptography/Caesar_Cipher/Caesar_Cipher.js
================================================
var caesarEncypt = function(str, key) {

    if (key < 0) {
        return caesarEncypt(str, key + 26);
    }

    var encrypted = "";

    for (var i = 0; i < str.length; i++) {

        var c = str[i];

        if (c.match(/[a-z]/i)) {

            var code = str.charCodeAt(i);

            if (code >= 65 && code <= 90) {
                c = String.fromCharCode(((code - 65 + key) % 26) + 65);
            } else if (code >= 97 && code <= 122) {
                c = String.fromCharCode(((code - 97 + key) % 26) + 97);
            }
        }

        encrypted += c;
    }

    return encrypted;
};


================================================
FILE: Algorithms/Cryptography/Caesar_Cipher/Caesar_Cipher.php
================================================
<?php
function cipher(string $str, int $key)
{   
    $k = $key % 26;

    $input = array_map(function($char){
        return ord($char);
    }, str_split($str));
    
    $res = array_map(function($char) use($k){
        //capital letters
        if($char > 64 && $char < 91)
        {
            return chr(65 + ($char + $k) % 65 % 26);
        }
        else if($char > 96 && $char < 123)
        {
            return chr(97 + ($char + $k) % 97 % 26);
        }
        else
        {
            return chr($char);
        }
    }, $input);

    return implode($res);
}

?>


================================================
FILE: Algorithms/Cryptography/Caesar_Cipher/Caesar_Cypher.rb
================================================
class CaesarCipher
  ORDER_ALPHABET = ("a".."z").to_a # Array of valid letter rotation (Only english alphabet letters)
  class << self
    def encrypt(sentence, times = 3)
      # Converts to_s allowing to map through each char of it
      sentence.to_s.chars.map.with_index {|char, index|
        # If char is not included in the array, return the char without rotate
        ORDER_ALPHABET.include?(char.downcase) ? rotate(times, char, index) : char
      }.join("")
    end
  
    private
    # Rotates the n times assigned by the user
    def rotate(times,current_char, index)
      ORDER_ALPHABET.rotate(times)[ORDER_ALPHABET.index(current_char.downcase)]
    end
  end
end

puts CaesarCipher.encrypt("Hello World", 13) # uryyb jbeyq
puts CaesarCipher.encrypt("Uryyb jbeyq", -13) # hello world
puts CaesarCipher.encrypt("Th1s 1s @ compl3x w0rd", 5) # ym1x 1x @ htruq3c b0wi
puts CaesarCipher.encrypt(["Also", "Works", "for", "complex", "structures"], 7) # ["hszv", "dvyrz", "mvy", "jvtwsle", "zaybjabylz"]
puts CaesarCipher.encrypt(nil)
puts CaesarCipher.encrypt("Nothing change", 0) # nothing change

================================================
FILE: Algorithms/Cryptography/Caesar_Cipher/README.md
================================================
## This folder is empty.


================================================
FILE: Algorithms/Cryptography/README.md
================================================
# This folder is empty.


================================================
FILE: Algorithms/Cryptography/RSA_Cipher/README.md
================================================
## This folder is empty.


================================================
FILE: Algorithms/Cryptography/RSA_Cipher/RSA_Cipher.py
================================================
# -*- coding: utf-8 -*-
import random
from math import gcd

plaintext = (input('Enter the value of text = '))

pt = ""
if (plaintext.isnumeric()) :
    pt = plaintext
else :
    for i in range(0,len(plaintext)):
      pt += str(ord(plaintext[i]))
    print(pt)    

def modInverse(e, phin) : 
    e = e % phin; 
    for d in range(1, phin) : 
        if ((e * d) % phin == 1) : 
            return d
    return 1

import sympy
p=sympy.randprime(1000, 2000) 
q=sympy.randprime(1000, 2000) 

n=p*q

phin=(p-1)*(q-1)
list=[]

for i in range(2,phin):
  if gcd(phin,i)==1:
    list.append(i)

e = random.choice(list) 

d = modInverse(e,phin)

ciphertext = pow(int(pt),e)%n
decrypttext = pow(ciphertext,d)%n

print('n = '+str(n)+' e = '+str(e)+' phi(n) = '+str(phin)+' d = '+str(d)+' cipher text = '+str(ciphertext)+' decrypted text = '+str(decrypttext))


================================================
FILE: Algorithms/Cryptography/RSA_Cipher/RSA_cipher.cpp
================================================
#include <iostream>
#include <ctime>
#include <cstdlib>
#include <cstring>
#include <cstdio>
#include <iomanip>
using namespace std;

#define LIMIT 10000

int log_power(int n, int p, int mod)
{
    int result = 1;
    for (; p; p >>= 1)
    {
        if (p & 1)
            result = (1LL * result * n) % mod;
        n = (1LL * n * n) % mod;
    }
    return result;
}

bool new_func(int n)
{
    bool ok = true;

    for (int i = 1; i <= 5 && ok; i++) {
        int a = rand() + 1;
        int result = log_power(a, n - 1, n);
        ok &= (result == 1);
    }

    return ok;
}

int generate_prime()
{
    int generated = rand() % LIMIT;
    while (!new_func(generated))
        generated = rand() % LIMIT;
    return generated;
}

int gcd(int a, int b)
{
    while (b)
    {
        int r = a % b;
        a = b;
        b = r;
    }
    return a;
}

int generate_coprime(int n)
{
    int generated = rand() % LIMIT;
    while (gcd(n, generated) != 1)
        generated = rand() % LIMIT;
    return generated;
}

pair<int, int> euclid_extended(int a, int b) {
    if(!b) {
        return {1, 0};
    }

    auto result = euclid_extended(b, a % b);
    return { result.second, result.first - (a / b) * result.second };
}

int modular_inverse(int n, int mod)
{
    int inverse = euclid_extended(n, mod).first;
    while(inverse < 0)
        inverse += mod;
    return inverse;
}

typedef pair<int, int> PublicKey;
typedef pair<int, int> PrivateKey;

struct Keys
{
    PublicKey public_key;
    PrivateKey private_key;
};

Keys generate_keys()
{
    Keys result;

    int p, q;

    p = generate_prime();
    q = generate_prime();

    int n = p * q;
    int phi = (p -1) * (q - 1);
    int e = generate_coprime(phi);

    result.public_key =  make_pair(n, e);

    int d = modular_inverse(e, phi);

    result.private_key = make_pair(n, d);

    return result;
}

int encrypt(PublicKey key, int value)
{
    return log_power(value, key.second, key.first);
}

int decrypt(PrivateKey key, int value)
{
    return log_power(value, key.second, key.first);
}

int main()
{
    string s;
    srand(time(NULL));

    Keys keys = generate_keys();

    cout << "Public key: " << keys.public_key.first << " " << keys.public_key.second << "\n";
    cout << "Private key: " << keys.private_key.first << " " << keys.private_key.second << "\n";
    cout << "Enter your message\n";
    cin >> s;
    int len = s.size();

    cout << "Initial string: " << s << "\n";
    int enc[100] = {0};
    int dec[100] = {0};

    for (int i = 0; i < len; i++)
        enc[i] = encrypt(keys.public_key, s[i]);

    for (int i = 0; i < len; i++)
        dec[i] = decrypt(keys.private_key, enc[i]);
    cout << "Encrypted string\n";
    for(int i = 0; i < len; i++)
        cout << (int)enc[i];
    cout << "\n";
    cout << "Decrypted string: \n";
    for (int i = 0; i < len; i++)
        cout << (char)dec[i];
    cout << "\n";

    return 0;
}


================================================
FILE: Algorithms/Cryptography/RSA_Cipher/RSA_cipher.java
================================================
/*
 * RSA algorithm is asymmetric cryptography algorithm. 
 * Asymmetric actually means that it works on two different keys i.e. Public Key and Private Key. 
 * As the name describes that the Public Key is given to everyone and Private key is kept private. 
 */

import java.io.DataInputStream;
import java.io.IOException;
import java.math.BigInteger;
import java.util.Random;
 class Algorithm
{
    private BigInteger P;
    private BigInteger Q;
    public BigInteger N;
    private BigInteger PHI;
    public BigInteger e;
    private BigInteger d;
    private int maxLength = 1024;
    private Random R;
 
    public Algorithm()
    {
        R = new Random();
        
        //prime numbers 
        P = BigInteger.probablePrime(maxLength, R);
        Q = BigInteger.probablePrime(maxLength, R);
        
        //N = P*Q
        N = P.multiply(Q);
        
        //(|)(N) = (P-1)*(Q-1)
        PHI = P.subtract(BigInteger.ONE).multiply(  Q.subtract(BigInteger.ONE));
        
        
        e = BigInteger.probablePrime(maxLength / 2, R);
        
        while (PHI.gcd(e).compareTo(BigInteger.ONE) > 0 && e.compareTo(PHI) < 0)
        {
            e.add(BigInteger.ONE);
        } //e relatively prime to PHI
        
        d = e.modInverse(PHI);
        
    }
 
    public Algorithm(BigInteger e, BigInteger d, BigInteger N)
    {
        this.e = e;
        this.d = d;
        this.N = N;
    }
 
   

 
    // Encrypting the data
    public byte[] encryptMessage(byte[] data)
    {	
    	// returns (data^e)%N
        return (new BigInteger(data)).modPow(e, N).toByteArray();
    }
 
    // Decrypting the data
    public byte[] decryptMessage(byte[] data)
    {	
    	//returns (data^d)%N
    	//remember d is our private key, we never share that 
    	//otherwise our security will be compromised.
    	
        return (new BigInteger(data)).modPow(d, N).toByteArray();
    }
}

public class RSA_cipher {
	//return all the bytes concatenated in a string
    private static String byte2String(byte[] cipher)
    {
        String temp = "";
        for (byte b : cipher)
        {
            temp += Byte.toString(b);
        }
        return temp;
    }
	
	 public static void main (String [] arguments) throws IOException
	    {
	        Algorithm algorithm = new Algorithm();
	        DataInputStream input = new DataInputStream(System.in);
	        String inputString;
	        System.out.println("Enter data to send.");
	        inputString = input.readLine();
	        System.out.println("Encrypting the data: " + inputString);
	        System.out.println("The data in bytes is:: "
	                + byte2String(inputString.getBytes()));
	        System.out.printf("Shared public key:\nN: %d \ne: %d \n\n",algorithm.N, algorithm.e);
	        
	        // encryption
	        byte[] cipher = algorithm.encryptMessage(inputString.getBytes());
	        
	        // decryption
	        byte[] plain = algorithm.decryptMessage(cipher);
	        
	        System.out.println("Decrypting Bytes: " + byte2String(plain));
	        System.out.println("Original data is: " + new String(plain));
	    }
	 
}

================================================
FILE: Algorithms/Cryptography/Shamir_Cipher/Shamir_Cipher.c
================================================
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
#include <string.h>
#include <math.h>
#include <unistd.h>

const int N = 4;
const int K = 2;
const int prime = 256;
size_t size = 1024;

int mod_expo(int base, int exp, int mod)
{
	if (exp == 0)
	{
		return 1;
	}
	else if (exp % 2 == 0)
	{
		int mysqrt = mod_expo(base, exp / 2, mod);
		return (mysqrt * mysqrt) % mod;
	}
	else
	{
		return (base * mod_expo(base, exp - 1, mod)) % mod;
	}
}

void free_heap_mem(char **shares, int n)
{
	int i;

	for (i = 0; i < n; ++i)
	{
		free(shares[i]);
	}
	free(shares);
}


int *gcdD(int a, int b)
{
	int *xyz = malloc(sizeof(int) * 3);

	if (b == 0)
	{
		xyz[0] = a;
		xyz[1] = 1;
		xyz[2] = 0;
	}
	else
	{
		int n = floor(a / b);
		int c = a % b;
		int *r = gcdD(b, c);

		xyz[0] = r[0];
		xyz[1] = r[2];
		xyz[2] = r[1] - r[2] * n;

		free(r);
	}

	return xyz;
}

int modInverse(int k)
{
	k = k % prime;

	int r;
	int *xyz;

	if (k < 0)
	{
		xyz = gcdD(prime, -k);
		r = -xyz[2];
	}
	else
	{
		xyz = gcdD(prime, k);
		r = xyz[2];
	}

	free(xyz);

	return (prime + r) % prime;
}

int *split_number(int number, int n, int t)
{
	int *shares = malloc(sizeof(int) * n);
	int *coef = malloc(sizeof(int) * t);
	int x;
	int i;

	coef[0] = number;

	for (i = 1; i < t; ++i)
	{

#ifdef HAVE_ARC4RANDOM
		coef[i] = arc4random_uniform(prime);
#else
		coef[i] = rand() % (prime);
#endif
	}

	for (x = 0; x < n; ++x)
	{
		int y = coef[0];

		for (i = 1; i < t; ++i)
		{
			int temp = mod_expo(x + 1, i, prime);

			y = (y + (coef[i] * temp % prime)) % prime;
		}
		y = (y + prime) % prime;

		shares[x] = y;
	}

	free(coef);

	return shares;
}

char **split_string(char *secret, int n, int t)
{
	int len = strlen(secret);

	char **shares = malloc(sizeof(char *) * n);
	int i;

	for (i = 0; i < n; ++i)
	{

		shares[i] = (char *)malloc(2 * len + 6 + 1);

		sprintf(shares[i], "%02X%02XAA", (i + 1), t);
	}

	for (i = 0; i < len; ++i)
	{
		int letter = secret[i];

		if (letter < 0)
		{
			letter = prime + letter;
		}

		int *chunks = split_number(letter, n, t);
		int j;

		for (j = 0; j < n; ++j)
		{
			if (chunks[j] == prime)
			{
				sprintf(shares[j] + 6 + i * 2, "G0");
			}
			else
			{
				sprintf(shares[j] + 6 + i * 2, "%02X", chunks[j]);
			}
		}

		free(chunks);
	}

	return shares;
}

int join_shares(int *xy_pairs, int n)
{
	int secret = 0;
	long numerator;
	long denominator;
	long startposition;
	long nextposition;
	long value;
	int i;
	int j;

	for (i = 0; i < n; ++i)
	{
		numerator = 1;
		denominator = 1;

		for (j = 0; j < n; ++j)
		{
			if (i != j)
			{
				startposition = xy_pairs[i * 2];
				nextposition = xy_pairs[j * 2];
				numerator = (numerator * -nextposition) % prime;
				denominator = (denominator * (startposition - nextposition)) % prime;
			}
		}

		value = xy_pairs[i * 2 + 1];

		secret = (secret + (value * numerator * modInverse(denominator))) % prime;
	}

	secret = (secret + prime) % prime;

	return secret;
}

char *decode(char **shares, int n)
{

	if ((n == 0) || (shares == NULL) || (shares[0] == NULL))
	{
		return NULL;
	}
	int len = (strlen(shares[0]) - 6) / 2;

	char *result = malloc(len + 1);
	char codon[3];
	codon[2] = '\0';

	int x[n];
	int i;
	int j;

	for (i = 0; i < n; ++i)
	{
		if (shares[i] == NULL)
		{
			free(result);
			return NULL;
		}

		codon[0] = shares[i][0];
		codon[1] = shares[i][1];

		x[i] = strtol(codon, NULL, 16);
	}

	for (i = 0; i < len; ++i)
	{
		int *chunks = malloc(sizeof(int) * n * 2);

		for (j = 0; j < n; ++j)
		{
			chunks[j * 2] = x[j];

			codon[0] = shares[j][6 + i * 2];
			codon[1] = shares[j][6 + i * 2 + 1];

			if (memcmp(codon, "G0", 2) == 0)
			{
				chunks[j * 2 + 1] = prime;
			}
			else
			{
				chunks[j * 2 + 1] = strtol(codon, NULL, 16);
			}
		}

		char letter = join_shares(chunks, n);

		free(chunks);

		sprintf(result + i, "%c", letter);
	}

	return result;
}

char *encode(char *secret, int n, int t)
{
	char **result = split_string(secret, n, t);

	int len = strlen(secret);
	int key_len = 6 + 2 * len + 1;
	int i;

	char *shares = malloc(key_len * n + 1);

	for (i = 0; i < n; ++i)
	{
		sprintf(shares + i * key_len, "%s\n", result[i]);
	}

	free_heap_mem(result, n);

	return shares;
}

// Driver Code
int main(void)
{
	srand(time(NULL));

	int M;
	char **codes = malloc(sizeof(char *) * prime);
	char *code = malloc(sizeof(char) * prime);
	char *str = malloc(sizeof(char) * size);

	getline(&str, &size, stdin);
	char *shares = encode(str, N, K);
	puts(shares);

	printf("Enter the number of shares you want to enter to decode the orginal secret\n");
	scanf("%d", &M);
	for (int i = 0; i < M; i++)
	{
		printf("Enter the %d share\n", i+1);
		scanf("%s", code);
		codes[i] = strdup(code);
	}
	char *secret = decode(codes, M);
	printf("The secret is : ");
	puts(secret);
	free_heap_mem(codes, M);
	free(shares);
	free(secret);
	free(code);
	free(str);
	return 0;
}


================================================
FILE: Algorithms/Cryptography/Shamir_Cipher/Shamir_Cipher.cpp
================================================
#include <bits/stdc++.h>
using namespace std;

int calculate_Y(int x, vector<int> &poly)
{
    int y = 0;
    int temp = 1;
    for (auto coeff : poly)
    {
        y = (y + (coeff * temp));
        temp = (temp * x);
    }
    return y;
}

void secret_sharing(int S, vector<pair<int, int>> &points,
                    int N, int K)
{
    vector<int> poly(K);
    poly[0] = S;

    for (int j = 1; j < K; ++j)
    {
        int p = 0;
        while (p == 0)
            p = (rand() % 997);
        poly[j] = p;
    }
    for (int j = 1; j <= N; ++j)
    {
        int x = j;
        int y = calculate_Y(x, poly);
        points[j - 1] = {x, y};
    }
}

struct fraction
{
    int num, den;
    fraction(int n, int d)
    {
        num = n, den = d;
    }

    void reduce_fraction(fraction &f)
    {
        int gcd = __gcd(f.num, f.den);
        f.num /= gcd, f.den /= gcd;
    }

    fraction operator*(fraction f)
    {
        fraction temp(num * f.num, den * f.den);
        reduce_fraction(temp);
        return temp;
    }

    fraction operator+(fraction f)
    {
        fraction temp(num * f.den + den * f.num, den * f.den);
        reduce_fraction(temp);
        return temp;
    }
};

int Generate_Secret(int x[], int y[], int M)
{

    fraction ans(0, 1);
    for (int i = 0; i < M; ++i)
    {
        fraction l(y[i], 1);
        for (int j = 0; j < M; ++j)
        {
            if (i != j)
            {
                fraction temp(-x[j], x[i] - x[j]);
                l = l * temp;
            }
        }
        ans = ans + l;
    }
    return ans.num;
}

void solve(int S, int N, int K)
{
    vector<pair<int, int>> points(N);
    secret_sharing(S, points, N, K);
    int M = 2;
    if (M < K)
    {
        cout << "Points are less than threshold " << K << " Points Required" << endl;
    }

    int *x = new int[M];
    int *y = new int[M];

    for (int i = 0; i < M; ++i)
    {
        x[i] = points[i].first;
        y[i] = points[i].second;
    }

    cout << "Your Secret Code is " << Generate_Secret(x, y, M) << endl;
}

int main()
{
    int S, N;
    printf("Enter the Secret Code\n");
    scanf("%d", &S);
    printf("Enter the number of Parts\n");
    scanf("%d", &N);
    solve(S, N, 2);
    return 0;
}


================================================
FILE: Algorithms/Cryptography/Vernam_Cipher/README.md
================================================
## This folder is empty.


================================================
FILE: Algorithms/Cryptography/Vernam_Cipher/Vernam_Cipher.cpp
================================================
#include <cstring>
#include <random>

/**
 * Encrypts/decrypts data using vernam cipher
 * @param[in/out] data data to which Vernam cipher is applied
 * @param[in] key key, is expected to have the same size as data
 * @param[in] size memory size (in bytes) of data
 */
void apply_vernam(void *data, void const * key, const size_t size)
{
	static_assert(sizeof(char) == 1);
	const unsigned sizeTypeSize = sizeof(size_t);

	const size_t numberOfIterations = size / sizeTypeSize;
	size_t *currentDataPosition = static_cast<size_t*>(data);
	size_t const * currentKeyPosition = static_cast<size_t const *>(key);

	for (size_t i = 0; i < numberOfIterations; ++i)
	{
		*currentDataPosition = *currentDataPosition ^ *currentKeyPosition; // XOR
		++currentDataPosition;
		++currentKeyPosition;
	}

	const unsigned numberOfRemainingOperations = size % sizeTypeSize;
	char *currentRemainingDataPosition = reinterpret_cast<char*>(currentDataPosition);
	char const * currentRemainingKeyPosition = reinterpret_cast<char const *>(currentKeyPosition);

	for (unsigned i = 0; i < numberOfRemainingOperations; ++i)
	{
		*currentRemainingDataPosition = *currentRemainingDataPosition ^ *currentRemainingKeyPosition; // XOR
		++currentRemainingDataPosition;
		++currentRemainingKeyPosition;
	}

	return;
}

/** Generates a random uniformly distributed key. The key has to be allocated with at least size byte of memory.
 * @param[out] key generated key
 * @param[in] size size of key
 */
void generate_key(void *key, const size_t size)
{
	std::random_device rd;
	std::uniform_real_distribution<double> distribution(0.0, 0.1);

	const unsigned doubleSize = sizeof(double);

	const size_t numberOfIterations = size / doubleSize;

	double *currentKeyPosition = static_cast<double*>(key);

	for (size_t i = 0; i < numberOfIterations; ++i)
	{
		*currentKeyPosition = distribution(rd);
		++currentKeyPosition;
	}

	const unsigned numberOfRemainingOperations = size % doubleSize;
	char * currentRemainingKeyPosition = reinterpret_cast<char*>(currentKeyPosition);

	for (unsigned i = 0; i < numberOfRemainingOperations; ++i)
	{
		const double randomNumber = distribution(rd);
		memcpy(currentRemainingKeyPosition, &randomNumber, sizeof(char));
		++currentRemainingKeyPosition;
	}

	return;
}

// Test section:

#include <iostream>

using namespace std;

int main()
{
	string data;

	cout << "Enter plaintext:" << endl;
	getline(cin, data);

	// Generate random key:
	string key(data);
	generate_key(&key[0], sizeof(char)*key.size());

	cout << "Random key:" << endl
	     << key << endl;

	apply_vernam(&data[0], &key[0], sizeof(char)*data.size());

	cout << endl << "Ciphertext:" << endl
		 << data << endl;

	apply_vernam(&data[0], &key[0], sizeof(char)*data.size());

	cout << endl << "Decrypted text:" << endl
		 << data << endl;

	return 0;
}


================================================
FILE: Algorithms/Cryptography/Vernam_Cipher/Vernam_Cipher.js
================================================
xin = "Shubham";

treshold = 150;

c = {
	0: [], // input encoded
	1: [], // key encoded
	2: [], // cipher encoded
	3: []  // decoded encoded
};

for (i=0;i<=xin.length;++i) c[0].push((xin[i]+"").charCodeAt(0));
console.log("Encoded input: " + c[0].join(", "));

// c[0] is input

// generate challenge key

for (i=0;i<=c[0].length;++i) c[1].push(Math.round(Math.random()*treshold));
console.log("Generated Challenge Pad: " + c[1].join(", "));

// generate cipher

for (i=0;i<=c[0].length;++i) c[2].push(c[0][i] ^ c[1][i]);
console.log("Resulting Cipher: " + c[2].join(", "));

for (i=0;i<=c[0].length - 1;++i) c[3].push(c[2][i] ^ c[1][i]);
console.log("Recalculated Pad: " + c[3].join(", "));

console.log("Has decoding been successful? " + ( c[0].join() == c[3].join() ? "Yes" : "No" ));


================================================
FILE: Algorithms/Cryptography/Vernam_Cipher/Vernam_Cipher.py
================================================
#!/usr/bin/env python
import random
import string
from operator import xor
def vernam_enc(msg):
    #Generate Random Key
    randomKey = ''.join([random.choice(string.ascii_letters) for i in range(len(msg))])
    print("Random Key: "+randomKey)
    
    #Convert string to decimal
    convdecimal = []
    for i in range(len(msg)):
        convdecimal.append(str(ord(msg[i])))
    decimal = ' '.join(convdecimal)
	
	#Convert decimal to biner
    convbiner = []
    for i in range(len(convdecimal)):
        convbiner.append(str(bin(int(convdecimal[i]))[2:].zfill(8)))
    biner = ''.join(convbiner)


    #Convert key to decimal
    convkeydecimal = []
    for i in range(len(randomKey)):
        convkeydecimal.append(str(ord(randomKey[i])))
    keydecimal = ' '.join(convkeydecimal)
    
    #Convert key decimal to biner
    convkeybiner = []
    for i in range(len(convkeydecimal)):
        convkeybiner.append(str(bin(int(convkeydecimal[i]))))
    binerkey = ''.join(convkeybiner)


    binermsg =biner.replace("b","")

    binerkey =binerkey.replace("b","")

    #XOR Function
    ciphertext = []
    for i in range(len(binermsg)):
        ciphertext.append(xor(int(binermsg[i]),int(binerkey[i])))
    cipherfix =''.join(map(str,ciphertext))
    splits=[cipherfix[x:x+8] for x in range(0,len(cipherfix),8)]

    #convert biner to decimal
    hexa = []
    for i in range(len(splits)):
        hexa.append(hex(int(splits[i],2)))
        
    #convert hex to desimal
    dec = []
    for i in range(len(hexa)):
        dec.append(int(hexa[i], 16))
    print("Ciphertext-Num : \n"+str(dec))

	#final convert to text
    teks = []
    for i in range(len(dec)):
        teks.append(chr(dec[i]))
    print("Ciphertext : \n"+''.join(teks))
    

def main():
    print("Vernam Cipher")
    msg = input("Enter Text : ")
    vernam_enc(msg)
if __name__ == '__main__':
    	main()


================================================
FILE: Algorithms/Cryptography/Vigenere_Cipher/README.md
================================================
## This folder is empty.


================================================
FILE: Algorithms/Cryptography/Vigenere_Cipher/Vigenere_Cipher.cpp
================================================
#include <algorithm>
#include <cctype>
#include <string>

/**
 * Returns the mathematical (unsigned) modulus
 * @param x number
 * @param div divisor
 * @return the unsigned modulus x % div
 */
unsigned positive_modulo(const int x, const int div)
{
	return (x % div + div) % div;
}

/**
 * Returns, wheter character is a letter of the alphabet
 * @param ch character
 * @return true if ch is a letter. false otherwise
 */
bool is_letter(const unsigned char ch)
{
	bool result = false;
	if (('A' <= ch && ch <= 'Z') || ('a' <= ch && ch <= 'z'))
		result = true;

	return result;
}

/**
 * Encrypts a string using Vigenere cipher
 * @input plaintext plaintext
 * @input keyword keyword
 * @return the encrypted plaintext
 */
std::string encrypt_vigenere(const std::string &plaintext, const std::string &keyword)
{
	std::string ciphertext(plaintext);
	std::string cleanKeyword(keyword);

	ciphertext.erase(std::remove_if(ciphertext.begin(), ciphertext.end(), [](const unsigned char ch){ return !is_letter(ch); }), ciphertext.end());
	cleanKeyword.erase(std::remove_if(cleanKeyword.begin(), cleanKeyword.end(), [](const unsigned char ch){ return !is_letter(ch); }), cleanKeyword.end());

	for (size_t i = 0; i < ciphertext.size(); ++i)
	{
		ciphertext[i] = toupper(ciphertext[i]);
		cleanKeyword[i] = toupper(cleanKeyword[i]);

		// shift by corresponding character of keyword
		ciphertext[i] = positive_modulo((ciphertext[i] - 'A' + (cleanKeyword[i%keyword.size()] - 'A')), ('Z' - 'A' + 1)) + 'A';
	}

	return ciphertext;
}

/**
 * Decrypts a string using Vigenere cipher
 * @input ciphertext ciphertext
 * @input keyword keyword
 * @return the decrypted ciphertext
 */
std::string decrypt_vigenere(const std::string &ciphertext, const std::string &keyword)
{
	std::string plaintext(ciphertext);
	std::string cleanKeyword(keyword);

	plaintext.erase(std::remove_if(plaintext.begin(), plaintext.end(), [](const unsigned char ch){ return !is_letter(ch); }), plaintext.end());
	cleanKeyword.erase(std::remove_if(cleanKeyword.begin(), cleanKeyword.end(), [](const unsigned char ch){ return !is_letter(ch); }), cleanKeyword.end());

	for (size_t i = 0; i < plaintext.size(); ++i)
	{
		plaintext[i] = toupper(plaintext[i]);
		cleanKeyword[i] = toupper(cleanKeyword[i]);

		// shift by corresponding character of keyword
		plaintext[i] = positive_modulo((plaintext[i] - 'A' - (cleanKeyword[i%keyword.size()] - 'A')), ('Z' - 'A' + 1)) + 'A';
	}

	return plaintext;
}


// Test section:

#include <iostream>

using namespace std;

int main()
{
	string plaintext;
	string keyword;

	cout << "Enter plaintext:" << endl;
	getline(cin, plaintext);

	cout << endl << "Enter keyword:" << endl;
	getline(cin, keyword);

	string ciphertext = encrypt_vigenere(plaintext, keyword);

	cout << endl << "Ciphertext:" << endl
		 << ciphertext << endl;

	string decryptedtext = decrypt_vigenere(ciphertext, keyword);

	cout << endl << "Decrypted text:" << endl
		 << decryptedtext << endl;

	return 0;
}


================================================
FILE: Algorithms/Cryptography/Vigenere_Cipher/Vigenere_Cipher.py
================================================
import sys

def create_key(msg, key):
    key = list(key)
    if len(msg) == len(key):
        return key
    elif len(key) < len(msg):
        n = (len(msg) // len(key)) + 1
        key = key * n
        return ''.join(key[:len(msg)])

def encrypt(msg, key):
    cipher_text = []
    x = 0
    key = create_key(msg, key)

    for i in range(0, len(msg)):
        x = (ord(msg[i]) + ord(key[i])) % 26
        x += ord('A')
        cipher_text.append(chr(x))
    return cipher_text

def decrypt(msg, key):
    key = create_key(msg, key)
    plain_text = []

    for i in range(0, len(msg)):
        x = (ord(msg[i]) - ord(key[i]) + 26) % 26
        x += ord('A')
        plain_text.append(chr(x))
    return plain_text

if __name__ == '__main__':
    print("\t\tVigenere Cipher Application")
    print("\t"+"=" * 41)
    print("Please choose an option below:\n")
    print("1. Encrypt")
    print("2. Decrypt")
    print("3. Exit")
    while True:
        opt = input("Selection: ")
        try:
            opt = int(opt)
            if opt == 1:
                msg = input("Please provide your message to encrypt: ")
                msg = msg.upper().replace(" ", "")
                key = input("Please provide your key: ")
                key = key.upper().replace(" ", "")
                cipher_text = encrypt(msg, key)
                print("Encrypted message:", "".join(cipher_text))
            elif opt == 2:
                msg = input("Please provide your message to decrypt: ")
                msg = msg.upper().replace(" ", "")
                key = input("Please provide your key: ")
                key = key.upper().replace(" ", "")
                plain_text = decrypt(msg, key)
                print("Encrypted message:", "".join(plain_text))
            elif opt == 3:
                sys.exit()
            else:
                print("Incorrect option, try again")
                continue
        except ValueError:
            print("Incorrect option, try again")
            continue


================================================
FILE: Algorithms/Cryptography/Vigenere_Cipher/Vignere_Cipher.cs
================================================
using System;
using System.Linq;
using System.Collections.Generic;

public class Program
{
    static List<char> characters = "abcdefghijklmnopqrstuvwxyz".ToList();

    // wrap value if it is above n or below zero
    static int wrap(int k, int n)
    {
        int r = k % n;
        return (r < 0) ? r + n : r;
    }

    static string VignereCipher(string plaintext, string key)
    {
        string ciphertext = "";
        for (int i = 0; i < plaintext.Length; i++)
        {
            // get the current key character.
            char keyCharacter = key[i % key.Length];
            // shift value is the index of this character in 'characters'.
            int shift = characters.IndexOf(keyCharacter);

            // index of the plaintext character in the 'characters' array.
            int plaincharNumber = characters.IndexOf(plaintext[i]);
            // shift this index by the shift value, wrapping if it goes over 26.
            int ciphercharNumber = wrap((plaincharNumber + shift), 26);
            // and get the character from this index.
            char cipherchar = characters[ciphercharNumber];

            ciphertext += cipherchar;
        }

        return ciphertext;
    }

    static string VignereDecipher(string ciphertext, string key)
    {
        string plaintext = "";
        for (int i = 0; i < ciphertext.Length; i++)
        {
            // get the current key character.
            char keyCharacter = key[i % key.Length];
            // shift value is the index of this character in 'characters'.
            int shift = characters.IndexOf(keyCharacter);

            // index of the ciphertext character in the 'characters' array.
            int ciphercharNumber = characters.IndexOf(ciphertext[i]);
            // shift this index by the shift value, but in the other direction,
            // wrapping through 26 if it goes under 0.
            int plaincharNumber = wrap((ciphercharNumber - shift), 26);
            // and get the character from this index.
            char plainchar = characters[plaincharNumber];

            plaintext += plainchar;
        }

        return plaintext;
    }

    public static void Main(string[] args)
    {
        string ciphertext = VignereCipher("helloworld", "key");
        Console.WriteLine($"Plaintext: helloworld -> Key: key ->  Ciphertext: {ciphertext}.");

        string plaintext = VignereDecipher("uogtprtso", "pass");
        Console.WriteLine($"Ciphertext: uogtprtso <- Key: pass <- Plaintext: {plaintext}.");
    }
}

================================================
FILE: Algorithms/Cryptography/Vigenere_Cipher/vigenereCipher.py
================================================
def vignereCipher(plain_text, key):
    plain_text_length = len(plain_text)
    key_length = len(key)
    j = 0
    cipher = ''
    for i in range(plain_text_length):
        if(j == key_length):
            j = 0
        cipher_text = (ord(plain_text[i])+ ord(key[j])) % 26
        j+=1
        cipher += chr(cipher_text+65)
    return cipher

def decryptVignereCipher(cipher_text, key):
    key_length = len(key)
    decrpted_text = ''
    j = 0
    for i in range(len(cipher_text)): 
        if(j == key_length):
            j = 0
        decrpt = (ord(cipher_text[i]) - ord(key[j]) + 26) % 26
        j+=1
        decrpted_text += chr(decrpt+65)
    return decrpted_text
        
    
if __name__ == "__main__":
    plain_text = "PLAINTEXT"
    key = "KEY"
    encrypted_text = vignereCipher(plain_text, key)
    print("Cipher text " + encrypted_text)
    decrpted_text = decryptVignereCipher(encrypted_text, key)
    print("Decrypt text " + decrpted_text)

================================================
FILE: Algorithms/DP/0-1_Knapsack_Problem/0-1 Knapsack Problem.java
================================================
/*0-1 Knapsack problem */
import java.util.*;
public class Knapsack {

    //function to return max. of two integers
    static int max(int a, int b)
    {
        return (a > b) ? a : b;
    }

   //function to return proper max. value to fill knapsack of weight W
    static int knapSack(int W, int wt[], int val[], int n)
    {
        int i, w;
        int K[][] = new int[n + 1][W + 1];

        // Build table K[][] in bottom up manner
        for (i = 0; i <= n; i++) {
            for (w = 0; w <= W; w++) {

                if (i == 0 || w == 0)
                    K[i][w] = 0;
                else if (wt[i - 1] <= w)
                    K[i][w] = max(
                        val[i - 1] + K[i - 1][w - wt[i - 1]],
                        K[i - 1][w]);
                else
                    K[i][w] = K[i - 1][w];
            }
        }

        return K[n][W];
    }
    //Main function
    public static void main(String args[])
    {
        Scanner input=new Scanner(System.in);
        System.out.println("Enter the number of items in a Knapsack:");
        int n = input.nextInt();
        int v[]=new int[n];
        int w[]=new int[n];
        for (int i=0; i<n; i++)
        {
            System.out.println("Enter value and weight for item "+i+ ":");
            v[i] = input.nextInt();
            w[i] = input.nextInt();
        }
        System.out.println("Enter the capacity of knapsack");
        int W = input.nextInt();
        System.out.println(knapSack(W, w, v, n));
    }
}


================================================
FILE: Algorithms/DP/0-1_Knapsack_Problem/Branch_And_Bound/0-1_knapsack.cpp
================================================
// C++ program to solve knapsack problem using 
// branch and bound 
#include <bits/stdc++.h> 
using namespace std; 
  
// Structure for Item which store weight and corresponding 
// value of Item 
struct Item 
{ 
    float weight; 
    int value; 
}; 
  
// Node structure to store information of decision 
// tree 
struct Node 
{ 
    // level  --> Level of node in decision tree (or index 
    //             in arr[] 
    // profit --> Profit of nodes on path from root to this 
    //            node (including this node) 
    // bound ---> Upper bound of maximum profit in subtree 
    //            of this node/ 
    int level, profit, bound; 
    float weight; 
}; 
  
// Comparison function to sort Item according to 
// val/weight ratio 
bool cmp(Item a, Item b) 
{ 
    double r1 = (double)a.value / a.weight; 
    double r2 = (double)b.value / b.weight; 
    return r1 > r2; 
} 
  
// Returns bound of profit in subtree rooted with u. 
// This function mainly uses Greedy solution to find 
// an upper bound on maximum profit. 
int bound(Node u, int n, int W, Item arr[]) 
{ 
    // if weight overcomes the knapsack capacity, return 
    // 0 as expected bound 
    if (u.weight >= W) 
        return 0; 
  
    // initialize bound on profit by current profit 
    int profit_bound = u.profit; 
  
    // start including items from index 1 more to current 
    // item index 
    int j = u.level + 1; 
    int totweight = u.weight; 
  
    // checking index condition and knapsack capacity 
    // condition 
    while ((j < n) && (totweight + arr[j].weight <= W)) 
    { 
        totweight    += arr[j].weight; 
        profit_bound += arr[j].value; 
        j++; 
    } 
  
    // If k is not n, include last item partially for 
    // upper bound on profit 
    if (j < n) 
        profit_bound += (W - totweight) * arr[j].value / 
                                         arr[j].weight; 
  
    return profit_bound; 
} 
  
// Returns maximum profit we can get with capacity W 
int knapsack(int W, Item arr[], int n) 
{ 
    // sorting Item on basis of value per unit 
    // weight. 
    sort(arr, arr + n, cmp); 
  
    // make a queue for traversing the node 
    queue<Node> Q; 
    Node u, v; 
  
    // dummy node at starting 
    u.level = -1; 
    u.profit = u.weight = 0; 
    Q.push(u); 
  
    // One by one extract an item from decision tree 
    // compute profit of all children of extracted item 
    // and keep saving maxProfit 
    int maxProfit = 0; 
    while (!Q.empty()) 
    { 
        // Dequeue a node 
        u = Q.front(); 
        Q.pop(); 
  
        // If it is starting node, assign level 0 
        if (u.level == -1) 
            v.level = 0; 
  
        // If there is nothing on next level 
        if (u.level == n-1) 
            continue; 
  
        // Else if not last node, then increment level, 
        // and compute profit of children nodes. 
        v.level = u.level + 1; 
  
        // Taking current level's item add current 
        // level's weight and value to node u's 
        // weight and value 
        v.weight = u.weight + arr[v.level].weight; 
        v.profit = u.profit + arr[v.level].value; 
  
        // If cumulated weight is less than W and 
        // profit is greater than previous profit, 
        // update maxprofit 
        if (v.weight <= W && v.profit > maxProfit) 
            maxProfit = v.profit; 
  
        // Get the upper bound on profit to decide 
        // whether to add v to Q or not. 
        v.bound = bound(v, n, W, arr); 
  
        // If bound value is greater than profit, 
        // then only push into queue for further 
        // consideration 
        if (v.bound > maxProfit) 
            Q.push(v); 
  
        // Do the same thing,  but Without taking 
        // the item in knapsack 
        v.weight = u.weight; 
        v.profit = u.profit; 
        v.bound = bound(v, n, W, arr); 
        if (v.bound > maxProfit) 
            Q.push(v); 
    } 
  
    return maxProfit; 
} 
  
// driver program to test above function 
int main() 
{ 
    int W = 10;   // Weight of knapsack 
    Item arr[] = {{2, 40}, {3.14, 50}, {1.98, 100}, 
                  {5, 95}, {3, 30}}; 
    int n = sizeof(arr) / sizeof(arr[0]); 
  
    cout << "Maximum possible profit = "
         << knapsack(W, arr, n); 
  
    return 0; 
} 


================================================
FILE: Algorithms/DP/0-1_Knapsack_Problem/knapsackProblem.java
================================================
/*0-1 Knapsack problem */
import java.util.*;
public class knapsackProblem {

    //function to return max. of two integers
    static int max(int a, int b)
    {
        return (a > b) ? a : b;
    }

   //function to return proper max. value to fill knapsack of weight W
    static int knapSack(int W, int wt[], int val[], int n)
    {
        int i, w;
        int K[][] = new int[n + 1][W + 1];

        // Build table K[][] in bottom up manner
        for (i = 0; i <= n; i++) {
            for (w = 0; w <= W; w++) {

                if (i == 0 || w == 0)
                    K[i][w] = 0;
                else if (wt[i - 1] <= w)
                    K[i][w] = max(
                        val[i - 1] + K[i - 1][w - wt[i - 1]],
                        K[i - 1][w]);
                else
                    K[i][w] = K[i - 1][w];
            }
        }

        return K[n][W];
    }
    //Main function
    public static void main(String args[])
    {
        Scanner input=new Scanner(System.in);
        System.out.println("Enter the number of items in a Knapsack:");
        int n = input.nextInt();
        int v[]=new int[n];
        int w[]=new int[n];
        for (int i=0; i<n; i++)
        {
            System.out.println("Enter value and weight for item "+i+ ":");
            v[i] = input.nextInt();
            w[i] = input.nextInt();
        }
        System.out.println("Enter the capacity of knapsack");
        int W = input.nextInt();
        System.out.println(knapSack(W, w, v, n));
    }
}


================================================
FILE: Algorithms/DP/0-1_Knapsack_Problem/knapsack_problem_0_1.cpp
================================================
#include <iostream>
using namespace std;
int max(int x, int y)
{
    return (x > y) ? x : y;
}
int knapSack(int W, int w[], int v[], int n)
{
    int i, wt;
    int K[n + 1][W + 1];
    for (i = 0; i <= n; i++)
    {
        for (wt = 0; wt <= W; wt++)
        {
            if (i == 0 || wt == 0)
                K[i][wt] = 0;
            else if (w[i - 1] <= wt)
                K[i][wt] = max(v[i - 1] + K[i - 1][wt - w[i - 1]], K[i - 1][wt]);
            else
                K[i][wt] = K[i - 1][wt];
        }
    }
    return K[n][W];
}
int main()
{
    cout << "Enter the number of items in a Knapsack:";
    int n, W;
    cin >> n;
    int v[n], w[n];
    for (int i = 0; i < n; i++)
    {
        cout << "Enter value and weight for item " << i << ":";
        cin >> v[i];
        cin >> w[i];
    }
    cout << "Enter the capacity of knapsack";
    cin >> W;
    cout << knapSack(W, w, v, n);
    return 0;
}

================================================
FILE: Algorithms/DP/0-1_Knapsack_Problem/knapsack_problem_0_1.py
================================================
#0/1 Knapsack problem


def knapsack(val, wt, N, C):
    
    table = [[ 0 for _ in range(0, C+1)] for _ in range(0, N+1)]
    table[0][0] = 0
    
    for i in range(1, N+1):
        for c in range(1, C+1):
            
            if c - wt[i-1] < 0:
                table[i][c] = table[i-1][c]
            else:
                table[i][c] = max(table[i-1][c], table[i-1][c-wt[i-1]]+val[i-1])
    return table[N][C]
    

N = int(input().strip())
W = int(input().strip())  # capacity
val = [ int(v) for v in input().strip().split(" ")]
wt =  [ int(w) for w in input().strip().split(" ")]
print(knapsack(val, wt, N, W))

================================================
FILE: Algorithms/DP/AdjacentBitCounts.cpp
================================================
/*
Problem description:
For a string of n bits x1,x2,x3,...,Xn the adjacent bit count of the string (AdjBC(x)) is given by
X1*X2 + X2*X3 + X3*X4 + ... + Xn-1 * Xn

which counts the number of times a 1 bit is adjacent to another 1 bit. For example:
AdjBC(011101101) = 3
AdjBC(111101101) = 4
AdjBC(010101010) = 0

Write a program which takes as input integers n and k and returns the number of bit strings x of n bits 
(out of 2ⁿ) that satisfy AdjBC(x) = k.

Link To Problem: https://www.spoj.com/problems/GNYR09F/
*/

#include <bits/stdc++.h>
using namespace std;
//find Number of bit string with Adjacent Bit count k.
int findAns(int n, int k, int firstBit, int ***dp)
{
    //Base cases
    if (k < 0)
        return 0;
    if (dp[n][k][firstBit] != -1)
        return dp[n][k][firstBit];

    /*There are 2 cases
      1. If First bit of binary string is assigned '1'
      2. If first bit of binary string is assigned '0' 
    */
    int option1, option2;
    if (firstBit == 1)
    {
        option1 = findAns(n - 1, k - 1, 1, dp);
        option2 = findAns(n - 1, k, 0, dp);
    }
    else
    {
        option1 = findAns(n - 1, k, 1, dp);
        option2 = findAns(n - 1, k, 0, dp);
    }
    long long ans = (option1 + option2) % 1000000007;
    dp[n][k][firstBit] = (int)ans;
    return dp[n][k][firstBit];
}
int main()
{           /*
      [Problem Link : https://www.spoj.com/problems/GNYR09F/]
      Input Format is taken from Problem Link
    */
    int ts; //testcases
    cin >> ts;
    while (ts--)
    {
        int index, num, k;
        cin >> index >> num >> k;

        /*creating a dp array for storing previous state answers.
          Since dp array will depend on number of bits,k(Adjacent bit count) & firstbit(0 or 1)
          therefore dp will be 3d array.*/
        int ***dp = new int **[num + 1];
        for (int i = 0; i <= num; i++)
            dp[i] = new int *[k + 1];

        for (int i = 0; i <= num; i++)
        {
            for (int j = 0; j <= k; j++)
                dp[i][j] = new int[2];
        }
        //initialising dp
        for (int i = 0; i <= num; i++)
        {
            for (int j = 0; j <= k; j++)
                dp[i][j][0] = -1, dp[i][j][1] = -1;
        }
        dp[1][0][0] = dp[1][0][1] = 1;
        for (int i = 1; i <= k; i++)
            dp[1][i][0] = 0, dp[1][i][1] = 0;

        //calling function to find ans.
        int ans1 = findAns(num, k, 1, dp);
        int ans2 = findAns(num, k, 0, dp);
        long long int ans = (ans1 + ans2) % 1000000007;
        cout << index << " " << ans << endl;

        //deleting dp array
        delete dp;
    }
    return 0;
}


================================================
FILE: Algorithms/DP/AdjacentBitCounts.js
================================================
const readline = require('readline')
const reader = readline.createInterface(process.stdin, process.stdout)

function countStrings(n, k) {
    let dp = Array(n+1)
    for(let i=0;i<n+1;++i) {
        dp[i] = Array(k+1)
        for(let j=0;j<k+1;++j)
            dp[i][j] = Array(2).fill(0)
    }
    dp[1][0][0] = 1
    dp[1][0][1] = 1
    for (let i=2;i<=n;i++) {
        for (let j=0;j<i&&j<k+1;j++) {
            dp[i][j][0] = dp[i-1][j][0] + dp[i-1][j][1]
            dp[i][j][1] = dp[i-1][j][0]
            if (j-1>= 0) {
                dp[i][j][1] += dp[i-1][j-1][1]
            }
        }
    }
    return dp[n][k][0] + dp[n][k][1]
}

reader.question("Enter 'N' and 'K' seperated by space: ", data => {
    const arr = data.split(" ")
    console.log("Answer: " + countStrings(parseInt(arr[0]), parseInt(arr[1])))
    reader.close()
})


================================================
FILE: Algorithms/DP/Bitmask DP/TravellingSalesman.cpp
================================================
#include <bits/stdc++.h>
#define int long long int
using namespace std;

int dis[21][21];
int dp[21][(1 << 21)];

int solve(int i, int mask, int n)
{
    if (mask == 0)
    {
        return dp[i][mask] = dis[i][0];
    }
    if (dp[i][mask] != -1)
    {
        return dp[i][mask];
    }
    int ans = INT_MAX;
    for (int j = 0; j < n; j++)
    {
        if (mask & (1 << j))
        {
            ans = min(ans, dis[i][j] + solve(j, (mask ^ (1 << j)), n));
        }
    }
    return ans;
}

signed main()
{
    int n;
    cin >> n;
    memset(dp, -1, sizeof(dp));
    for (int i = 0; i < n; i++)
    {
        for (int j = 0; j < n; j++)
        {
            cin >> dis[i][j];
        }
    }
    cout << solve(0, (1 << n) - 1, n);
}


================================================
FILE: Algorithms/DP/Branch_And_Bound/0_1_KnapSack.py
================================================
# a dynamic approach
# Returns the maximum value that can be stored by the bag
def knapSack(W, wt, val, n):
   K = [[0 for x in range(W + 1)] for x in range(n + 1)]
   #Table in bottom up manner
   for i in range(n + 1):
      for w in range(W + 1):
         if i == 0 or w == 0:
            K[i][w] = 0
         elif wt[i-1] <= w:
            K[i][w] = max(val[i-1] + K[i-1][w-wt[i-1]], K[i-1][w])
         else:
            K[i][w] = K[i-1][w]
   return K[n][W]
#Main
val = [50,100,150,200]
wt = [8,16,32,40]
W = 64
n = len(val)
print(knapSack(W, wt, val, n))

================================================
FILE: Algorithms/DP/Branch_And_Bound/Knapsack_Branch_and_Bound.java
================================================
import java.io.*;
import java.util.*;

public class Knapsack_Branch_and_Bound {
	
	static boolean sol_found = false;
	static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	static StringTokenizer st;
	
	//Node of Branch and Bound tree
	static class Node {
		int lvl, val;       //lvl indicates depth of current node
		double cap, bound;
		Node next;

		Node(int lvl, int val, double cap, double bound) {
			this.lvl = lvl;
			this.val = val;
			this.cap = cap;
			this.bound = bound;
			this.next = null;
		}
	}
	
	//List to store node of Branch and Bound tree
	static class List {
		Node head;
	
		//add node in list in such a way that list always stay sorted in descending order by bound value of nodes
		void add(Node n)
		{
			if(this.head == null)
				head = n;
			else
			{
				Node temp = this.head;
				if(n.bound >= temp.bound) {
					n.next = temp;
					this.head = n;
				}
				else {
					while(temp.next != null && n.bound < temp.next.bound)
						temp = temp.next;

					if(temp.next != null)
						n.next = temp.next;
					temp.next = n;
				}
			}
		}
		
		//returns the node with maximum upper bound i.e. the first node
		//in the list since list is always sorted in descending order
		Node get() {
			Node n = head;
			head = n.next;
			n.next = null;
			return n;
		}
	}
	
	
	static class Item {
		double weight;
		int value;
		
		Item(double weight, int value) {
			this.weight = weight;
			this.value = value;
		}
	}
	
	//to sort the item array by value/weight in descending order
	static class Sort_Value_By_Weight implements Comparator<Item> {
		public int compare(Item a, Item b) {
			double x, y;
			x = a.value / a.weight;
			y = b.value / b.weight;
			if(x > y)
				return -1;
			else if(x == y)
				return 0;
			return 1;
		}
	}
	
	//get upperbound for a node of depth k
	static double upperBound(Item item[], double cap, int k, int n) {
		int i;
		double tot_val = 0;
		i = k;
		while(cap > 0 && i < n)
		{
			if(item[i].weight <= cap)
				tot_val += item[i].value;
			else
				tot_val += (1.0 * item[i].value / item[i].weight) * cap;
			cap -= item[i].weight;
			i++;
		}
		return tot_val;
	}
	
	//Solves 0-1 knapsack by branch and bound technique
	static void knapsackBnB(Item[] item, int n, Node curr, List list)
	{
		if(curr.lvl == n && curr.cap >= 0) {
			System.out.println("Max Value: " + curr.val);
			sol_found = true;
		}

		else if(curr.cap >= 0) {
			int k = curr.lvl;
			Node temp;
			
			//right child of current node
			temp = new Node(k+1, curr.val, curr.cap, curr.val + upperBound(item, curr.cap, k+1, n));
			list.add(temp);
			
			//left child of current node
			curr = new Node(k+1, curr.val + item[k].value, curr.cap - item[k].weight, curr.bound);

			//function call itself for left child of current node
			//since it is the node with current max upperbound
			knapsackBnB(item, n, curr, list); 
			if(!sol_found)
				knapsackBnB(item, n, list.get(), list);//call the function for max value of node in list
		}
	}

	public static void main(String[] args) throws IOException{
		int i, n;
		double cap;
		
		System.out.print("Enter no. of Items: ");
		n = Integer.parseInt(br.readLine());

		Item[] item = new Item[n];

		System.out.println("Enter weight-value pair :-");
		for(i=0; i<n; i++) {
			st = new StringTokenizer(br.readLine());
			item[i] = new Item(Double.parseDouble(st.nextToken()), Integer.parseInt(st.nextToken()));
		}

		System.out.print("Enter capacity of knapsack: ");
		cap = Double.parseDouble(br.readLine());

		//Sort the Item array by value/weight in descending order
		Arrays.sort(item, new Sort_Value_By_Weight());

		List list = new List();
		list.head = null;
		//root of the branch and bound tree
		Node curr = new Node(0, 0, cap, upperBound(item, cap, 0, n));

		knapsackBnB(item, n, curr, list);
	}
}



================================================
FILE: Algorithms/DP/Count_Square_Matrices.cpp
================================================
#include <bits/stdc++.h>
using namespace std;

int main()
{
	//input n: rows and m: columns
	int n, m;
	cin >> n >> m;

	//create array of size n*m and take input from the user
	int ar[n][m];
	for (int i = 0; i < n; i++)
		for (int j = 0; j < m; j++)
			cin >> ar[i][j];

	//initialize count with 0 which keeps count of all submatrices having 1.
	int count = 0;


	for (int i = 1; i < n; i++)
	{
		for (int j = 1; j < m; j++)
		{
			//if ar[i][j] = 0, continue;
			if (ar[i][j] == 0)
				continue;
			//calculate submtrices that end with index (i , j);
			//basically we look at the previous row, column and diagonal and then add 1 to it's minimum.
			else
				ar[i][j] = min({ar[i - 1][j], ar[i][j - 1], ar[i - 1][j - 1]}) + 1;
		}
	}

	//sum of the whole array to get final answer
	for (int i = 0; i < n; i++)
		for (int j = 0; j < m; j++)
			count += ar[i][j];


	//print number of square submatrices containing all zeroes.
	cout << count << "\n";

	return 0;
}


================================================
FILE: Algorithms/DP/Count_Square_Matrices.py
================================================
def countSquareMatrices(a, N, M):

    count = 0

    for i in range(1, N):
        for j in range(1, M):
            if (a[i][j] == 0):
                continue

            # Calculating  number of square submatrices ending at (i, j)
            a[i][j] = min([a[i - 1][j], a[i][j - 1], a[i - 1][j - 1]])+1

    # Calculate the sum of the array
    for i in range(N):
        for j in range(M):
            count += a[i][j]

    return count

n = int(input())
m = int(input())

matrix = []
print("Enter elements row-wise")
for i in range(n):          # a for loop for row entries
    a =[]
    for j in range(m):      # a for loop for column entries
         a.append(int(input()))
    matrix.append(a)
    
print("\nNumber of square submatrices with all ones is",countSquareMatrices(matrix, n, m))


================================================
FILE: Algorithms/DP/Edit_Distance/Edit_Distance.js
================================================
var string1 = prompt("Enter String 1 -> ");
var string2 = prompt("Enter String 2 -> ");
var length1 = string1.length,length2=string2.length;
var array1 = [];
for(var i=0;i<=length1;i++){
    array1[i] = [];
}
for(var i=0;i<=length1;i++){
    array1[i][0] = i;
}
for(var i=0;i<=length2;i++){
    array1[0][i]=i;
}
for(var i=1;i<=length1;i++){
    for(var j=1;j<=length2;j++){
        if(string1[i-1]==string2[j-1]){
            array1[i][j]=array1[i-1][j-1];
            [i][j]=array1[i-1][j-1];
        }
        else{
            array1[i][j]=Math.min(Math.min(array1[i-1][j],array1[i][j-1]),array1[i-1][j-1])+1;
        }
    }
}
alert("Edit Distance is -> " + array1[length1][length2]);

================================================
FILE: Algorithms/DP/Edit_Distance/Edit_distance.cpp
================================================
/*
author-yogesh kansal
problem :- The edit distance between two strings is the minimum number of operations (insertions, deletions, and
substitutions of symbols) to transform one string into another. It is a measure of similarity of two strings.
Edit distance has applications, for example, in computational biology, natural language processing, and spell
checking. Your goal in this problem is to compute the edit distance between two strings

Overall time complexity:- O(m*n)
*/

#include <bits/stdc++.h>
using namespace std;

int main() {
	
	
	string s1,s2;
	cout<<"enter string1:- ";
	cin>>s1;
	cout<<"\nenter string2:- ";
	cin>>s2;
	
	int n=s1.length()+1,m=s2.length()+1,i,j;
	int dp[n][m];
	for(i=0;i<n;i++)
	dp[i][0]=i;
	for(i=0;i<m;i++)
	dp[0][i]=i;
	for(i=1;i<n;i++)
	{
		for(j=1;j<m;j++)
		{
			if(s1[i-1]==s2[j-1])
				dp[i][j]=dp[i-1][j-1];
			else
			dp[i][j]=min(min(dp[i-1][j],dp[i][j-1]),dp[i-1][j-1])+1;
		}
	}
	cout<<"\nEditable distance is:- ";
	cout<<dp[n-1][m-1];


	return 0;
}


================================================
FILE: Algorithms/DP/Edit_Distance/README.md
================================================
## This folder is empty.


================================================
FILE: Algorithms/DP/Edit_Distance/edit_distance.py
================================================
"""
author- Ose Oaiya (esoiya)
problem :- The edit distance between two strings is the minimum number of operations (insertions, deletions, and
substitutions of symbols) to transform one string into another. It is a measure of similarity of two strings.
Edit distance has applications, for example, in computational biology, natural language processing, and spell
checking. Your goal in this problem is to compute the edit distance between two strings

Overall time complexity:- O(m*n)
"""

def edit_distance(string1, string2):
    
    # for all i and j, d[i,j] will hold the Levenshtein distance between
    # the first i characters of string1 and the first j characters of string2
    # note that d has (m+1)*(n+1) values
    m = len(string1) + 1
    n = len(string2) + 1

    d = [0] * (m * n)

    # source prefixes can be transformed into empty string by
    # dropping all characters
    for i in range(m):
        d[i] = i

    # target prefixes can be reached from empty source prefix
    # by inserting every character

    for j in range(n):
        d[j * m] = j

    for j in range(1, n):
        for i in range(1, m):
            if string1[i-1] == string2[j-1]:
                d[i + j * m] = d[i-1 + (j-1) * m]
            else:
                d[i + j * m] = min(
                    d[i - 1 + j * m] + 1,  # deletion
                    d[i + (j - 1) * m] + 1, # insertion
                    d[i - 1 + (j - 1) * m] + 1 # subsitution
                )

    return d[-1]


================================================
FILE: Algorithms/DP/Egg_Drop/Egg_Drop.cpp
================================================
#include <bits/stdc++.h> 
using namespace std;
// Function for returning maximum of 2 numbers
int max(int a, int b) 
{ 
    return (a > b) ? a : b; 
}

// Function to obtain minimum number of trials required for finding the highest floor from which the egg can be dropped without breaking
int EggDrop(int n, int k) 
{ 
	// DP table to keep track of minimum number of trials for i eggs and j floors
	int eggFloor[n + 1][k + 1]; 
	int res; 

	for (int i = 1; i <= n; i++) { 
        // If there are no floors, then 0 trials are required.
        eggFloor[i][0] = 0; 
        // If there is only 1 floor, then 1 trial is required.
		eggFloor[i][1] = 1;
	} 

	// If there is only 1 egg, we have to drop it from each floor to check.
    // Hence for j floors, j trials are required
	for (int j = 1; j <= k; j++){
        eggFloor[1][j] = j; 
    }

	// For the rest of the floors from 2nd to nth
	for (int i = 2; i <= n; i++) { 
		for (int j = 2; j <= k; j++) { 
            // Consider the maximum possible trials initially
			eggFloor[i][j] = INT_MAX; 
            // For jth floor, we consider all the trials from 1st floor to jth floor
			for (int x = 1; x <= j; x++) { 
                // For each floor, we consider both cases:
                // a) when the egg breaks: Number of eggs reduce by 1, and we know the critical floor is below xth floor -> eggFloor[i-1][x-1]
                // b) when the egg doesn't break: Number of eggs remain same, and we know the critical is above xth floor -> eggFloor[i][j-x]
                // For considering the worst case scenario, the maximum of both cases is taken
				res = 1 + max(eggFloor[i - 1][x - 1], eggFloor[i][j - x]); 
                // If the obtained result is better (smaller) than previous result for some other x, the previous result is replaced with the better result
				if (res < eggFloor[i][j]) 
					eggFloor[i][j] = res; 
			} 
		} 
	} 

	// The result is available is eggFloor[n][k] after all the possible cases have been considered
	return eggFloor[n][k]; 
} 

int main() 
{ 
    // Initialise variables for number of eggs and number of floors
    // n = number of eggs, k = number of floors
	int n, k;
    cin >> n >> k;
	cout << "Minimum number of trials required: " << EggDrop(n,k) << endl;
	return 0; 
} 

================================================
FILE: Algorithms/DP/Egg_Drop/Egg_Drop.cs
================================================
using System;

namespace ConsoleApp1
{
    static class Program
    {
        private static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            int k = int.Parse(Console.ReadLine());
            Console.WriteLine("Minimum number of trials "
                              + "in worst case with " + n + " eggs and "
                              + k + " floors is " + eggDrop(n, k));
        }
        static int max(int a, int b)
        {
            return (a > b) ? a : b;
        }

        /* Function to get minimum number of  
        trials needed in worst case with n 
        eggs and k floors */
        static int eggDrop(int n, int k)
        {

            /* A 2D table where entery eggFloor[i][j] 
            will represent minimum number of trials 
            needed for i eggs and j floors. */
            int[,] eggFloor = new int[n + 1, k + 1];
            int res;
            int i, j, x;

            // We need one trial for one floor and0 
            // trials for 0 floors 
            for (i = 1; i <= n; i++)
            {
                eggFloor[i, 1] = 1;
                eggFloor[i, 0] = 0;
            }

            // We always need j trials for one egg 
            // and j floors. 
            for (j = 1; j <= k; j++)
                eggFloor[1, j] = j;

            // Fill rest of the entries in table 
            // using optimal substructure property 
            for (i = 2; i <= n; i++)
            {
                for (j = 2; j <= k; j++)
                {
                    eggFloor[i, j] = int.MaxValue;
                    for (x = 1; x <= j; x++)
                    {
                        res = 1 + max(eggFloor[i - 1, x - 1],
                                      eggFloor[i, j - x]);
                        if (res < eggFloor[i, j])
                            eggFloor[i, j] = res;
                    }
                }
            }

            // eggFloor[n][k] holds the result 
            return eggFloor[n, k];
        }
    }
}
// This code is contributed by Sam007 - GFG.

================================================
FILE: Algorithms/DP/Egg_Drop/egg drop.java
================================================
public class EggDroppDP {

    public int getDrops(int eggs, int floors){

        int [][] eggDrops = new int [eggs+1][floors+1];
        //base case 1:
        //if floors = 0 then no drops are required // OR floors = 1 then 1 drop is required
        for (int i = 1; i <=eggs ; i++) {
            eggDrops[i][0] = 0;
            eggDrops[i][1] = 1;
        }
        //base case 2:
        //if only one egg is there then drops = floors
        for (int i = 1; i <=floors ; i++) {
            eggDrops[1][i] = i;
        }

        for (int i = 2; i <=eggs ; i++) {
            for (int j = 2; j <=floors ; j++) {
                eggDrops[i][j] = Integer.MAX_VALUE;
                int tempResult;
                for (int k = 1; k <=j ; k++) {
                    tempResult = 1 + Math.max(eggDrops[i-1][k-1], eggDrops[i][j-k]);
                    eggDrops[i][j] = Math.min(tempResult,eggDrops[i][j]);
                }
            }
        }
        // eggDrops[eggs][floors] will have the result : minimum number of drops required in worst case
        return eggDrops[eggs][floors];
    }

    public static void main(String[] args) {
        EggDroppDP eggDP = new EggDroppDP();
        int eggs = 2;
        int floors = 100;
        System.out.printf("(DP) Minimum number of drops required in worst case with eggs:
             %s and floors: %s is : %s",eggs,floors,eggDP.getDrops(eggs,floors));
    }
}


================================================
FILE: Algorithms/DP/Egg_Drop/egg_drop.py
================================================
INT_MAX=32767

def egg_drop(n,k):
    m=[[0 for x in range(k+1)]for x in range(n+1)]
    for i in range(1,n+1):
        m[i][0]=0
        m[i][1]=1
    
    for j in range(1,k+1):
        m[1][j]=j

    for i in range(2,n+1):
        for j in range(2,k+1):
            m[i][j]=INT_MAX
            for x in range(1,j+1):
               res = 1 + max(m[i-1][x-1], m[i][j-x]) 
               if res < m[i][j]: 
                m[i][j] = res
    print(m) 
    return m[n][k]

n=2
k=6
print(egg_drop(n,k))


================================================
FILE: Algorithms/DP/Egg_Drop/egg_drop.ts
================================================
const eggDrop = (n: number, k: number) => {
  let eggFloor: number[][] = [];

  // A 2d array where entry eggFloor[i][j] will represent
  // the minimum number of trials needeed for i eggs and j floors
  for (let i = 0; i < n + 1; i++) {
    eggFloor.push(new Array(k + 1).fill(0));
  }

  // One trial for one floor and 0 trial for zero floor
  for (let i = 1; i < n + 1; i++) {
    eggFloor[i][1] = 1;
    eggFloor[i][0] = 0;
  }

  // We always need j trials for one egg and j floors
  for (let j = 1; j < k + 1; j++) {
    eggFloor[1][j] = j;
  }

  // Fill the rest of the entries in table using optimal
  // subtructure property
  for (let i = 2; i < n + 1; i++) {
    for (let j = 2; j < k + 1; j++) {
      eggFloor[i][j] = Number.MAX_SAFE_INTEGER;
      for (let x = 0; x < j + 1; x++) {
        let res = 1 + Math.max(eggFloor[i - 1][x - 1], eggFloor[i][j - x]);
        if (res < eggFloor[i][j]) {
          eggFloor[i][j] = res;
        }
      }
    }
  }

  // eggFloor[n][k] holds the result
  return eggFloor[n][k];
};

const n = 2;
const k = 36;
console.log(
  "Minimum worst case of trials in worst case with " +
    n +
    " eggs " +
    k +
    " floors is " +
    eggDrop(n, k)
);


================================================
FILE: Algorithms/DP/Fibonacci_Series/Fibonacci.c
================================================
#include<stdio.h>
int main()
{
int first=0, second=1, i, n, sum=0;
printf("Enter the number of terms: ");
scanf("%d",&n);
//accepting the terms
printf("Fibonacci Series:");
for(i=0 ; i<n ; i++)
{
if(i <= 1)
{
sum=i;
}
//to print 0 and 1
else
{
sum=first + second;
first=second;
second=sum;
//to calculate the remaining terms.
//value of first and second changes as new term is printed.
}
printf(" %d",sum)
}
return 0;
}


================================================
FILE: Algorithms/DP/Fibonacci_Series/Fibonacci.php
================================================
<?php
/**
 * Iterative solution for Fibonacci Numbers
 * Execute this file whith: php -f Fibonacci.php
 * @author juanmagutierrez89
 */

/**
 * This function returns the nth fibonacci number
 * @param int $n 
 * @return int the nth fibonacci number
 */
function fibonacci(int $n) : int {
    if ($n <= 1) {
        return $n;
    }
    
    $a = 0;
    $b = 1;
    
    for ($i = 0; $i < $n; $i++) {
        $a = $b - $a;
        $b = $a + $b;
    }
    
    return $a;
}


echo "First ten Fibonacci numbers: \n";
for ($i=0; $i < 10; $i++) {
    echo "fibonacci($i): ".fibonacci($i)."\n";
}

echo "\n";

?>

================================================
FILE: Algorithms/DP/Fibonacci_Series/fibonacci.go
================================================
package main

import "fmt"

func Fibonacci(n uint) uint64 {
  if n <= 1 {
    return uint64(n)
  }

  var n2, n1 uint64 = 0, 1

  for i := uint(2); i < n; i++ {
    n2, n1 = n1, n1+n2
  }

  return n2 + n1
}

func main() {
	for i := uint(0); i < 10; i++ {
		fmt.Println(Fibonacci(i))
	}
}

================================================
FILE: Algorithms/DP/Fibonacci_Series/fibonacci.js
================================================
/*
This function returns the nth fibonacci number, given 
*/
function fibonacci(n, memoizer) {
    memoizer = memoizer || {};
    if (memoizer[n]) {
        return memoizer[n];
    }
    if (n <= 1) {
        return 1;
    }
    return memoizer[n] = fibonacci(n - 1, memoizer) + fibonacci(n - 2, memoizer);
}


================================================
FILE: Algorithms/DP/Fibonacci_Series/fibonacci.py
================================================
def fibonacci(n): 
	FibArray = [0, 1] 
	
	while len(FibArray) < n + 1: 
		FibArray.append(0) 
	
	if n <= 1: 
		return n 
	else: 
		if FibArray[n - 1] == 0: 
			FibArray[n - 1] = fibonacci(n - 1) 

		if FibArray[n - 2] == 0: 
			FibArray[n - 2] = fibonacci(n - 2) 
			
	FibArray[n] = FibArray[n - 2] + FibArray[n - 1] 
	return FibArray[n] 
	
print(fibonacci(5)) 


================================================
FILE: Algorithms/DP/Gauss_Easter_Date/CalculateEasterDate.java
================================================
import java.util.HashMap;
import java.util.Map;

/**
 * @author Alessandro Arosio - 04/10/2020 08:39
 */

public class CalculateEasterDate {
    private static final String LOCATION_OF_YEAR = "locationOfYear";
    private static final String LEAP_DAYS = "leapDays";
    private static final String NON_LEAP_YEAR = "nonLeapYear";
    private static final String YEARS_DIVIDED_100 = "yearsDividedBy100";
    private static final String CENTURY = "century";
    private static final String DIFFERENCE_LEAP_DAYS = "differenceOfLeapDays";
    private static final String DAYS_TO_ADD = "numberOfDaysToAdd";
    private static final String DAYS_TO_NEXT_SUNDAY = "numberOfDaysToNextSunday";
    private static final String DAYS = "days";

    public static void main(String[] args) {
        int year = 2019;
        gaussEaster(year);
    }

    static void gaussEaster(int year) {
        Map<String, Double> gaussNumbers = getGaussNumbers(year);
        Integer days = gaussNumbers.get(DAYS).intValue();

        if (is29Days(gaussNumbers.get(DAYS_TO_ADD), gaussNumbers.get(DAYS_TO_NEXT_SUNDAY))) {
            System.out.println(year + "-04" + "-19");
        }
        else if (is28Days(gaussNumbers.get(DAYS_TO_ADD),gaussNumbers.get(DAYS_TO_NEXT_SUNDAY))) {
            System.out.println(year + "-04" + "-18");
        } else {
            if (gaussNumbers.get(DAYS) > 31) {
                System.out.println(year + "-04-" + (days - 31));
            }
            else {
                System.out.println(year + "-03-" + days);
            }
        }
    }

    private static boolean is29Days(Double days, Double daysToSunday) {
        return days.intValue() == 29 && daysToSunday.intValue() == 6;
    }

    private static boolean is28Days(Double days, Double daysToSunday) {
        return days.intValue() == 28 && daysToSunday.intValue() == 6;
    }

    private static Map<String, Double> getGaussNumbers(int year) {
        Map<String, Double> gauss = new HashMap<>();
        gauss.put(LOCATION_OF_YEAR, Double.valueOf(year % 19));
        gauss.put(LEAP_DAYS, Double.valueOf(year % 4));
        gauss.put(NON_LEAP_YEAR, Double.valueOf(year % 7));
        gauss.put(YEARS_DIVIDED_100, Math.floor(year / 100));
        gauss.put(CENTURY, calculateCentury(gauss.get(YEARS_DIVIDED_100)));
        gauss.put(DIFFERENCE_LEAP_DAYS, (4 + gauss.get(YEARS_DIVIDED_100) - gauss.get(YEARS_DIVIDED_100) / 4) % 7);
        gauss.put(DAYS_TO_ADD, (19 * gauss.get(LOCATION_OF_YEAR) + gauss.get(CENTURY)) % 30);
        gauss.put(DAYS_TO_NEXT_SUNDAY, (2 * gauss.get(LEAP_DAYS) + 4 *
                gauss.get(NON_LEAP_YEAR) + 6 *
                gauss.get(DAYS_TO_ADD) +
                gauss.get(DIFFERENCE_LEAP_DAYS)) % 7);
        gauss.put(DAYS, 22 + gauss.get(DAYS_TO_ADD) + gauss.get(DAYS_TO_NEXT_SUNDAY));

        return gauss;
    }

    private static Double calculateCentury(Double yearsDividedBy100) {
        double floor = Math.floor((13 + 8 * yearsDividedBy100) / 25);
        return (15 - floor + yearsDividedBy100 - yearsDividedBy100 / 4) % 30;
    }
}


================================================
FILE: Algorithms/DP/Gauss_Easter_Date/Gauss_Easter_Date.cpp
================================================
#include <iostream>
using namespace std;

void gaussAlgorithm(int year, int *month, int *day);

int main()
{
	int year, easterMonth=3, easterDay=22;
	cout << "Enter a year for which you wish to find out date of Easter for: ";
	cin >> year; //input year
	cout << endl;
	gaussAlgorithm(year, &easterMonth, &easterDay); //calculate month and day
	cout << "Date of easter for year " << year << " is: " << ((easterMonth == 3) ? "March " : "April ") << easterDay << endl;
	char ch;
	cin >> ch; //wait for user input
	return 0;
}

void gaussAlgorithm(int year, int *month, int *day) //https://math.stackexchange.com/questions/896954/decoding-gauss-easter-algorithm
{
	int a, b, c, k, p, q, M, N, d, e;
	a = year%19;
	b = year%4;
	c = year%7;
	k = year/100;
	p = (13+8*k)/25; q = k/4;
	M = (15-p+k-q)%30;
	N = (4+k-q)%7;
	d = (19*a + M) %30;
	e = (2*b + 4*c + 6*d + N)%7;
	if((22+d+e) < 32)
	{
		*day=22+d+e;
	}
	else
	{
		*day=d+e-9;
		*month=4;
	}
	if(d==29 && e==6 && *month==4 && *day==26)
		*day=19;
	if(d==28 && e==6 && *month==4 && *day==25 && (11*M+11)%30 < 19)
		*day=18;
} //"It is not possible to present here the entire analysis that led to the above formula" -Gauss


================================================
FILE: Algorithms/DP/Gauss_Easter_Date/Gauss_Easter_Date.php
================================================
<?php
function Gauss_Easter($year){
	$a = fmod($year,19);
	$b = fmod($year,4);
	$c = fmod($year,7);
	$p = floor($year/100);
	$q = floor((13+8*$p)/25);
	$m = fmod((15-$q+$p-($p/4)),30);
	$n = fmod(4+$p-($p/4),7);
	$d = fmod((19*$a+$m),30);
	$e = fmod($n+2*$b+4*$c+6*$d,7);
	$days = 22+$d+$e;

	if($d==29 && $e==6){
		echo $year."April 19";
	}
	elseif($d==28 && $e==6){
		echo $year."April 18";
	}
	else{
		if($days>31){
			echo $year."-April-".($days-31);
		}
		else{
			echo $year."-March-".$days;
		}
	}
}
//Example Case
echo Gauss_Easter(2020);


================================================
FILE: Algorithms/DP/Gauss_Easter_Date/Gauss_Easter_Date.py
================================================
import math

def Easter(Year):
    # Gauss Easter Algorithm
    a = Year % 19
    b = Year % 4
    c = Year % 7
    k = math.floor(Year / 100)
    p = math.floor((13 + 8 * k) / 25)
    q = k/4
    m = (15 - p + k - q) % 30
    n = (4 + k - q) % 7
    d = (19 * a + m) % 30
    e = (2 * b + 4 * c + 6 * d + n) % 7
    days = (22 + d + e)
  
    # d is 29
    if ((d == 29) and (e == 6)):
        print(Year, "- 04 -19")
        return
    # d is 28
    elif ((d == 28) and (e == 6)):
        print(Year, "- 04 -18")
        return
    else:
        # If days > 31, April
        if (days > 31):
            print(Year, "- 04 -", int(days - 31))
            return
        else:
            # Otherwise, March
            print(Year, "- 03 -", days)
            return




Year = 2012
Easter(Year)







================================================
FILE: Algorithms/DP/Gauss_Easter_Date/Gauss_Easter_Date.rb
================================================
def gauss_easter(y)
    a = y % 19
    b = y % 4
    c = y % 7
    
    p = (y / 100).floor
    q = ((13 + 8 * p) / 25).floor
    m = (15 - q + p - (p / 4)) % 30
    
    n = (4 + p - (p / 4)) % 7
    
    d = (19 * a + m) % 30
    
    e = (2 * b + 4 * c + 6 * d + n) % 7
    
    day = (22 + d + e)
      
    if (d == 29) && (e == 6)
        puts("The Easter date for your entered year is: #{y}-04-19")
    elsif (d == 28) && (e == 6)
        return puts("The Easter date for your entered year is: #{y}-04-18")
    else
        if day > 31
            return puts("The Easter date for your entered year is: #{y}-04-#{day-31}")
        else
            return puts("The Easter date for your entered year is: #{y}-03-#{day}")
        end
    end    
end

print("Enter the year you want to calculate the Easter date: ")
y = Integer(gets.chomp())
gauss_easter(y)

================================================
FILE: Algorithms/DP/Gauss_Easter_Date/easterDate.cpp
================================================
#include <iostream>
#include <string>

using namespace std;

int main()
{
  unsigned short year, a, b;

  cout << "\nFor which year do you want to know Easter date?\n> ";
  cin >> year;

  a = (19 * (year % 19) + 15) % 30;
  b = (2 * (year % 4) + 4 * (year % 7) + 6 * a + 6) % 7;

cout << "Easter date in " << year << " is "
  << ((a + b > 26) ?
    ("May " + to_string(a + b - 26)) :
    ("April " + to_string(4 + a + b)))
  << endl;

return 0;
}


================================================
FILE: Algorithms/DP/Gauss_Easter_Date/easterDate.go
================================================
package main

import "fmt"

func getEasterDate(_year int) {
	a := (19 * (_year % 19) + 15) % 30
	b := (2 * (_year % 4) + 4 * (_year % 7) + 6 * a + 6) % 7

	var _date string
	if a + b > 26 {
		_date =  fmt.Sprintf("May %d", (a + b - 26))
	} else {
		_date =  fmt.Sprintf("April %d", (4 + a + b))
	}

	fmt.Println(_date, _year)
}

func main() {
	getEasterDate(2020)
}

================================================
FILE: Algorithms/DP/Gauss_Easter_Date/easterDate.java
================================================
import java.util.Date;
import java.util.Scanner;
 
// Function calculates and prints
// easter date for given year Y
 class Main {
 
    static void gaussEaster(int Y)
    {
        float A, B, C, P, Q,
            M, N, D, E;
 
        // All calculations done
        // on the basis of
        // Gauss Easter Algorithm
        A = Y % 19;
        B = Y % 4;
        C = Y % 7;
        P = (float)Math.floor(Y / 100);
        Q = (float)Math.floor(
            (13 + 8 * P) / 25);
        M = (15 - Q + P - P / 4) % 30;
        N = (4 + P - P / 4) % 7;
        D = (19 * A + M) % 30;
        E = (2 * B + 4 * C + 6 * D + N) % 7;
        int days = (int)(22 + D + E);
 
        // A corner case,
        // when D is 29
        if ((D == 29) && (E == 6)) {
            System.out.println(Y + "-04"
                               + "-19");
            return;
        }
        // Another corner case,
        // when D is 28
        else if ((D == 28) && (E == 6)) {
            System.out.println(Y + "-04"
                               + "-18");
            return;
        }
        else {
 
            // If days > 31, move to April
            // April = 4th Month
            if (days > 31) {
                System.out.println(Y + "-04-"
                                   + (days - 31));
                return;
            }
            // Otherwise, stay on March
            // March = 3rd Month
            else {
                System.out.println(Y + "-03-"
                                   + days);
                return;
            }
        }
    }
 
    // Driver code
    public static void main(String[] args)
    {
        int Y = new java.util.Scanner(System.in).nextInt();
        gaussEaster(Y);
    }
}


================================================
FILE: Algorithms/DP/Gauss_Easter_Date/easterDate.js
================================================
const readline = require('readline')

const rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout
});

rl.question('\nFor which year do you want to know Easter date?\n> ', year => {
  year = parseInt(year)

  const a = (19 * (year % 19) + 15) % 30
  const b = (2 * (year % 4) + 4 * (year % 7) + 6 * a + 6) % 7

  console.log(`Easter date in ${year} is \
${a + b > 26 ? 'May ' + (a + b - 26) : 'April ' + (4 + a + b)}\n`)

  rl.close()
})


================================================
FILE: Algorithms/DP/Generate_ATM_Codes.py
================================================
print('Welcome to Northen Frock Bank ATM')

restart=('Y')

chances = 3

balance = 67.14

while chances >= 0:

    pin = int(input('Please Enter You 4 Digit Pin: '))

    if pin == (1234):

        print('You entered you pin Correctly\n')

        while restart not in ('n','NO','no','N'):

            print('Please Press 1 For Your Balance\n')

            print('Please Press 2 To Make a Withdrawl\n')

            print('Please Press 3 To Pay in\n')

            print('Please Press 4 To Return Card\n')

            option = int(input('What Would you like to choose?'))

            if option == 1:

                print('Your Balance is £',balance,'\n')

                restart = input('Would You you like to go back? ')

                if restart in ('n','NO','no','N'):

                    print('Thank You')

                    break

            elif option == 2:

                option2 = ('y')

                withdrawl = float(input('How Much Would you like to      

withdraw? \n£10/£20/£40/£60/£80/£100 for other enter 1: '))

                if withdrawl in [10, 20, 40, 60, 80, 100]:

                    balance = balance - withdrawl

                    print ('\nYour Balance is now £',balance)

                    restart = input('Would You you like to go back? ')

                    if restart in ('n','NO','no','N'):

                        print('Thank You')

                        break

                elif withdrawl != [10, 20, 40, 60, 80, 100]:

                    print('Invalid Amount, Please Re-try\n')

                    restart = ('y')

                elif withdrawl == 1:

                    withdrawl = float(input('Please Enter Desired amount:'))    

            elif option == 3:

                Pay_in = float(input('How Much Would You Like To Pay In? '))

                balance = balance + Pay_in

                print ('\nYour Balance is now £',balance)

                restart = input('Would You you like to go back? ')

                if restart in ('n','NO','no','N'):

                    print('Thank You')

                    break

            elif option == 4:

                print('Please wait whilst your card is Returned...\n')

                print('Thank you for you service')

                break

            else:


================================================
FILE: Algorithms/DP/Gold_Mine_Problem/goldmine.java
================================================
// Java program to solve Gold Mine problem 
import java.util.Arrays; 

class goldmine { 
	
	
	
	// Returns maximum amount of gold that 
	// can be collected when journey started 
	// from first column and moves allowed 
	// are right, right-up and right-down 
	static int getMaxGold(int gold[][], int m, int n) 
	{ 
		
		// Create a table for storing 
		// intermediate results and initialize 
		// all cells to 0. The first row of 
		// goldMineTable gives the maximum 
		// gold that the miner can collect 
		// when starts that row 
		int goldTable[][] = new int[m][n]; 
		
		for(int[] rows:goldTable) 
			Arrays.fill(rows, 0); 
	
		for (int col = n-1; col >= 0; col--) 
		{ 
			for (int row = 0; row < m; row++) 
			{ 
				
				// Gold collected on going to 
				// the cell on the right(->) 
				int right = (col == n-1) ? 0
						: goldTable[row][col+1]; 
	
				// Gold collected on going to 
				// the cell to right up (/) 
				int right_up = (row == 0 || 
							col == n-1) ? 0 : 
						goldTable[row-1][col+1]; 
	
				// Gold collected on going to 
				// the cell to right down (\) 
				int right_down = (row == m-1
							|| col == n-1) ? 0 : 
						goldTable[row+1][col+1]; 
	
				// Max gold collected from taking 
				// either of the above 3 paths 
				goldTable[row][col] = gold[row][col] 
				+ Math.max(right, Math.max(right_up, 
									right_down)); 
														; 
			} 
		} 
	
		// The max amount of gold collected will be 
		// the max value in first column of all rows 
		int res = goldTable[0][0]; 
		
		for (int i = 1; i < m; i++) 
			res = Math.max(res, goldTable[i][0]); 
			
		return res; 
	} 
	
	//driver code 
	public static void main(String arg[]) 
	{ 
		int gold[][]= { {1, 3, 1, 5}, 
						{2, 2, 4, 1}, 
						{5, 0, 2, 3}, 
						{0, 6, 1, 2} }; 
						
		int m = 4, n = 4; 
		
		System.out.print(getMaxGold(gold, m, n)); 
	} 
} 




================================================
FILE: Algorithms/DP/Gold_Mine_Problem/goldmine.py
================================================
MAX = 100


def getMaxGold(gold, m, n):

    goldTable = [[0 for i in range(n)]
                 for j in range(m)]

    for col in range(n-1, -1, -1):
        for row in range(m):

            if (col == n-1):
                right = 0
            else:
                right = goldTable[row][col+1]

            if (row == 0 or col == n-1):
                right_up = 0
            else:
                right_up = goldTable[row-1][col+1]

            if (row == m-1 or col == n-1):
                right_down = 0
            else:
                right_down = goldTable[row+1][col+1]

            goldTable[row][col] = gold[row][col] + \
                max(right, right_up, right_down)

    res = goldTable[0][0]
    for i in range(1, m):
        res = max(res, goldTable[i][0])

    return res


gold = [[1, 3, 1, 8],
        [2, 9, 8, 1],
        [7, 0, 1, 3],
        [0, 6, 1, 2]]

m = 4
n = 4

print(getMaxGold(gold, m, n))


================================================
FILE: Algorithms/DP/Golomb_Sequence/Golomb Sequence.cpp
================================================
#include <bits/stdc++.h> 
using namespace std; 
  
void printGolomb(int n) 
{ 
    int dp[n + 1]; 
    dp[1] = 1; 
    cout << dp[1] << " "; 
    for (int i = 2; i <= n; i++)  
    { 
        dp[i] = 1 + dp[i - dp[dp[i - 1]]]; 
        cout << dp[i] << " "; 
    } 
} 
int main() 
{ 
    int n;
    cin>>n;
  
    printGolomb(n); 
    return 0; 
} 

I/P: n=9
O/P: 1 2 2 3 3 4 4 4 5


================================================
FILE: Algorithms/DP/Golomb_Sequence/Golomb.cpp
================================================
// C++ Program to find first 
// n terms of Golomb sequence. 
#include <bits/stdc++.h> 
using namespace std; 

// Print the first n term 
// of Golomb Sequence 
void printGolomb(int n) 
{ 
	int dp[100]; 

	// base cases 
	dp[1] = 1; 
	cout << dp[1] << " "; 

	// Finding and printing first 
	// n terms of Golomb Sequence. 
	for (int i = 2; i <= n; i++) 
	{ 
		dp[i] = 1 + dp[i - dp[dp[i - 1]]]; 
		cout << dp[i] << " "; 
	} 
} 
// Driver Code 
int main() 
{ 
	int n = 9; 

	printGolomb(n); 
	return 0; 
} 


================================================
FILE: Algorithms/DP/Golomb_Sequence/Golomb.java
================================================
import java.util.*; 
  
class Golomb  
{ 
      
    public static void printGolomb(int n) 
    { 
        int dp[] = new int[n + 1];  
        dp[1] = 1; 
        System.out.print(dp[1] + " "); 
        for (int i = 2; i <= n; i++)  
        { 
            dp[i] = 1 + dp[i - dp[dp[i - 1]]]; 
              
        System.out.print(dp[i] + " "); 
        } 
    } 
    public static void main (String[] args) 
    { 
        Scanner s = new Scanner(System.input());
        int n = s.nextInt();
        printGolomb(n); 
    } 
}

================================================
FILE: Algorithms/DP/Golomb_Sequence/golomb.py
================================================
# Golomb sequence 
def findGolomb(n): 

	if (n == 1): 
		return 1

	return 1 + findGolomb(n - findGolomb(findGolomb(n - 1))) 
 
def printGolomb(n): 

	for i in range(1, n + 1): 
		print(findGolomb(i), end=" ") 

n = 19
printGolomb(n) 


================================================
FILE: Algorithms/DP/Knight_Probability/Knight_Probability_in_a_ChessBoard.cpp
================================================
#include <bits/stdc++.h>
using namespace std;

double knightProbability(int N, int K, int sr, int sc) 
    {
        vector<vector<double> > dp(N, vector<double>(N));
        int dr[8] = {2, 2, 1, 1, -1, -1, -2, -2};
        int dc[8] = {1, -1, 2, -2, 2, -2, 1, -1};

        dp[sr][sc] = 1;
        for (; K > 0; K--) {
            vector<vector<double> > dp2(N, vector<double>(N));
            for (int r = 0; r < N; r++) {
                for (int c = 0; c < N; c++) {
                    for (int k = 0; k < 8; k++) {
                        int cr = r + dr[k];
                        int cc = c + dc[k];
                        if (0 <= cr && cr < N && 0 <= cc && cc < N) {
                            dp2[cr][cc] += dp[r][c] / 8.0;
                        }
                    }
                }
            }
            dp = dp2;
        }
        double ans = 0.0;
        for (auto row: dp) {
            for (double x: row) ans += x;
        }
        return ans;
    }
    
int main()
{
    int n, k, sr, sc;
    cout << "Please enter size of chessboard, number of moves, starting row and starting column" << endl;
    cin >> n >> k >> sr >> sc;
    cout << "The probability that the knight remains on the board after it has stopped moving is " << knightProbability(n, k, sr, sc) << endl;
    return 0;
}


================================================
FILE: Algorithms/DP/Knight_Probability/Problem_Statement.md
================================================
On an NxN chessboard, a knight starts at the r-th row and c-th column and attempts to make exactly K moves. 
The rows and columns are 0 indexed, so the top-left square is (0, 0), and the bottom-right square is (N-1, N-1).

A chess knight has 8 possible moves it can make, as illustrated below. 
Each move is two squares in a cardinal direction, then one square in an orthogonal direction.

Each time the knight is to move, it chooses one of eight possible moves uniformly at random (even if the piece would go off the chessboard) and moves there.

The knight continues moving until it has made exactly K moves or has moved off the chessboard. 
Return the probability that the knight remains on the board after it has stopped moving.
 


================================================
FILE: Algorithms/DP/LCS/LCS_of_three_strings.py
================================================
def three_LCS(A,B,C):
    m=len(A)
    n=len(B)
    o=len(C)
    L=[[[0 for i in range(o+1)]for j in range(n+1)]for k in range(m+1)]
    for i in range(m+1):
        for j in range(n+1):
            for k in range(o+1):
                if (i==0 or j==0 or k==0):
                    L[i][j][k]=0
                elif (A[i-1]==B[j-1] and A[i-1]==C[k-1]):
                     L[i][j][k]= 1+L[i-1][j-1][k-1]
                else:
                     L[i][j][k]=max(max(L[i-1][j][k],L[i][j-1][k]),L[i][j][k-1])
    return L[m][n][o]


X = 'ABCDAB'
Y = 'BDCABA'
Z = '12XBA'

print('Length of LCS of three strings is', three_LCS(X, Y, Z))


================================================
FILE: Algorithms/DP/LCS/LongestCommonSubsequence.cpp
================================================
#include <bits/stdc++.h>

using namespace std;
int LCS(string s1, string s2){//function to get the longest common subsequence
    vector<vector<int>> dp(s1.length()+1, vector<int>(s2.length()+1, 0));//table of dp for finding length of longest subsequence
    for(int i = 1; i<=s1.length(); i++){
        for(int j = 1; j<= s2.length(); j++){
            if(s1[i-1] == s2[j-1])//if letter match in both string the following line to be used
                dp[i][j] = 1+ dp[i-1][j-1];
            else
                dp[i][j] = max(dp[i-1][j], dp[i][j-1]);
        }
    }
    return dp[s1.length()][s2.length()];//length of longest common subsequence here
}
int main()
{
    string s1, s2;
    cin>>s1;
    cin>> s2;
    int res = LCS(s1,s2);
    cout<< res<<endl;
    return 0;
}


================================================
FILE: Algorithms/DP/LCS/LongestCommonSubsequenceLength.java
================================================
import java.util.Scanner;
class LongestCommonSubsequenceLength{
  public static void main(String[]args){
    //initialize scanner
    Scanner kb=new Scanner(System.in);
    //prompt user for input
    System.out.println("Provide 2 Strings");
    //take in 2 strings
    String s1=kb.nextLine();
    String s2=kb.nextLine();
    //make 2d array for strings (with space for zeroes to pad first row and column)
    int[][]a=new int[s1.length()+1][s2.length()+1];

    //pad firs column with 0s
    for(int i=0; i<=s1.length(); i++)
      a[i][0]=0;
    //pad first column with 0s
    for(int j=0; j<=s2.length(); j++)
      a[0][j]=0;
    /*now loop over the entire 2d matrix and use the following
      recurrence relation: a[i][j]=max(a[i-1][j], a[i][j-1])
      or if the current i,j position has a matching character include a[i-1][j-1] in that calculation.  

      Why does this work?  We take either the longest common subsequence up to character j of string 2 or up to character i of string 1, whichever is better, because each occurrence must be in order, the greater of these two must be best up to index i in string 1 and index j in string 2.  

      However, if the ith character of str1 matches the jth character of str2, then we must consider what happens if the optimal solution through character i-1 and j-1 was the same as i-1 and j or j-1 and i.  Clearly, in either of these cases, by taking the ith character of string 1, which matches the jth character of string 2, we are guaranteed to be better off taking i and j matching character next, because the alternative would be to wait for either i and j+1 or j and i+1 to match, both of which are at least no better than having the same count through i and j.  
    */
    for(int i=0; i<s1.length(); i++)
      for(int j=0; j<s2.length(); j++)
        if(s1.charAt(i)==s2.charAt(j))
          a[i+1][j+1]=Math.max(Math.max(a[i][j]+1, a[i][j+1]),a[i+1][j]);
        else
          a[i+1][j+1]=Math.max(a[i][j+1], a[i+1][j]);

    /*Then we just print out whatever is in the last position in our array since it's the longest common subsequence up through the final characters of each string*/
    System.out.println(a[s1.length()][s2.length()]);
    
  }
}


================================================
FILE: Algorithms/DP/LCS/Longest_Common_Subsequence_of_Three_String.java
================================================
import java.io.*;
import java.util.*;
class LCS3Strings { 
    public static int lcsOf3(String X, String Y, String Z, int m,int n, int o) 
    { 
        int[][][] L = new int[m+1][n+1][o+1]; 
  
        for (int i=0; i<=m; i++) 
        { 
            for (int j=0; j<=n; j++) 
            { 
                for (int k=0; k<=o; k++) 
                { 
                    if (i == 0 || j == 0||k==0) 
		    {
                        L[i][j][k] = 0; 
		    }       
                    else if (X.charAt(i - 1) == Y.charAt(j - 1)  && X.charAt(i - 1)==Z.charAt(k - 1)) 
		    {
                        L[i][j][k] = L[i-1][j-1][k-1] + 1; 
		    }       
                    else
		    {
                        L[i][j][k] = Math.max(Math.max(L[i-1][j][k],L[i][j-1][k]), L[i][j][k-1]); 
		    }
                } 
            } 
        } 
      
        return L[m][n][o]; 
    } 
       
    public static void main(String args[]) 
    { 
	Scanner sc = new Scanner(System.in);
        String X = sc.nextLine();
        String Y = sc.nextLine(); 
        String Z = sc.nextLine(); 
       
        int m = X.length(); 
        int n = Y.length(); 
        int o = Z.length(); 
       
        System.out.println("Length of LCS is " + lcsOf3(X, Y,Z, m, n, o)); 
       
    } 
} 

================================================
FILE: Algorithms/DP/LCS/Longest_Common_Subsequence_of_Two_Sequences.c
================================================
/*
	Author-yogesh kansal

problem statement:
		Given two sequences ?? = (a1, a2, . . . , am) and ?? = (b1, b2, . . . , bn),
 		find the length of their longest common subsequence'
 
time complexity :- O(m*n)
space complexity :- O(m*n)
*/

#include <stdio.h>
#define M 1000000007LL
#define mod 998244253LL
#define ll long long int
#define vi vector<int>

int max(int a,int b) {
	if(a>b)
		return a;
	else
		return b;
}

int main() {
	int n,m,i,j;
	
	printf("enter length of 1st subsequrnce:- ");
	scanf("%d",&n);
	int a[n];
	printf("\nenter sequence:- ");
	for(i=0;i<n;i++) scanf("%d",&a[i]);
	
	printf("\nenter length of 2nd sequence:- ");
	scanf("%d",&m);
	int b[m];
	printf("\nenter sequence:- ");
	for(i=0;i<m;i++) scanf("%d",&b[i]);
	
	int dp[n+1][m+1];
	for(i=0;i<=n;i++)
	dp[i][0]=0;
	for(i=0;i<=m;i++)
	dp[0][i]=0;
	
	for(i=1;i<=n;i++)
	{
		for(j=1;j<=m;j++)
		{
			
			dp[i][j]=max(max(dp[i-1][j],dp[i][j-1]),dp[i-1][j-1]);
			if(a[i-1]==b[j-1])
			dp[i][j]+=1;
		}
	}
	printf("\nlength of longest common subsequence is:- ");
	printf("%d",dp[n][m]);
	return 0;
}


================================================
FILE: Algorithms/DP/LCS/Longest_Common_Subsequence_of_Two_Sequences.cpp
================================================
/*
	Author-yogesh kansal

problem statement:
		Given two sequences ?? = (a1, a2, . . . , am) and ?? = (b1, b2, . . . , bn),
 		find the length of their longest common subsequence'
 
time complexity :- O(m*n)
space complexity :- O(m*n)
*/

#include <stdio.h>
#define M 1000000007LL
#define mod 998244253LL
#define ll long long int
#define vi vector<int>

int max(int a,int b) {
	if(a>b)
		return a;
	else
		return b;
}

int main() {
	int n,m,i,j;
	
	printf("enter length of 1st subsequrnce:- ");
	scanf("%d",&n);
	int a[n];
	printf("\nenter sequence:- ");
	for(i=0;i<n;i++) scanf("%d",&a[i]);
	
	printf("\nenter length of 2nd sequence:- ");
	scanf("%d",&m);
	int b[m];
	printf("\nenter sequence:- ");
	for(i=0;i<m;i++) scanf("%d",&b[i]);
	
	int dp[n+1][m+1];
	for(i=0;i<=n;i++)
	dp[i][0]=0;
	for(i=0;i<=m;i++)
	dp[0][i]=0;
	
	for(i=1;i<=n;i++)
	{
		for(j=1;j<=m;j++)
		{
			
			dp[i][j]=max(max(dp[i-1][j],dp[i][j-1]),dp[i-1][j-1]);
			if(a[i-1]==b[j-1])
			dp[i][j]+=1;
		}
	}
	printf("\nlength of longest common subsequence is:- ");
	printf("%d",dp[n][m]);
	return 0;
}


================================================
FILE: Algorithms/DP/LCS/lcs.py
================================================
#Longest Common Subsequence
text1=input()
text2=input()
m=len(text1)
n=len(text2)
dp=[[0 for j in range(n+1)]for i in range(m+1)]
for i in range(m+1):
  for j in range(n+1):
    if i==0 or j==0:
      dp[i][j]=0
    elif text1[i-1]==text2[j-1]:
      dp[i][j]=1+dp[i-1][j-1]
    else:
      dp[i][j]=max(dp[i-1][j],dp[i][j-1])
print(dp[m][n])


================================================
FILE: Algorithms/DP/LCS/lcs_of_3_strings.cpp
================================================
#include<bits/stdc++.h> 
using namespace std;
 
#define ull unsigned long long
#define int long long
#define ld long double
#define pb push_back
#define pi  pair< int,int >
#define ff first
#define ss second
#define mod 1000000007
#define endl "\n"
 
signed main()
{
 
    ios_base::sync_with_stdio(false); cin.tie(NULL);
 
    // #ifndef ONLINE_JUDGE
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    // #endif
 
    string s1,s2,s3;
    cin>>s1>>s2>>s3;  // take input of three strings

    // Find the length of the three strings
    int n = s1.length(), m = s2.length(), l = s3.length();

    // Finding the lcs length

    int dp[n+1][m+1][l+1];

    for(int i=0; i<=n; i++)
    {
        for(int j=0; j<=m; j++)
        {
            for(int k=0; k<=l; k++)
            {
                if(i==0 || j==0 || k==0)
                    dp[i][j][k] = 0;
                else if(s1[i-1] == s2[j-1] && s2[j-1] == s3[k-1])
                    dp[i][j][k] = dp[i-1][j-1][k-1] + 1;
                else
                    dp[i][j][k] = max(dp[i-1][j][k], max(dp[i][j-1][k], dp[i][j][k-1]));
            }
        }
    }

    int length_of_lcs = dp[n][m][l];     // Length of LCS of the 3 strings

    int i=n, j=m, k=l;

    string ans="";   // Initializing lcs string

    while(i>0 && j>0 && k>0)
    {
        if(s1[i-1] == s2[j-1] && s2[j-1] == s3[k-1])   // If current character in s1, s2, and s3 are same, then current character is part of LCS 
        {
            ans+=s1[i-1];
            i--;
            j--;
            k--;
        }
        // If not same, then find the larger of the three and go in the direction of larger value 
        else if(dp[i-1][j][k] > dp[i][j-1][k] || dp[i-1][j][k] > dp[i][j][k-1])
            i--;
        else if(dp[i][j-1][k] > dp[i-1][j][k] || dp[i][j-1][k] > dp[i][j][k-1])
            j--;
        else
            k--;
    }

    // We have to reverse the lcs string because we
    // put characters in the lcs string from the last
    reverse(ans.begin(), ans.end());

    cout<<"The longest common subsequence is: ";

    cout<<ans<<endl;
 
    return 0;
   
}

================================================
FILE: Algorithms/DP/LIS/LIS.c
================================================
/* Dynamic Programming C implementation of LIS problem */
#include<stdio.h>  
	
/* lis() returns the length of the longest increasing subsequence in arr[] of size n */
int lis( int arr[], int n ) 
{ 
	int lis[10000]; 
	int i, j;
	lis[0] = 1; 

	/* Compute optimized LIS values in bottom up manner */
	for (i = 1; i < n; i++ ) 
	{ 
		lis[i] = 1; 
		for (j = 0; j < i; j++ ) 
			if ( arr[i] > arr[j] && lis[i] < lis[j] + 1) 
				lis[i] = lis[j] + 1; 
	} 

	// Return maximum value in lis[] 
	int mmax=-99999;
	for(i=0;i<n;i++)
	{
		if(mmax<lis[i])
			mmax = lis[i];
	}
	return mmax; 
} 
	
/* Driver program to test above function */
int main() 
{ 
	int n;
	int arr[10000];
	scanf("%d", &n);
	for(int i=0;i<n;i++)
		scanf("%d", &arr[i]);
	printf("Length of lis is %d\n", lis( arr, n ) ); 

	return 0; 
}


================================================
FILE: Algorithms/DP/LIS/LIS.cpp
================================================
#include <bits/stdc++.h>
using namespace std;

/*
Input Format: length of the array and contents of the array
Output Format: length of LIS and contents of the LIS
ALgorithm: Bottom Up Dynamic programming
Time Complexity: O(N^2), where N is the length of the array
Space Complexity: O(N^2)

Sample Input and Output

**Sample Input 1:**

Enter the number of elements of the array: 8

Enter the elements of the array: 1 8 5 9 6 2 4 7

The length of LIS is: 4

The LIS is: 1 5 6 7

**Sample Input 2:**

Enter the number of elements of the array: 10

Enter the elements of the array: 1 2 3 6 5 8 9 4 7 6

The length of LIS is: 6

The LIS is: 1 2 3 6 8 9

Graph contains cycle!
*/

int main()
{

  int n; // number of elements of the array
  cout << "\nEnter the number of elements of the array: ";
  cin >> n;

  vector<int> a(n);

  vector<int> lis(n); // for storing the longest increasing subsequence size of each index

  vector<vector<int>> seq(n); // storing the longest increasing subsequence for each index from 0 to n-1

  cout << "\nEnter the elements of the array: ";
  for (int i = 0; i < n; i++)
  {
    cin >> a[i];
  }

  // initialising the LIS for each index to 1
  for (int i = 0; i < n; i++)
  {
    lis[i] = 1;
  }

  // counting the LIS in bottom up manner dynamic programming
  for (int i = 1; i < n; i++)
  {
    vector<int> tmp;
    for (int j = 0; j < i; j++)
    {
      // if the current LIS value is less that the value we just calculated we have got a new LIS for index i
      if (a[i] > a[j] and lis[i] < lis[j] + 1)
      {
        lis[i] = lis[j] + 1;
        tmp.push_back(a[j]);
      }
    }
    tmp.push_back(a[i]);
    seq[i] = tmp;
  }

  int answerIndex = 0;
  int maxLength = *max_element(lis.begin(), lis.end());
  for (int i = 0; i < n; i++)
  {
    if ((int)seq[i].size() == maxLength)
    {
      answerIndex = i;
      break;
    }
  }
  // printing the LIS and contents of the LIS
  cout << "\nThe length of LIS is: " << maxLength << '\n';
  cout << "\nThe LIS is: ";
  for (auto u : seq[answerIndex])
  {
    cout << u << " ";
  }
  cout << '\n';
}

================================================
FILE: Algorithms/DP/LIS/LIS.go
================================================
package main

import "fmt"

func binarySearch(array []int, l int, r int, key int) int {
	for r-l > 1 {
		center := l + (r-l)/2
		if array[center] >= key {
			r = center
		} else {
			l = center
		}
	}

	return r
}

// LongestIncreasingSubsequence will returned a maximum increasing subsequence inside the input given
// with complexity O(N log N)
func LongestIncreasingSubsequence(input []int) int {
	if len(input) == 0 {
		return 0
	}

	length := 1
	array := make([]int, len(input))
	array[0] = input[0]

	for i := 1; i < len(array); i++ {
		if input[i] < array[0] {
			array[0] = input[i]
		} else if input[i] > array[length-1] {
			array[length] = input[i]
			length++
		} else {
			array[binarySearch(array, -1, length-1, input[i])] = input[i]
		}
	}

	return length
}

func main() {
	input := []int{1, 4, 3, 8, 12, 1, 9, 10, 3, 11, 0, 3}
	output := LongestIncreasingSubsequence(input)

	fmt.Println(output)
}


================================================
FILE: Algorithms/DP/LIS/LIS.java
================================================
/*
Input Format: length of the array and contents of the array
Output Format: length of LIS and contents of the LIS
Sample Input and Output
**Sample Input 1:**
Enter the number of elements of the array: 8
Enter the elements of the array: 1 8 5 9 6 2 4 7
The length of LIS is: 4
The LIS is: 1 5 6 7
**Sample Input 2:**
Enter the number of elements of the array: 10
Enter the elements of the array: 1 2 3 6 5 8 9 4 7 6
The length of LIS is: 6
The LIS is: 1 2 3 6 8 9
Graph contains cycle!
*/


import java.util.*; 

class Main
{
	public static void findLIS(int[] arr)
	{
		// LIS.get(i) stores the longest increasing subsequence of subarray
		List<List<Integer>> LIS = new ArrayList<>();
		for (int i = 0; i < arr.length; i++) {
			LIS.add(new ArrayList<>());
		}

		// LIS[0] denotes longest increasing subsequence ending with arr[0]
		LIS.get(0).add(arr[0]);

	
		for (int i = 1; i < arr.length; i++)
		{

			for (int j = 0; j < i; j++)
			{
				// find longest increasing subsequence that ends with arr[j]
				// where arr[j] is less than the current element arr[i]

				if (arr[j] < arr[i] && LIS.get(j).size() > LIS.get(i).size()) {
					LIS.set(i, new ArrayList<>(LIS.get(j)));
				}
			}

			// include arr[i] in LIS.get(i)
			LIS.get(i).add(arr[i]);
		}

		
		int j = 0;
		for (int i = 0; i < arr.length; i++) {
			if (LIS.get(j).size() < LIS.get(i).size()) {
				j = i;
			}
		}
		
        System.out.print("The length of LIS is:" + (LIS.get(j)).size());
		System.out.print("\n"+"The LIS is:" + LIS.get(j));
	}

	public static void main(String[] args)
	{
		
		Scanner sc = new Scanner(System.in);
		System.out.print("Enter the number of elements of the array:"+"\n");
		int n = sc.nextInt();
	System.out.print("Enter the elements of the array:"+"\n");
        int array[] = new int[n];
        for (int i = 0; i < n; ++i)
        {
            array[i] = sc.nextInt();
        }

		findLIS(array);
		
	}
}


================================================
FILE: Algorithms/DP/LIS/LongestIncreaseSubSequence.cpp
================================================
#include <iostream>
using namespace std;

int lis(int* input, int n) {
	int* output = new int[n];
	output[0] = 1;
	for (int i = 1; i < n; i++) {
		output[i] = 1;
		for (int j = i - 1; j >= 0; j--) {
			if (input[j] > input[i]) {
				continue;
			}
			int possibleAns = output[j] + 1;
			if (possibleAns > output[i]) {
				output[i] = possibleAns;
			}
		}
	}
	int best = 0;
	for (int i = 0; i < n; i++) {
		if (best < output[i]) {
			best = output[i];
		}
	}
	delete [] output;
	return best;
}

int main() {
	int n;
	cin >> n;
	int * input = new int[n];
	for (int i = 0; i < n; i++) {
		cin >> input[i];
	}
	int ans = lis(input, n);
	cout << ans << endl;
	delete [] input;
}

================================================
FILE: Algorithms/DP/LIS/README.md
================================================
## LIS (Longest Increasing Subsequence)

- [LIS C++](LIS.cpp)
- [LIS Java](LIS.java)
- [LIS Python3](lis.py)
- [LIS Go](LIS.go)

---
### [⬆](#toc) <a name='stat'>Problem Statement</a>
Given an array of integers, find the length of the longest (strictly) increasing subsequence 
from the given array along with that print the contents of the LIS

- <h4>Input Format:</h4> length of the array and contents of the array</br>
- <h4>Output Format:</h4> length of LIS and contents of the LIS

---


### [⬆](#toc) <a name='stat'>Sample Input Output</a>

- <h4>Input:</h4> N = 16</br> A[] = 0 8 4 12 2 10 6 14 1 9 5 13 3 11 7 15
- <h4>Output:</h4> The length of LIS is: 6 </br> The LIS is: 0 2 6 9 13 15

---


================================================
FILE: Algorithms/DP/LIS/lis.py
================================================
def lis(arr): 
	n = len(arr) 
	lis = [1]*n
	for i in range (1, n): 
		for j in range(0, i): 
			if arr[i] > arr[j] and lis[i]< lis[j] + 1 : 
				lis[i] = lis[j]+1
	maximum = 0
	for i in range(n): 
		maximum = max(maximum, lis[i]) 

	return maximum 

    
arr = [10, 22, 9, 33, 21, 50, 41, 60] 
print("Length of lis is"+" "+ str(lis(arr)))



================================================
FILE: Algorithms/DP/LSCS/LSCS.c
================================================
#include <stdio.h>
#include <limits.h>

int largest_subarray_sum(int *arr, int size)
{
	if (size <= 0) {
		printf("Size must be a positive integer\n");
		return 1;
	}

	int start = 0, best_start = 0, best_end = 0;
	int sum = 0, best_sum = INT_MIN;

	for (int end = 0; end < size; ++end) {
		if (sum <= 0) {
			start = end;
			sum = arr[end];
		} else {
			sum += arr[end];
		}

		if (sum > best_sum) {
			best_sum = sum;
			best_start = start;
			best_end = end;
		}
	}
	printf("Best sum is %d\nFirst index: %d\nLast index: %d\n",
			best_sum, best_start, best_end);
	
	return 0;
}


================================================
FILE: Algorithms/DP/LSCS/LSCS.cpp
================================================
using namespace std; 
#include<iostream> 
#include<climits> 

int maxSubArraySum(int a[], int size) 
{ 
    int max_so_far = INT_MIN, max_ending_here = 0, 
       start =0, end = 0, s=0; 
  
    for (int i=0; i< size; i++ ) 
    { 
        max_ending_here += a[i]; 
  
        if (max_so_far < max_ending_here) 
        { 
            max_so_far = max_ending_here; 
            start = s; 
            end = i; 
        } 
  
        if (max_ending_here < 0) 
        { 
            max_ending_here = 0; 
            s = i + 1; 
        } 
    } 
    cout << "Maximum contiguous sum is "
        << max_so_far << endl; 
    cout << "Starting index "<< start 
        << endl << "Ending index "<< end << endl; 
} 


================================================
FILE: Algorithms/DP/LSCS/lscs.go
================================================
package main

import "fmt"

func max(x, y int) int {
	if x < y {
		return y
	}
	return x
}

func sol(s1 string, s2 string, n int, m int) int {
	dp := make([][]int, n+1)
	for i := 0; i <= n+1; i++ {
		dp[i] = make([]int, m+1)
	}
	for i := 1; i <= n; i++ {
		for j := 1; j <= m; j++ {
			if s1[i-1] == s2[j-1] {
				dp[i][j] = 1 + dp[i-1][j-1]
			} else {
				dp[i][j] = max(dp[i-1][j], dp[i][j-1])
			}
		}
	}
	return dp[n][m]
}

func main() {
	var t int
	fmt.Scanf("%d", t)
	for _ = 0; t >= 0; t-- {
		var s1, s2 string
		fmt.Scanf("%s", s1)
		fmt.Scanf("%s", s2)

		n, m := len(s1), len(s2)
		raw_res := sol(s1, s2, n, n)
		res := n + m - raw_res
		fmt.Printf("%d\n", res)
	}
}


================================================
FILE: Algorithms/DP/LSCS/lscs.py
================================================
def find_max_subarray(alist, start, end):
    max_ending_at_i = max_seen_so_far = alist[start]
    max_left_at_i = max_left_so_far = start
    max_right_so_far = start + 1
    for i in range(start + 1, end):
        if max_ending_at_i > 0:
            max_ending_at_i += alist[i]
        else:
            max_ending_at_i = alist[i]
            max_left_at_i = i
        if max_ending_at_i > max_seen_so_fa
Download .txt
gitextract_qpjjgosa/

├── .github/
│   ├── ISSUE_TEMPLATE/
│   │   ├── Documentation.yml
│   │   ├── New-Submission.yml
│   │   └── config.yml
│   ├── pull_request_template.md
│   └── workflows/
│       ├── contributors.yml
│       └── welcome.yml
├── 404.md
├── Algorithms/
│   ├── Array/
│   │   ├── Arr4 right shift.c
│   │   ├── InsertArray.c
│   │   ├── LinearSearch.java
│   │   ├── Merge-Sorted-Array.c
│   │   ├── Merge-Sorted-Array.cpp
│   │   ├── Merge-Sorted-Array.js
│   │   ├── Merge-Sorted-Array.py
│   │   ├── Merge_Sorted_Arrays.rb
│   │   ├── Rearrange-High-Low.js
│   │   ├── Rearrange-High-Low.kt
│   │   ├── Remove-Dublicate.js
│   │   ├── Remove-Duplicates-from-Sorted-Array.c
│   │   ├── Remove-Duplicates-from-Sorted-Array.cpp
│   │   ├── Shuffle.c
│   │   ├── Two-Arrays-And-Swaps.c
│   │   ├── check_two_equal_array.cpp
│   │   ├── copyarray.c
│   │   ├── counting_frequency_of_char_in_string.c
│   │   ├── findpos.py
│   │   ├── high-low-rearrangement.c
│   │   ├── high-low-rearrangement.c++
│   │   ├── high-low-rearrangement.py
│   │   ├── largest-smallest-number-and-sum-of-all-elements-in-array.java
│   │   ├── merge-sorted-arrays-algo-only.py
│   │   ├── merge_without_extraspace.cpp
│   │   ├── merging_2_arrays.c
│   │   ├── rearrange-high-low.java
│   │   ├── revering_array.c
│   │   ├── rotate_matrix_90degree.cpp
│   │   ├── rotated_sorted_array_search.cpp
│   │   ├── twoSum.cpp
│   │   ├── twoSum.kt
│   │   └── wave_form_array
│   ├── Backtracking/
│   │   ├── Crossword/
│   │   │   └── Crossword.cpp
│   │   ├── Nqueen/
│   │   │   ├── N_Queen.java
│   │   │   ├── Nqueens.c
│   │   │   ├── Nqueens.cpp
│   │   │   ├── Nqueens_optimized.cpp
│   │   │   ├── nqueen.cpp
│   │   │   └── nqueens.py
│   │   ├── Permutation/
│   │   │   ├── Permutations.c
│   │   │   ├── permutation.py
│   │   │   ├── permutations.cpp
│   │   │   └── permutations.js
│   │   ├── README.md
│   │   └── Rat-In-A-Maze/
│   │       └── Rat-In-A-Maze.cpp
│   ├── Cryptography/
│   │   ├── AES_Cipher/
│   │   │   ├── AES_Cipher.py
│   │   │   └── README.md
│   │   ├── Affine_Cipher/
│   │   │   ├── Affine_Cipher.cpp
│   │   │   ├── Affine_Cipher.py
│   │   │   ├── README.md
│   │   │   └── affine_cipher.c
│   │   ├── Bifid_Cipher/
│   │   │   ├── Bifid_Cipher.py
│   │   │   └── README.md
│   │   ├── CIA_Triad_Ciper/
│   │   │   └── README.md
│   │   ├── Caesar_Cipher/
│   │   │   ├── Caesar Cypher.cpp
│   │   │   ├── Caesar Cypher.py
│   │   │   ├── CaesarCipher.java
│   │   │   ├── Caesar_Cipher.c
│   │   │   ├── Caesar_Cipher.cs
│   │   │   ├── Caesar_Cipher.js
│   │   │   ├── Caesar_Cipher.php
│   │   │   ├── Caesar_Cypher.rb
│   │   │   └── README.md
│   │   ├── README.md
│   │   ├── RSA_Cipher/
│   │   │   ├── README.md
│   │   │   ├── RSA_Cipher.py
│   │   │   ├── RSA_cipher.cpp
│   │   │   └── RSA_cipher.java
│   │   ├── Shamir_Cipher/
│   │   │   ├── Shamir_Cipher.c
│   │   │   └── Shamir_Cipher.cpp
│   │   ├── Vernam_Cipher/
│   │   │   ├── README.md
│   │   │   ├── Vernam_Cipher.cpp
│   │   │   ├── Vernam_Cipher.js
│   │   │   └── Vernam_Cipher.py
│   │   └── Vigenere_Cipher/
│   │       ├── README.md
│   │       ├── Vigenere_Cipher.cpp
│   │       ├── Vigenere_Cipher.py
│   │       ├── Vignere_Cipher.cs
│   │       └── vigenereCipher.py
│   ├── DP/
│   │   ├── 0-1_Knapsack_Problem/
│   │   │   ├── 0-1 Knapsack Problem.java
│   │   │   ├── Branch_And_Bound/
│   │   │   │   └── 0-1_knapsack.cpp
│   │   │   ├── knapsackProblem.java
│   │   │   ├── knapsack_problem_0_1.cpp
│   │   │   └── knapsack_problem_0_1.py
│   │   ├── AdjacentBitCounts.cpp
│   │   ├── AdjacentBitCounts.js
│   │   ├── Bitmask DP/
│   │   │   └── TravellingSalesman.cpp
│   │   ├── Branch_And_Bound/
│   │   │   ├── 0_1_KnapSack.py
│   │   │   └── Knapsack_Branch_and_Bound.java
│   │   ├── Count_Square_Matrices.cpp
│   │   ├── Count_Square_Matrices.py
│   │   ├── Edit_Distance/
│   │   │   ├── Edit_Distance.js
│   │   │   ├── Edit_distance.cpp
│   │   │   ├── README.md
│   │   │   └── edit_distance.py
│   │   ├── Egg_Drop/
│   │   │   ├── Egg_Drop.cpp
│   │   │   ├── Egg_Drop.cs
│   │   │   ├── egg drop.java
│   │   │   ├── egg_drop.py
│   │   │   └── egg_drop.ts
│   │   ├── Fibonacci_Series/
│   │   │   ├── Fibonacci.c
│   │   │   ├── Fibonacci.php
│   │   │   ├── fibonacci.go
│   │   │   ├── fibonacci.js
│   │   │   └── fibonacci.py
│   │   ├── Gauss_Easter_Date/
│   │   │   ├── CalculateEasterDate.java
│   │   │   ├── Gauss_Easter_Date.cpp
│   │   │   ├── Gauss_Easter_Date.php
│   │   │   ├── Gauss_Easter_Date.py
│   │   │   ├── Gauss_Easter_Date.rb
│   │   │   ├── easterDate.cpp
│   │   │   ├── easterDate.go
│   │   │   ├── easterDate.java
│   │   │   └── easterDate.js
│   │   ├── Generate_ATM_Codes.py
│   │   ├── Gold_Mine_Problem/
│   │   │   ├── goldmine.java
│   │   │   └── goldmine.py
│   │   ├── Golomb_Sequence/
│   │   │   ├── Golomb Sequence.cpp
│   │   │   ├── Golomb.cpp
│   │   │   ├── Golomb.java
│   │   │   └── golomb.py
│   │   ├── Knight_Probability/
│   │   │   ├── Knight_Probability_in_a_ChessBoard.cpp
│   │   │   └── Problem_Statement.md
│   │   ├── LCS/
│   │   │   ├── LCS_of_three_strings.py
│   │   │   ├── LongestCommonSubsequence.cpp
│   │   │   ├── LongestCommonSubsequenceLength.java
│   │   │   ├── Longest_Common_Subsequence_of_Three_String.java
│   │   │   ├── Longest_Common_Subsequence_of_Two_Sequences.c
│   │   │   ├── Longest_Common_Subsequence_of_Two_Sequences.cpp
│   │   │   ├── lcs.py
│   │   │   └── lcs_of_3_strings.cpp
│   │   ├── LIS/
│   │   │   ├── LIS.c
│   │   │   ├── LIS.cpp
│   │   │   ├── LIS.go
│   │   │   ├── LIS.java
│   │   │   ├── LongestIncreaseSubSequence.cpp
│   │   │   ├── README.md
│   │   │   └── lis.py
│   │   ├── LSCS/
│   │   │   ├── LSCS.c
│   │   │   ├── LSCS.cpp
│   │   │   ├── lscs.go
│   │   │   ├── lscs.py
│   │   │   └── shortest_common_supersequence.c
│   │   ├── Largest Divisible Subset.cpp
│   │   ├── Largest divisible subset in array/
│   │   │   └── file.py
│   │   ├── Largest_Divisible_Subset.js
│   │   ├── Largest_Divisible_Subsets.java
│   │   ├── Largest_Divisible_Subsets.py
│   │   ├── Largest_Sum_Contiguous_Subarray/
│   │   │   ├── .vscode/
│   │   │   │   ├── c_cpp_properties.json
│   │   │   │   ├── launch.json
│   │   │   │   └── tasks.json
│   │   │   ├── C++_Implementation/
│   │   │   │   ├── Kadane
│   │   │   │   ├── makefile
│   │   │   │   ├── obj/
│   │   │   │   │   ├── functions.o
│   │   │   │   │   └── main.o
│   │   │   │   └── src/
│   │   │   │       ├── functions.cpp
│   │   │   │       ├── include/
│   │   │   │       │   └── functions.h
│   │   │   │       └── main.cpp
│   │   │   ├── Kadane's Algorithm.cpp
│   │   │   ├── LSCS.cpp
│   │   │   ├── LSCS.js
│   │   │   ├── LSCS.swift
│   │   │   └── lscs.c
│   │   ├── MOS_Algorithm.cpp
│   │   ├── Max_Product_Subarray/
│   │   │   └── max_product_subarray.py
│   │   ├── Maximum_Achievable_Coins/
│   │   │   ├── Maximum_Achievable_Coins.php
│   │   │   ├── Maximum_Achievable_coins.c
│   │   │   ├── Maximum_Achievable_coins.java
│   │   │   ├── Maximum_Achievable_coins.py
│   │   │   └── maximum_achievable_coins.cpp
│   │   ├── Minimum_Sum_Descent/
│   │   │   ├── min-sum.c
│   │   │   ├── minsum.cs
│   │   │   ├── minsum.go
│   │   │   └── minsum.ts
│   │   ├── Partition_Sum/
│   │   │   ├── DP_PartitionSum.java
│   │   │   ├── partition_sum.c
│   │   │   ├── partition_sum.cpp
│   │   │   ├── partition_sum.cs
│   │   │   └── partition_sum.php
│   │   ├── README.md
│   │   ├── Recaman's Sequence.c
│   │   ├── Scramble Strings/
│   │   │   └── ScrambleString.cpp
│   │   ├── Shortest_Common_Supersequence/
│   │   │   ├── shortest_common_sequence.java
│   │   │   ├── shortest_common_supersequence.cpp
│   │   │   ├── shortest_common_supersequence.cs
│   │   │   ├── shortest_common_supersequence.js
│   │   │   └── shortest_common_supersequence.py
│   │   ├── Sudoku_Solver/
│   │   │   ├── README.md
│   │   │   ├── SudokuSolver.java
│   │   │   ├── SudokuSolver.py
│   │   │   ├── Sudoku_Solver.cpp
│   │   │   ├── Sudoku_Solver.cs
│   │   │   └── Sudoku_Solver.js
│   │   ├── Target_Sum/
│   │   │   ├── Target_Sum.c
│   │   │   ├── Target_Sum.cpp
│   │   │   ├── Target_Sum.java
│   │   │   ├── Target_Sum.js
│   │   │   └── Target_Sum.py
│   │   ├── Tower_Of_Hanoi/
│   │   │   ├── README.md
│   │   │   ├── TOH.java
│   │   │   ├── Tower_Of_Hanoi.cs
│   │   │   ├── Tower_Of_Hanoi.js
│   │   │   ├── Tower_of_hanoi.ts
│   │   │   ├── tower_of_hanoi.c
│   │   │   ├── tower_of_hanoi.cpp
│   │   │   ├── tower_of_hanoi.go
│   │   │   └── tower_of_hanoi.py
│   │   ├── TrappingWater/
│   │   │   └── TrappingWater.cpp
│   │   ├── Water_Area/
│   │   │   ├── QUESTION.md
│   │   │   ├── Water-area.py
│   │   │   └── water_area.rb
│   │   ├── Z_Algorithm/
│   │   │   ├── README.md
│   │   │   ├── Z-Algorithm.c++
│   │   │   └── Z_Algo.py
│   │   ├── creating an string input function in C.c
│   │   ├── partition_sum.py
│   │   └── rod-cutting-problem.cpp
│   ├── Graph/
│   │   ├── A_Star/
│   │   │   ├── A_star.cpp
│   │   │   ├── A_star.cs
│   │   │   ├── A_star.py
│   │   │   ├── A_star.ts
│   │   │   └── astar.py
│   │   ├── BFS/
│   │   │   ├── BFS.c
│   │   │   ├── BFS.cpp
│   │   │   ├── BFS.go
│   │   │   ├── BFS.java
│   │   │   ├── BFS.py
│   │   │   ├── BFS.rb
│   │   │   ├── README.md
│   │   │   └── bfs.js
│   │   ├── Bellman_Ford/
│   │   │   ├── BellMan_Ford.py
│   │   │   ├── README.md
│   │   │   ├── bellmanFord.cpp
│   │   │   └── bellman_ford.c
│   │   ├── Bidirectional_search/
│   │   │   ├── Bidirectional_Search.py
│   │   │   └── Bidirectional_search.cpp
│   │   ├── Bidirectional_search_algo.py
│   │   ├── DFS/
│   │   │   ├── DFS.cpp
│   │   │   ├── DFS.java
│   │   │   ├── Depth First Search[DFS].cpp
│   │   │   ├── README.md
│   │   │   ├── dfs.js
│   │   │   └── dfs.py
│   │   ├── DSU/
│   │   │   ├── dsu.cpp
│   │   │   └── dsu.py
│   │   ├── Depth First Transversal/
│   │   │   └── DFT.py
│   │   ├── Dijkstra/
│   │   │   ├── Dijikstra.java
│   │   │   ├── Dijkstra.c
│   │   │   ├── Dijkstra.cpp
│   │   │   ├── Dijkstra.cs
│   │   │   ├── Dijkstra.go
│   │   │   ├── Dijkstra.js
│   │   │   ├── Dijkstra.php
│   │   │   ├── README.md
│   │   │   ├── dijkstra_leftist_heap/
│   │   │   │   ├── README.txt
│   │   │   │   ├── WDGraph.cpp
│   │   │   │   ├── WDGraph.h
│   │   │   │   ├── dijkstra.cpp
│   │   │   │   ├── leftistHeap.cpp
│   │   │   │   └── leftistHeap.h
│   │   │   └── djikstra.py
│   │   ├── Flood_Fill/
│   │   │   ├── Flood_Fill.cpp
│   │   │   ├── Flood_Fill.java
│   │   │   ├── Flood_Fill.js
│   │   │   └── flood_fill_algorithm.cs
│   │   ├── Floyd_Warshall/
│   │   │   ├── Floyd_Warshall.c
│   │   │   ├── Floyd_Warshall.cpp
│   │   │   ├── Floyd_Warshall.java
│   │   │   ├── Floyd_Warshall.py
│   │   │   └── README.md
│   │   ├── Hopcroft_Karp/
│   │   │   └── Hopcroft_Karp_algorithm.cpp
│   │   ├── Hungarian_algorithm/
│   │   │   └── Hungarian_algorithm.cpp
│   │   ├── Johnson_algorithm/
│   │   │   └── Johnson_algorithm.cpp
│   │   ├── Karger_algorithm/
│   │   │   ├── Karger_algorithm.cpp
│   │   │   └── sample.txt
│   │   ├── Kosarajus_Algorithm/
│   │   │   ├── kosajaru.rs
│   │   │   ├── kosaraju.ts
│   │   │   └── kosaraju_algorithm_strongly_connected_components.cpp
│   │   ├── Kruskal's_MST/
│   │   │   ├── KruskalMST.c
│   │   │   ├── Kruskal_Algorithm.cpp
│   │   │   ├── README.md
│   │   │   ├── cpp/
│   │   │   │   └── kruskal.cpp
│   │   │   ├── python/
│   │   │   │   └── KruskalMST.py
│   │   │   └── rust/
│   │   │       └── kruskal.rs
│   │   ├── LIS/
│   │   │   └── README.md
│   │   ├── Level order traversal.cpp
│   │   ├── Lowest_Common_Manager/
│   │   │   ├── Lowest_Common_Manager.py
│   │   │   └── QUESTION.md
│   │   ├── Prim's_MST/
│   │   │   ├── Prim's_MST.py
│   │   │   ├── Prims_MST.java
│   │   │   └── README.md
│   │   ├── README.md
│   │   ├── Tarjan's Algorithm/
│   │   │   └── StronglyConnectedComponents.cpp
│   │   ├── Topological Sort/
│   │   │   ├── QUESTION.md
│   │   │   └── topo_sort.py
│   │   ├── Topological sort/
│   │   │   ├── README.md
│   │   │   └── Topological_sort.cpp
│   │   ├── Youngest_Common_Ancestor/
│   │   │   ├── QUESTION.md
│   │   │   ├── YoungerCommonAncestor.cpp
│   │   │   ├── YoungestCommonAncestor.java
│   │   │   └── youngest-comm-anc.py
│   │   ├── articulation_points.py
│   │   ├── flood_fill.py
│   │   ├── lagrange_interpolation.cpp
│   │   ├── lowest_common_manager/
│   │   │   └── lowest_common_manager.java
│   │   └── newton_raphson_method.c
│   ├── Hashing/
│   │   ├── Amicable/
│   │   │   ├── Amicable_Number.rb
│   │   │   ├── Amicable_Numbers..c
│   │   │   ├── Amicable_Numbers.cpp
│   │   │   ├── Amicable_Numbers.java
│   │   │   ├── amicable.cs
│   │   │   ├── amicable.js
│   │   │   ├── amicable.swift
│   │   │   ├── amicable_numbers.php
│   │   │   └── amicable_numbers.py
│   │   ├── Brick_Wall/
│   │   │   ├── Brick_wall.cpp
│   │   │   └── QUESTION.md
│   │   ├── Chaining/
│   │   │   └── chainingHashing.cpp
│   │   ├── Cuckoo_Hashing/
│   │   │   ├── Cuckoo_Hashing.cpp
│   │   │   └── Cuckoo_Hashing.java
│   │   ├── Divisible_Pair_Count/
│   │   │   ├── DivisiblePairCount.c
│   │   │   ├── DivisiblePairCount.go
│   │   │   ├── DivisiblePairCount.java
│   │   │   ├── DivisiblePairCount.js
│   │   │   ├── DivisiblePairCount.py
│   │   │   └── DivsiblePairCount.cpp
│   │   ├── Group_Anagrams/
│   │   │   ├── Group_Anagrams.cpp
│   │   │   ├── QUESTIONS.md
│   │   │   ├── group_anagrams.js
│   │   │   └── group_anagrams.py
│   │   ├── Open Addressing/
│   │   │   ├── doubleHashHashingTable.cpp
│   │   │   ├── linearProbingHashTable.cpp
│   │   │   └── quadraticProbingHashTable.cpp
│   │   └── Recaman_Sequence/
│   │       ├── Recamans_Sequence.java
│   │       ├── Recamans_Sequence.ts
│   │       ├── recaman.py
│   │       ├── recaman_sequence.cpp
│   │       └── recamans_sequence.cs
│   ├── Heap/
│   │   └── README.md
│   ├── LinkedList/
│   │   └── Floyd_Cylce_detection/
│   │       ├── floyd_cycle_detection.cpp
│   │       ├── floyd_cycle_detection.java
│   │       ├── floyd_cycle_detection.kt
│   │       ├── floyd_cycle_detection.py
│   │       └── floyd_cycle_detection.swift
│   ├── Matrix/
│   │   ├── README.md
│   │   └── Spiral-Matrix/
│   │       └── Spiral-Matrix.cpp
│   ├── Merging-Interval/
│   │   ├── #999 merging_intervals.py
│   │   ├── Merging_Intervals.java
│   │   ├── README.md
│   │   ├── merge_intervals.cpp
│   │   └── merge_intervals.js
│   ├── Pattern-Searching/
│   │   ├── Aho-Corasick/
│   │   │   └── Readme.md
│   │   ├── Binary_Search/
│   │   │   └── search_in_2D_matrix.java
│   │   ├── README.md
│   │   └── Substring_Check/
│   │       └── search.php
│   ├── Queue/
│   │   ├── first_negative_integer_in_window.cpp
│   │   ├── first_nonrepeating_char_in_stream.cpp
│   │   └── reversing a queue.cpp
│   ├── README.md
│   ├── Recursion/
│   │   ├── All_Subsets.c
│   │   ├── Combination_Sum/
│   │   │   ├── Combination_Sum.php
│   │   │   └── combination_sum.cpp
│   │   ├── Factorial/
│   │   │   ├── Factorial.c
│   │   │   ├── Factorial.cs
│   │   │   ├── Factorial.go
│   │   │   ├── Factorial_Algorithm.cpp
│   │   │   ├── Factorial_Algorithm.py
│   │   │   ├── factorial.js
│   │   │   └── factorial.py
│   │   ├── Josephus/
│   │   │   ├── Josephus.c
│   │   │   ├── Josephus.cs
│   │   │   ├── Josephus.java
│   │   │   ├── josephus.cpp
│   │   │   └── josephus.kt
│   │   ├── Keypadcodes.cpp
│   │   ├── Permutation/
│   │   │   ├── Permutation.cs
│   │   │   ├── Permutation.js
│   │   │   ├── Permutation.ts
│   │   │   ├── Permutations_Recursion.cpp
│   │   │   └── Permutations_Recursion.py
│   │   └── README.md
│   ├── Searching/
│   │   ├── A-Star Search/
│   │   │   ├── A_Star.ipynb
│   │   │   └── README.md
│   │   ├── Binary-Search/
│   │   │   ├── Binary_Search_CubicRoot.cpp
│   │   │   ├── Binary_search_javascript.js
│   │   │   ├── Koko_Eating_Bananas/
│   │   │   │   ├── KEB.java
│   │   │   │   ├── Koko_Eating_Bananas.cpp
│   │   │   │   ├── Koko_Eating_Bananas.py
│   │   │   │   └── QUESTION.md
│   │   │   ├── README.md
│   │   │   ├── Rotated-Sorted-Array-Search.cs
│   │   │   ├── Rotated-Sorted-Array-Search.js
│   │   │   ├── Rotated-Sorted-Array-Search.py
│   │   │   ├── binarySearch.c
│   │   │   ├── binarySearch.cpp
│   │   │   ├── binarySearch.js
│   │   │   ├── binarySearch.kt
│   │   │   ├── binarySearch.scala
│   │   │   ├── binary_search.cpp
│   │   │   ├── binary_search.java
│   │   │   ├── binarysearch.java
│   │   │   ├── binarysearch.js
│   │   │   ├── binarysearch.php
│   │   │   ├── binarysearch.py
│   │   │   ├── binarysearch.sh
│   │   │   ├── matrix_binary_search.py
│   │   │   └── search_in_2d_matrix.cpp
│   │   ├── Exponential-Search/
│   │   │   ├── exponential_search.cpp
│   │   │   ├── exponential_search.php
│   │   │   └── exponential_search.py
│   │   ├── Fibonacci-Search/
│   │   │   ├── Fibonacci_Search.cpp
│   │   │   ├── Fibonacci_search.java
│   │   │   ├── Fibonacci_search.php
│   │   │   ├── Fibonacci_search_in_C.c
│   │   │   ├── fibonacciSearch.py
│   │   │   ├── fibonacci_search.c
│   │   │   └── fibonacci_search.js
│   │   ├── Interpolation-Search/
│   │   │   ├── IS.cpp
│   │   │   └── IS.py
│   │   ├── Jump-Search/
│   │   │   ├── JumpSearch.java
│   │   │   ├── Jump_Search.cpp
│   │   │   ├── jumpSearch.cs
│   │   │   ├── jumpSearch.go
│   │   │   ├── jumpSearch.js
│   │   │   ├── jumpSearch.ts
│   │   │   └── jump_search.py
│   │   ├── Linear-Search/
│   │   │   ├── LINEAR_SEARH.cpp
│   │   │   ├── LinearSearch.js
│   │   │   ├── Linear_Search.cpp
│   │   │   ├── Linear_Search.go
│   │   │   ├── Linear_Search.py
│   │   │   ├── Linearsearch.c
│   │   │   ├── README.md
│   │   │   ├── linear_search.java
│   │   │   └── linear_search.sh
│   │   ├── README.md
│   │   ├── Sublist-Search/
│   │   │   ├── Sublist_Search.php
│   │   │   ├── sublist_search.cpp
│   │   │   ├── sublist_search.cs
│   │   │   ├── sublist_search.java
│   │   │   ├── sublist_search.js
│   │   │   └── sublist_search.py
│   │   ├── Ternary-Search/
│   │   │   ├── README.md
│   │   │   ├── Ternary-String.c
│   │   │   ├── ternarySearch.cpp
│   │   │   ├── unimodal_func.cpp
│   │   │   ├── unimodal_func.java
│   │   │   ├── unimodal_func.js
│   │   │   └── unimodal_func.py
│   │   └── Trie-Search/
│   │       ├── Trie Data Structure.cpp
│   │       ├── Trie1_HashMap.java
│   │       ├── TrieDataStructure.java
│   │       ├── Trie_Search.cpp
│   │       ├── Trie_Search.go
│   │       └── Trie_Search.py
│   ├── Sorting/
│   │   ├── 3-Way_Quick_Sort/
│   │   │   ├── 3-Way_Quick_Sort.cpp
│   │   │   ├── 3-Way_Quick_Sort.cs
│   │   │   ├── 3-Way_Quick_Sort.java
│   │   │   └── 3_Way_Quick_Sort.c
│   │   ├── Bead_Sort/
│   │   │   ├── Bead_Sort.php
│   │   │   ├── Bead_Sort.rb
│   │   │   ├── Bead_sort.cpp
│   │   │   ├── README.md
│   │   │   └── bead_sort.py
│   │   ├── Binary_Insertion_Sort/
│   │   │   ├── Binary Insertion Sort.c
│   │   │   ├── Binary_Insertion_Sort.cpp
│   │   │   ├── Binary_Insertion_Sort.py
│   │   │   └── Readme.md
│   │   ├── Bitonic_Search/
│   │   │   ├── BitonicSort.java
│   │   │   ├── Bitonic_sort.c
│   │   │   ├── Readme.md
│   │   │   └── bitonic_search.py
│   │   ├── Brick_Sort/
│   │   │   ├── BrickSort.js
│   │   │   ├── Brick_Sort.c
│   │   │   ├── Readme.md
│   │   │   └── brickSort.py
│   │   ├── Bubble_Sort/
│   │   │   ├── BubbleSort.js
│   │   │   ├── BubbleSort.scala
│   │   │   ├── Bubble_Sort.c
│   │   │   ├── Bubble_Sort.cs
│   │   │   ├── Bubble_Sort.py
│   │   │   ├── Bubble_sort_optimised.cpp
│   │   │   ├── bubbleSort.cpp
│   │   │   ├── bubble_sort.java
│   │   │   ├── bubble_sort.sh
│   │   │   └── readme.md
│   │   ├── Bucket_Sort/
│   │   │   ├── BucketSort.c
│   │   │   ├── BucketSort.java
│   │   │   ├── BucketSort.js
│   │   │   ├── BucketSort.py
│   │   │   ├── README.md
│   │   │   ├── bucket_sort.cpp
│   │   │   ├── bucketsort.php
│   │   │   ├── bucketsort.rb
│   │   │   └── bucketsortinC.c
│   │   ├── Circle_Sort/
│   │   │   ├── Circle_Sort.c
│   │   │   ├── Circle_Sort.cs
│   │   │   ├── Circle_Sort.java
│   │   │   ├── Circle_Sort.rb
│   │   │   └── README.md
│   │   ├── Cocktail_Sort/
│   │   │   ├── Cocktail_Sort.c
│   │   │   ├── Cocktail_Sort.cpp
│   │   │   ├── Cocktail_Sort.java
│   │   │   ├── Cocktail_Sort.py
│   │   │   ├── README.md
│   │   │   └── cocktail_sort.js
│   │   ├── Comb_Sort/
│   │   │   ├── Comb_Sort.c
│   │   │   ├── Comb_Sort.cpp
│   │   │   ├── README.md
│   │   │   ├── comb.py
│   │   │   └── comb_sort.rb
│   │   ├── Counting_Sort/
│   │   │   ├── Count_sort.py
│   │   │   ├── Counting_Sort.c
│   │   │   ├── Counting_Sort.cs
│   │   │   ├── Counting_Sort.java
│   │   │   ├── Counting_sort.js
│   │   │   ├── README.md
│   │   │   ├── counting_sort.py
│   │   │   └── countingsort.py
│   │   ├── Cycle_Sort/
│   │   │   ├── CYCLESort.cs
│   │   │   ├── Cyclesort.py
│   │   │   ├── README.md
│   │   │   ├── cyclesort.c
│   │   │   └── stoogesort.java
│   │   ├── Gnome_Sort/
│   │   │   ├── Gnome_Sort.cs
│   │   │   ├── Gnome_Sort.java
│   │   │   ├── Gnome_Sort.php
│   │   │   ├── Gnome_Sort.py
│   │   │   └── gnomeSort.java
│   │   ├── Heap_Sort/
│   │   │   ├── Heap_Sort.js
│   │   │   ├── Heap_Sort.swift
│   │   │   ├── Max_heap_sort.cpp
│   │   │   ├── README.md
│   │   │   ├── heap-sort.c
│   │   │   ├── heap-sort.php
│   │   │   ├── heap-sort.py
│   │   │   ├── heap-sort.rb
│   │   │   ├── heap_sort.cpp
│   │   │   ├── heap_sort.go
│   │   │   ├── heap_sort.java
│   │   │   └── heapsorting.py
│   │   ├── Insertion_Sort/
│   │   │   ├── InsertSort.py
│   │   │   ├── Insertion Sort.cpp
│   │   │   ├── InsertionSort.java
│   │   │   ├── InsertionSort.py
│   │   │   ├── InsertionSort.scala
│   │   │   ├── Insertion_Sort.cpp
│   │   │   ├── Insertion_Sort.swift
│   │   │   ├── Insertion_sort_2.cpp
│   │   │   ├── README.md
│   │   │   ├── insertion_sort.py
│   │   │   └── insertion_sort.ts
│   │   ├── Merge_Sort/
│   │   │   ├── Application of Merge Sort/
│   │   │   │   ├── Count_Inversions.c
│   │   │   │   └── Count_Inversions.cpp
│   │   │   ├── MERGE_SORT.c
│   │   │   ├── MERGE_SORT.cpp
│   │   │   ├── MERGE_SORT.java
│   │   │   ├── MERGE_SORT.js
│   │   │   ├── MergeSort.scala
│   │   │   ├── Non_recursive_merge_sort.cpp
│   │   │   ├── README.md
│   │   │   ├── mergeSort.py
│   │   │   ├── merge_Sort.rb
│   │   │   ├── mergesort.sh
│   │   │   ├── non_recursive_merge_sort.c
│   │   │   ├── non_recursive_merge_sort.cs
│   │   │   └── non_recursive_merge_sort.py
│   │   ├── Merge_Sort_on_Doubly_Linked_List/
│   │   │   ├── Mergesort_doubly.c
│   │   │   ├── Mergesort_doubly.cpp
│   │   │   ├── Mergesort_doubly.java
│   │   │   └── Mergesort_doubly.py
│   │   ├── Pancake_Sort/
│   │   │   ├── PancakeSort.java
│   │   │   ├── Pancake_Sort.c
│   │   │   ├── Pancake_Sort.c++
│   │   │   ├── Pancake_Sort.cs
│   │   │   ├── Pancake_Sort.js
│   │   │   ├── Pancake_Sort.py
│   │   │   ├── Pancake_Sort.rb
│   │   │   └── README.md
│   │   ├── Patience_Sort/
│   │   │   ├── PatienceSort.cs
│   │   │   ├── Patience_sort.cpp
│   │   │   └── README.md
│   │   ├── Patience_sort.py
│   │   ├── Pigeonhole_Sort/
│   │   │   ├── PigeonholeSort.cpp
│   │   │   ├── PigeonholeSort.ts
│   │   │   ├── Pigeonhole_Sort.c
│   │   │   ├── Pigeonhole_Sort.java
│   │   │   └── pigeonhole.py
│   │   ├── Quick_Select/
│   │   │   ├── QuickSelect.cpp
│   │   │   ├── Quick_Select.js
│   │   │   ├── Quick_Select.php
│   │   │   ├── Quick_select.py
│   │   │   ├── README.md
│   │   │   ├── quick_select.java
│   │   │   └── quick_select.rb
│   │   ├── Quick_Sort/
│   │   │   ├── QuickSort.java
│   │   │   ├── QuickSort.js
│   │   │   ├── QuickSort.py
│   │   │   ├── Quick_Sort.cpp
│   │   │   ├── Quick_Sort.go
│   │   │   ├── Quick_Sort.sh
│   │   │   ├── README.md
│   │   │   ├── quicksort.C
│   │   │   └── quicksort.c
│   │   ├── README.md
│   │   ├── Radix_Sort/
│   │   │   ├── README.md
│   │   │   ├── Radix Sort With C (Mayukh Mitra)/
│   │   │   │   ├── Radix_sort.c
│   │   │   │   └── r
│   │   │   ├── RadixSort.java
│   │   │   ├── RadixSort.py
│   │   │   ├── Radix_Sort.js
│   │   │   ├── Radix_Sort.rb
│   │   │   ├── Radix_sort.cs
│   │   │   ├── radixSort.php
│   │   │   └── radixsort.cpp
│   │   ├── Selection_Algorithms.cpp
│   │   ├── Selection_Sort/
│   │   │   ├── README.md
│   │   │   ├── Selection Sort.py
│   │   │   ├── SelectionSort.java
│   │   │   ├── SelectionSort.py
│   │   │   ├── SelectionSort.scala
│   │   │   ├── Selection_Sort.cpp
│   │   │   ├── Selection_Sort.go
│   │   │   ├── selection sort.cs
│   │   │   ├── selection_sort.c
│   │   │   └── selection_sort.rb
│   │   ├── Shell_Sort/
│   │   │   ├── README.md
│   │   │   ├── Shell_Sort.c
│   │   │   ├── Shell_Sort.cpp
│   │   │   ├── Shell_Sort.cs
│   │   │   ├── Shell_Sort.java
│   │   │   ├── Shell_Sort.js
│   │   │   ├── Shell_Sort.swift
│   │   │   ├── shell_sort.py
│   │   │   └── shell_sort.sh
│   │   ├── Stooge_Sort/
│   │   │   ├── README.md
│   │   │   ├── Stooge_Sort.cs
│   │   │   ├── Stooge_Sort.go
│   │   │   └── Stooge_Sort.py
│   │   ├── Strand_Sort/
│   │   │   ├── README.md
│   │   │   ├── Strand_Sort.cpp
│   │   │   ├── Strand_sort.java
│   │   │   ├── strand_sort.c
│   │   │   └── strand_sort.ts
│   │   ├── Tim_Sort/
│   │   │   ├── README.md
│   │   │   ├── Tim_Sort.c
│   │   │   ├── Tim_Sort.java
│   │   │   └── Tim_Sort.py
│   │   ├── Topological_Sort/
│   │   │   ├── README.md
│   │   │   ├── Topological_Sort.cpp
│   │   │   ├── Topological_sort.cs
│   │   │   └── Topological_sort.py
│   │   ├── Tree_Sort/
│   │   │   ├── README.md
│   │   │   ├── Tree_Sort.c
│   │   │   ├── tree sort.cpp
│   │   │   └── treesort.java
│   │   └── Wave_Sort/
│   │       ├── Wave_Sort.py
│   │       ├── wave_sort.c
│   │       └── wave_sort.cpp
│   ├── Stack-Algorithm/
│   │   ├── Next_Greater_Element.cpp
│   │   ├── RemoveKDigitsToGetSmallestPossibleInteger.java
│   │   ├── Simplify-Path/
│   │   │   ├── QUESTION.md
│   │   │   └── Simplify_Path.cpp
│   │   ├── balanced_brackets_stack.cpp
│   │   ├── immediate_smaller_element.cpp
│   │   └── longest_valid_substring.cpp
│   ├── String/
│   │   ├── Anagram/
│   │   │   ├── AnagramChecker.c
│   │   │   ├── anagram c#.cs
│   │   │   ├── anagram.c
│   │   │   ├── anagram.java
│   │   │   ├── anagram.py
│   │   │   ├── anagram.swift
│   │   │   └── anagrams.sh
│   │   ├── Isomorphic/
│   │   │   ├── Isomorphic-String.java
│   │   │   └── isomorphic.cpp
│   │   ├── KMP/
│   │   │   ├── KMP_Algorithm.php
│   │   │   ├── kmp.cpp
│   │   │   └── kmp.js
│   │   ├── LCS/
│   │   │   ├── LCS.py
│   │   │   └── lcs.cpp
│   │   ├── LPS/
│   │   │   ├── longest_palindromic_substring.c
│   │   │   ├── longest_palindromic_substring.cpp
│   │   │   ├── longest_palindromic_substring.java
│   │   │   ├── longest_palindromic_substring.js
│   │   │   ├── longest_palindromic_substring.py
│   │   │   └── longest_palindromic_substring.rb
│   │   ├── Palindrome/
│   │   │   ├── Palindrome.c
│   │   │   ├── Palindrome.cs
│   │   │   ├── Palindrome.java
│   │   │   ├── isPalindrome.cpp
│   │   │   ├── isPalindrome.py
│   │   │   ├── palindrome.go
│   │   │   ├── palindrome.java
│   │   │   ├── palindrome.js
│   │   │   ├── palindrome.php
│   │   │   ├── palindrome.py
│   │   │   ├── palindrome.swift
│   │   │   ├── palindrome.ts
│   │   │   └── palindromecheck.go
│   │   ├── README.md
│   │   ├── Rabin-Karp/
│   │   │   ├── RabinKarpAlgo.java
│   │   │   ├── Rabin_Karp.cpp
│   │   │   ├── Rabin_Karp.ts
│   │   │   ├── Rabin_karp.c
│   │   │   └── rabin_karp.py
│   │   ├── SCS/
│   │   │   └── SCS.cpp
│   │   ├── ScrambleString.java
│   │   └── suffix_array.cpp
│   └── Tree/
│       ├── Binary_Lifting/
│       │   ├── Binary Lifting.py
│       │   └── Binary-Lifting.cpp
│       ├── GenericTreeImplementation/
│       │   ├── GenericTree.c
│       │   ├── GenericTree.cpp
│       │   └── GenericTree.java
│       ├── LCA/
│       │   ├── LCA.cpp
│       │   ├── LCA.cs
│       │   ├── LCA.js
│       │   └── LCA.py
│       ├── Max_Heap_Construction/
│       │   └── minmaxheap.cpp
│       ├── Max_Path_Sum_BST/
│       │   ├── Max_Path_Sum_BST.cpp
│       │   └── Max_Path_Sum_BST.py
│       ├── Min_Heap_Construction/
│       │   ├── README.md
│       │   ├── min-heap-construc.cpp
│       │   └── min-heap-construc.py
│       ├── README.md
│       ├── Sorted-Array-To-BST/
│       │   └── Sorted-Array-To-BST.cpp
│       ├── Sorted_Array_To_BST/
│       │   └── SortedArrayToBST.java
│       ├── Validate_BST/
│       │   ├── Validate_BST.cpp
│       │   ├── Validate_BST.cs
│       │   └── Validate_BST.java
│       └── level_traversing/
│           ├── level_traversing.php
│           └── level_traversing.py
├── CNAME
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── CONTRIBUTORS.md
├── Collection/
│   ├── ArrayDeque/
│   │   ├── ArrayDeque.java
│   │   └── README.md
│   ├── ArrayList/
│   │   ├── ArrayList .java
│   │   └── README.md
│   ├── HashMap/
│   │   ├── HashMap.java
│   │   └── README.md
│   ├── HashSet/
│   │   ├── HashSet.java
│   │   └── README.md
│   ├── LinkedList/
│   │   ├── LinkedHashSet/
│   │   │   └── README.md
│   │   ├── LinkedList.java
│   │   └── README.md
│   ├── Queue/
│   │   ├── Deque/
│   │   │   ├── Deque.java
│   │   │   └── README.md
│   │   ├── PriorityQueue/
│   │   │   ├── PriorityQueue.java
│   │   │   └── README.md
│   │   ├── Queue.java
│   │   └── README.md
│   ├── README.md
│   ├── Stack/
│   │   ├── README.md
│   │   └── StackCollection.java
│   └── Vector/
│       ├── README.md
│       └── Vector.java
├── DOCUMENTATION.md
├── Data-Structures/
│   ├── Array/
│   │   ├── Array.c
│   │   ├── Array.cpp
│   │   ├── Array.go
│   │   ├── Array.java
│   │   ├── Array.js
│   │   ├── Array.py
│   │   ├── Array.ts
│   │   ├── README.md
│   │   └── array_menudriven.cpp
│   ├── Graph/
│   │   ├── GraphUsingList.kt
│   │   ├── README.md
│   │   ├── UsingList.cpp
│   │   ├── UsingList.py
│   │   ├── UsingMatrix.cpp
│   │   └── graph_implementation_in_C_bfs_dfs.c
│   ├── HashMap/
│   │   └── README.md
│   ├── HashSet/
│   │   ├── Hash-Set.c
│   │   └── README.md
│   ├── Heap/
│   │   └── README.md
│   ├── LinkedList/
│   │   ├── Circular_Linked_List/
│   │   │   ├── CircularLinkedList.c
│   │   │   ├── CircularLinkedList.java
│   │   │   ├── Circular_Link_List.cpp
│   │   │   ├── README.md
│   │   │   ├── circularLinkedList.js
│   │   │   ├── circularLinkedList.py
│   │   │   └── csharp/
│   │   │       └── CircularLinkedList.cs
│   │   ├── Doubly_Linked_List/
│   │   │   ├── Double linked List circular with double headers C++/
│   │   │   │   ├── LDLCCED.cbp
│   │   │   │   ├── LDLCCED.layout
│   │   │   │   ├── dllist.cpp
│   │   │   │   ├── dllist.h
│   │   │   │   ├── dlnode.cpp
│   │   │   │   ├── dlnode.h
│   │   │   │   ├── listexception.h
│   │   │   │   ├── main.cpp
│   │   │   │   └── nodeexception.h
│   │   │   ├── DoubleLinkedList.java
│   │   │   ├── DoublyLinkedList.cs
│   │   │   ├── DoublyLinkedList.hs
│   │   │   ├── DoublyLinkedList_C++_Template/
│   │   │   │   ├── DLL.h
│   │   │   │   └── DLLtest.cpp
│   │   │   ├── Doubly_Linked_List.py
│   │   │   ├── README.md
│   │   │   ├── double_linked_list.c
│   │   │   ├── doubly.c
│   │   │   ├── doubly_ll.py
│   │   │   └── simple linked list circular without header/
│   │   │       ├── LSLCSE.cbp
│   │   │       ├── LSLCSE.layout
│   │   │       ├── main.cpp
│   │   │       ├── sllist.cpp
│   │   │       ├── sllist.h
│   │   │       ├── slnode.cpp
│   │   │       └── slnode.h
│   │   ├── README.md
│   │   ├── Singly_Linked_List/
│   │   │   ├── Delete_Kth_Node_From_End/
│   │   │   │   ├── Delete_Kth_Node_From_End.cpp
│   │   │   │   ├── Delete_Kth_Node_From_End.java
│   │   │   │   ├── Delete_Kth_Node_From_End.py
│   │   │   │   └── Delete_Kth_Node_From_End.rb
│   │   │   ├── Detect_Cycle/
│   │   │   │   ├── CycleDetection.c
│   │   │   │   ├── CycleDetection.java
│   │   │   │   ├── DetectCycle.cpp
│   │   │   │   ├── DetectCycle.py
│   │   │   │   ├── DetectCycle.ts
│   │   │   │   ├── Detect_Cycle.js
│   │   │   │   ├── detect_cycle.cs
│   │   │   │   └── detect_cycle.go
│   │   │   ├── Java/
│   │   │   │   └── PalindromeLinkedList.java
│   │   │   ├── LinkedList.cs
│   │   │   ├── LinkedList.java
│   │   │   ├── LinkedList.py
│   │   │   ├── LinkedListAndOperations.cpp
│   │   │   ├── LoopDetection.cpp
│   │   │   ├── MiddleElementLL.cpp
│   │   │   ├── MiddleElementLinkedList.java
│   │   │   ├── Palindrome.ts
│   │   │   ├── PalindromeLinkedList.cpp
│   │   │   ├── PalindromeLinkedList.js
│   │   │   ├── README.md
│   │   │   ├── Remove duplicates from linked_list.c
│   │   │   ├── Remove duplicates in a Linked List.cpp
│   │   │   ├── Remove_Duplicates_in_LL.py
│   │   │   ├── Reversed_Linked_List/
│   │   │   │   ├── ReversedLinkedList.js
│   │   │   │   └── reverseLinkedList.c
│   │   │   ├── Sublist_Search.rb
│   │   │   ├── linked list.c
│   │   │   ├── linked.cpp
│   │   │   ├── linkedlist.cpp
│   │   │   ├── merge2sortedlinkedlists.cpp
│   │   │   ├── middle.ts
│   │   │   └── singly_linked_list.hs
│   │   ├── detect_cycle.rb
│   │   └── sparce matrix/
│   │       └── sparce addition.cpp
│   ├── Queue/
│   │   ├── Circular-Queue/
│   │   │   ├── circular_queue.c
│   │   │   ├── circular_queue.cs
│   │   │   ├── circular_queue_LL.c
│   │   │   ├── circular_queue_array_implementation.c
│   │   │   └── cirqueue.cpp
│   │   ├── Deque/
│   │   │   ├── Deque.cpp
│   │   │   ├── Deque.java
│   │   │   ├── Deque.js
│   │   │   ├── Deque.py
│   │   │   ├── Deque.ts
│   │   │   └── README.md
│   │   ├── Priority-Queue/
│   │   │   ├── Priority-Queue.cpp
│   │   │   ├── PriorityQueue.php
│   │   │   ├── README.md
│   │   │   └── priorityQueue.js
│   │   ├── QueueUsingArray.c
│   │   ├── QueueUsingArray.cpp
│   │   ├── QueueUsingArray.go
│   │   ├── QueueUsingArray.java
│   │   ├── QueueUsingArray.js
│   │   ├── QueueUsingArray.py
│   │   ├── QueueUsingArray.rb
│   │   ├── QueueUsingArray.swift
│   │   ├── QueueUsingLL.c
│   │   ├── QueueUsingLL.cpp
│   │   ├── QueueUsingLL.cs
│   │   ├── QueueUsingLL.php
│   │   ├── QueueUsingStacks.cpp
│   │   └── README.md
│   ├── README.md
│   ├── Stack/
│   │   ├── Infix_to_prefix_postfix.cpp
│   │   ├── README.md
│   │   ├── StackUsingArray.c
│   │   ├── StackUsingArray.cpp
│   │   ├── StackUsingArray.cs
│   │   ├── StackUsingArray.go
│   │   ├── StackUsingArray.hs
│   │   ├── StackUsingArray.java
│   │   ├── StackUsingArray.js
│   │   ├── StackUsingArray.php
│   │   ├── StackUsingArray.rb
│   │   ├── StackUsingArray.swift
│   │   ├── StackUsingLL.cpp
│   │   ├── StackUsingLL.go
│   │   ├── StackUsingLL.java
│   │   ├── StackUsingLL.js
│   │   ├── StackUsingLL.py
│   │   ├── stackUsingLinkedList.c
│   │   └── stackusingLL.c
│   └── Tree/
│       ├── 23-Tree/
│       │   ├── 23Tree.cpp
│       │   └── 23Tree.py
│       ├── AVL-Tree/
│       │   ├── AVL_Tree.java
│       │   ├── AVL_Tree.py
│       │   ├── AVLtree.c
│       │   ├── README.md
│       │   └── avl_tree.py
│       ├── Binary-Indexed-Tree/
│       │   ├── Binary-Indexed-Tree.c
│       │   ├── Binary-Indexed-Tree.go
│       │   ├── Binary-Indexed-Tree.java
│       │   └── Binary-Indexed-Tree.py
│       ├── Binary-Search-Tree/
│       │   ├── BST.cs
│       │   ├── BST_balanced.cpp
│       │   ├── BinarySearchTree.go
│       │   ├── BinarySearchTree.java
│       │   ├── Binary_Search_Tree.cpp
│       │   ├── Binary_Search_Tree.py
│       │   ├── Binary_Search_Tree_operations.cpp
│       │   ├── LCA.py
│       │   ├── README.md
│       │   ├── Validate_BST.py
│       │   ├── Vertcal_order_traversal.py
│       │   ├── inorder_transversal.c
│       │   ├── operationBST.cpp
│       │   ├── postorder_transversal.c
│       │   └── valid BST
│       ├── Binary-Tree/
│       │   ├── BTree.cpp
│       │   ├── Binary tree using C.c
│       │   ├── Btree.java
│       │   ├── Check_duplicates_in _BTree.java
│       │   ├── Density/
│       │   │   ├── DensityBtree.c
│       │   │   └── DensityBtree.cpp
│       │   ├── Deserialize/
│       │   │   └── Deserialize.rb
│       │   ├── Duplicate_values.cs
│       │   ├── Invert_Binary_Tree/
│       │   │   ├── Invert_Binary_Tree.py
│       │   │   ├── invertBinTree.rb
│       │   │   └── invert_binary_tree.cpp
│       │   ├── Invert_Binary_tree/
│       │   │   └── invert_btree.swift
│       │   ├── Right_View/
│       │   │   ├── RightViewBTree.java
│       │   │   ├── rightViewBinTree.rb
│       │   │   ├── right_view.py
│       │   │   ├── right_view.swift
│       │   │   └── right_view_of_binary_tree.cpp
│       │   ├── Serialize/
│       │   │   ├── Serialize.cpp
│       │   │   └── Serialize.py
│       │   ├── Subtree_check/
│       │   │   └── Subtree_check.cpp
│       │   ├── SymmetricBTree.java
│       │   ├── SymmetryBTree/
│       │   │   └── SymmetryBTree.rb
│       │   ├── SymmetryBTree.cs
│       │   ├── SymmetryBTree.py
│       │   ├── Two_level_Node/
│       │   │   └── two_level_Node.cpp
│       │   ├── Two_level_Node.java
│       │   ├── VerticalOrderTraversal.java
│       │   ├── VerticalOrderTraversal.py
│       │   ├── Vertical_Sum/
│       │   │   ├── Verticle_sum_of_BinaryTree.java
│       │   │   └── Verticle_sum_of_Binary_Tree.cpp
│       │   ├── b_tree.cpp
│       │   ├── b_tree.java
│       │   ├── b_tree.js
│       │   ├── b_tree.py
│       │   ├── binary_tree_trans.cpp
│       │   ├── duplicate_values.cpp
│       │   ├── duplicate_values.py
│       │   ├── duplicate_values.rb
│       │   ├── subtree_check.cpp
│       │   ├── symmetry_bTree.cpp
│       │   └── two_level_node.py
│       ├── Expression Tree/
│       │   └── Expression_Tree.cpp
│       ├── Fibonacci-Heap/
│       │   └── Fibonacci-Heap.c
│       ├── Generic Tree/
│       │   └── GenericTree.cpp
│       ├── README.md
│       ├── Red-Black-Tree/
│       │   ├── Red-Black-Tree.c
│       │   ├── Red-Black-Tree.cpp
│       │   ├── Red-Black-Tree.java
│       │   └── Red-Black-Tree.py
│       ├── Segment-Tree/
│       │   └── Segment-Tree.c
│       ├── Splay-Tree/
│       │   └── Splay-Tree.c
│       ├── Threaded Binary Tree/
│       │   └── Threaded_Binary_Tree.cpp
│       └── Trie/
│           ├── README.md
│           ├── Trie.c
│           ├── trie.cpp
│           └── trie.py
├── LICENSE
├── Maths/
│   ├── Algebra/
│   │   ├── Babylionian/
│   │   │   ├── Babylionian.cs
│   │   │   ├── Babylionian.go
│   │   │   └── Babylonian.java
│   │   ├── Babylonian/
│   │   │   ├── Babylonian.js
│   │   │   └── babylonian_square_root.c
│   │   ├── Derivative_Of_Polynomial/
│   │   │   ├── Matrix_Multiplication.c
│   │   │   └── README.md
│   │   ├── Diophantine/
│   │   │   └── README.md
│   │   ├── Factorial/
│   │   │   ├── Factorial.hs
│   │   │   ├── Factorial.java
│   │   │   ├── README.md
│   │   │   ├── factorial.c
│   │   │   ├── factorial.cpp
│   │   │   ├── factorial.cs
│   │   │   ├── factorial.go
│   │   │   ├── factorial.js
│   │   │   ├── factorial.php
│   │   │   ├── factorial.py
│   │   │   ├── factorial.rb
│   │   │   ├── factorial.sh
│   │   │   ├── factorial.swift
│   │   │   └── factorial.ts
│   │   ├── Factorial_of_Large_Number/
│   │   │   ├── Factorial_of_Large_Number.cs
│   │   │   ├── Factorial_of_Large_Number.hs
│   │   │   ├── Factorial_of_Large_Number.js
│   │   │   ├── Factorial_of_Large_Number.php
│   │   │   ├── Factorial_of_large_number.c
│   │   │   ├── README.md
│   │   │   ├── bigfactorial.cpp
│   │   │   └── largeFactorial.java
│   │   ├── GCD/
│   │   │   ├── EuclidGCD.swift
│   │   │   ├── Euclidean_gcd.py
│   │   │   ├── EuclidianGCD.py
│   │   │   ├── GCD.cpp
│   │   │   ├── GCD.cs
│   │   │   ├── GCD.js
│   │   │   ├── GCD.php
│   │   │   ├── GCD.py
│   │   │   ├── GCD.rb
│   │   │   ├── GCD.sh
│   │   │   ├── README.md
│   │   │   └── gcd.java
│   │   ├── Inverse_of_a_Matrix/
│   │   │   └── README.md
│   │   ├── LCM/
│   │   │   ├── LCM.c
│   │   │   ├── LCM.cpp
│   │   │   ├── LCM.java
│   │   │   ├── LCM.js
│   │   │   ├── LCM.py
│   │   │   ├── LCM.sh
│   │   │   ├── LCM_GCD.c
│   │   │   ├── LCM_python.py
│   │   │   └── README.md
│   │   ├── Markov_Matrix/
│   │   │   ├── MarkovMatrix.java
│   │   │   ├── Markov_Matrix.c++
│   │   │   ├── Markov_Matrix.cs
│   │   │   └── Markov_Matrix.js
│   │   ├── Matrix_Multipication/
│   │   │   ├── MatMul.cpp
│   │   │   ├── MatrixMultipication.py
│   │   │   ├── MatrixMultiply.java
│   │   │   ├── Matrix_Multiplication.js
│   │   │   ├── README.md
│   │   │   ├── multiply.c
│   │   │   ├── multiply.cpp
│   │   │   ├── multiply.java
│   │   │   ├── multiply.php
│   │   │   └── multiply.py
│   │   ├── Permutation_And_Combination/
│   │   │   ├── Permutations_Combinations.ipynb
│   │   │   ├── README.md
│   │   │   ├── permutation_combination.cpp
│   │   │   └── permutation_combination.js
│   │   ├── Prime_Factorization/
│   │   │   ├── PrimeFactorisation.cpp
│   │   │   ├── Prime_Factor.c
│   │   │   ├── Prime_Factorisation.cpp
│   │   │   ├── Prime_Factorization.cs
│   │   │   ├── README.md
│   │   │   ├── prime-factorisation.js
│   │   │   ├── prime.cpp
│   │   │   ├── prime_factorization.cpp
│   │   │   ├── prime_factorization.java
│   │   │   ├── prime_factorization.py
│   │   │   └── prime_factorization.ts
│   │   ├── Quadratic_Formula/
│   │   │   ├── Quadratic_Formula.cpp
│   │   │   ├── Quadratic_Formula.hs
│   │   │   ├── Quadratic_Formula.sh
│   │   │   ├── README.md
│   │   │   └── quadraticformula.py
│   │   ├── README.md
│   │   ├── Sieve of Eratosthenes/
│   │   │   ├── SieveOfEratosthenes.cpp
│   │   │   ├── SieveOfEratosthenes.py
│   │   │   ├── SieveOfEratosthens.c
│   │   │   └── SieveofEratosthenes.java
│   │   ├── Strassens_Algorithm/
│   │   │   ├── README.md
│   │   │   ├── Strassen.java
│   │   │   ├── Strassens_Algorithm.c++
│   │   │   └── strassens.py
│   │   ├── Taylor-Expansion/
│   │   │   └── README.md
│   │   └── Vertex_Formula/
│   │       └── README.md
│   ├── Calculus/
│   │   ├── Euler_Approximation/
│   │   │   ├── Euler_Approximation.c
│   │   │   ├── Euler_Approximation.cpp
│   │   │   ├── Euler_Approximation.java
│   │   │   ├── Euler_Approximation.py
│   │   │   └── README.md
│   │   ├── Leibniz_formula/
│   │   │   ├── LeibnizFormula.py
│   │   │   ├── Leibniz_Formula.java
│   │   │   ├── Leibniz_formula.cpp
│   │   │   └── README.md
│   │   ├── Probability_Density_Functions/
│   │   │   └── README.md
│   │   ├── README.md
│   │   ├── Riemann_Sum/
│   │   │   ├── README.md
│   │   │   ├── Riemann.py
│   │   │   ├── Riemann_Sum.cpp
│   │   │   ├── Riemann_Sum.cs
│   │   │   └── riemann_sum.py
│   │   └── Runge–Kutta_Method/
│   │       ├── Range-Kutta.c
│   │       ├── Runge-Kutta.cpp
│   │       └── Runge-Kutta.py
│   ├── Discrete/
│   │   ├── Ackermann_Peter/
│   │   │   ├── Ackermann_Peter.c
│   │   │   ├── Ackermann_Peter.cpp
│   │   │   ├── Ackermann_Peter.js
│   │   │   ├── Ackermann_Peter.py
│   │   │   ├── Python/
│   │   │   │   └── ackermann.py
│   │   │   └── README.md
│   │   └── README.md
│   ├── Geometry/
│   │   ├── Clock_Angle/
│   │   │   ├── ClockAngle.cs
│   │   │   ├── Clock_Angle.c
│   │   │   ├── Clock_Angle.cpp
│   │   │   ├── Clock_Angle.hs
│   │   │   ├── Clock_Angle.java
│   │   │   ├── Clock_Angle.js
│   │   │   ├── README.md
│   │   │   ├── clock_angle.go
│   │   │   └── clock_angle.py
│   │   ├── Distance_Formula/
│   │   │   ├── Distance_Formula.c
│   │   │   ├── Distance_Formula.cpp
│   │   │   ├── Distance_Formula.cs
│   │   │   ├── Distance_Formula.go
│   │   │   ├── Distance_Formula.hs
│   │   │   ├── Distance_Formula.java
│   │   │   ├── Distance_Formula.js
│   │   │   ├── Distance_Formula.php
│   │   │   ├── Distance_Formula.py
│   │   │   └── README.md
│   │   ├── Manhattan_Distance/
│   │   │   ├── ManhattanDistance.java
│   │   │   ├── ManhattanDistance.js
│   │   │   ├── Manhattan_Distance.c
│   │   │   ├── Manhattan_Distance.hs
│   │   │   ├── README.md
│   │   │   ├── manhattan_dist.cpp
│   │   │   ├── manhattan_dist.go
│   │   │   ├── manhattan_dist.py
│   │   │   └── manhattan_distance.py
│   │   ├── N_Dimensional_Distance/
│   │   │   └── N_Dimensional_Distance.c
│   │   ├── Polar_Cartesian_Conversion/
│   │   │   ├── Polar_Cartesian_Conversion.go
│   │   │   ├── Polar_Cartesian_Conversion.hs
│   │   │   ├── Polar_Cartesian_Conversion.java
│   │   │   └── Polar_Cartesian_Conversion.py
│   │   ├── Pythagorean_theorem/
│   │   │   ├── PythagoreanTheorem.cs
│   │   │   ├── Pythagorean_theorem.cpp
│   │   │   ├── Pythagorean_theorem.hs
│   │   │   ├── Pythagorean_theorem.js
│   │   │   ├── Pythagorean_theorem.py
│   │   │   ├── Pythagorean_theorem.rb
│   │   │   ├── Pythagorean_theorem.swift
│   │   │   ├── README.md
│   │   │   └── pythogoras_theorem.java
│   │   ├── README.md
│   │   ├── Radians_Degrees_Conversion/
│   │   │   ├── README.md
│   │   │   ├── Radians_Degree_Conversion.c
│   │   │   ├── Radians_Degrees_Conversion.c
│   │   │   ├── Radians_Degrees_Conversion.cpp
│   │   │   ├── Radians_Degrees_Conversion.hs
│   │   │   ├── Radians_Degrees_Conversion.java
│   │   │   ├── Radians_Degrees_Conversion.js
│   │   │   └── Radians_Degrees_Conversion.py
│   │   ├── Scalar_Product/
│   │   │   ├── README.md
│   │   │   ├── Scalar_Product.c
│   │   │   ├── Scalar_Product.hs
│   │   │   ├── Scalar_Product.java
│   │   │   ├── Scalar_Product.js
│   │   │   ├── Scalar_Product.py
│   │   │   ├── scalar_product.cpp
│   │   │   └── scalar_product.rb
│   │   └── Vector_Product/
│   │       ├── README.md
│   │       ├── Vector_Product.c
│   │       ├── Vector_Product.cpp
│   │       ├── Vector_Product.hs
│   │       ├── Vector_Product.js
│   │       ├── Vector_Product.py
│   │       └── Vector_Product.ts
│   ├── MOs-Algorithm/
│   │   ├── Mos_Algorithm.c
│   │   ├── Mos_Algorithm.cpp
│   │   └── README.md
│   ├── Number-Theory/
│   │   ├── Armstrong_Number/
│   │   │   ├── ArmstrongNumber.java
│   │   │   ├── Armstrong_Number.c
│   │   │   ├── armstrong.py
│   │   │   ├── armstrongin.java
│   │   │   ├── armstrongnumber.cpp
│   │   │   └── armstrongnumber.js
│   │   ├── Extended Euclidean Algorithm/
│   │   │   ├── extendEuclid.cpp
│   │   │   └── extendEuclid.py
│   │   ├── Fibonacci_Number/
│   │   │   ├── Fibonacci.cs
│   │   │   ├── FibonacciNumbers.java
│   │   │   ├── Fibonacci_Number.clj
│   │   │   ├── Fibonacci_Number.cpp
│   │   │   ├── Fibonacci_Number.py
│   │   │   └── fibonacci.sh
│   │   ├── Perfect_Number/
│   │   │   ├── Perfect Number.cpp
│   │   │   ├── PerfectNumber.py
│   │   │   ├── Perfect_Number,sh
│   │   │   ├── Perfect_Number.java
│   │   │   ├── perfec_numper.py
│   │   │   ├── perfectnumber.cpp
│   │   │   ├── perfectnumber.js
│   │   │   └── perfectnumber.php
│   │   ├── README.md
│   │   ├── Segmented_Sieve/
│   │   │   ├── README.md
│   │   │   ├── Segmented_Sieve.php
│   │   │   ├── segmented_sieve.js
│   │   │   └── segmented_sieve.py
│   │   ├── Sieve_of_Eratosthenes/
│   │   │   ├── SieveOfEratosthenes.c
│   │   │   ├── SieveOfEratosthenes.cs
│   │   │   ├── Sieve_of_Erastosthenes.rb
│   │   │   ├── Sieve_of_Erastosthenes.ts
│   │   │   ├── Sieve_of_Eratosthenes.c
│   │   │   ├── Sieve_of_Eratosthenes.cpp
│   │   │   ├── Sieve_of_Eratosthenes.go
│   │   │   ├── SieveofErastosthenes.java
│   │   │   └── prime_and_base.py
│   │   ├── Smith_number/
│   │   │   ├── SmithNumber.py
│   │   │   └── smith_numbers_till_n.cpp
│   │   ├── Strong_Number/
│   │   │   ├── strong_number.c
│   │   │   ├── strong_number.cpp
│   │   │   ├── strong_number.java
│   │   │   ├── strong_number.py
│   │   │   └── strong_number.sh
│   │   ├── Tribonacci_Number/
│   │   │   └── nthTribonacci.kt
│   │   └── Ugly_Number/
│   │       ├── README.md
│   │       ├── UglyNumber.go
│   │       ├── UglyNumbers.sh
│   │       ├── Ugly_Number.c
│   │       ├── Ugly_Number.java
│   │       ├── Ugly_Number.js
│   │       ├── Ugly_Number.php
│   │       ├── Ugly_Number.py
│   │       ├── Ugly_Number.rb
│   │       ├── Ugly_Number_Till_N.cpp
│   │       └── Ugly_Numbers.sh
│   ├── README.md
│   ├── Series/
│   │   ├── Arithmetic_Progression/
│   │   │   ├── AP.py
│   │   │   ├── Arithematic_Progression.cpp
│   │   │   ├── Arithmetic_Progression.c
│   │   │   ├── Arithmetic_Progression.java
│   │   │   ├── Arithmetic_Progression.js
│   │   │   ├── Arithmetic_Progression.php
│   │   │   ├── Arithmetic_Progression.sh
│   │   │   ├── Arithmetic_Progression.ts
│   │   │   └── README.md
│   │   ├── Fibonacci/
│   │   │   ├── Fibonacci.c
│   │   │   ├── Fibonacci.cpp
│   │   │   ├── Fibonacci.sh
│   │   │   ├── Fiboncci.py
│   │   │   ├── README.md
│   │   │   ├── fibonacci.cpp
│   │   │   └── fibonacci.java
│   │   ├── Geometric_Progression/
│   │   │   ├── Geometric Progression.py
│   │   │   ├── GeometricProgression.cs
│   │   │   ├── GeometricProgression.java
│   │   │   ├── Geometric_Progression.sh
│   │   │   └── README.md
│   │   ├── Harmonic_Progression/
│   │   │   ├── Harmonic Progression.cpp
│   │   │   ├── HarmonicProgresion.c
│   │   │   ├── Harmonic_Expression.java
│   │   │   ├── README.md
│   │   │   ├── SumOfHP.swift
│   │   │   └── harmonic_progression.py
│   │   ├── Lucas_Series/
│   │   │   ├── Lucas_Series.c
│   │   │   ├── Lucas_Series.cpp
│   │   │   ├── Lucas_Series.go
│   │   │   ├── Lucas_Series.php
│   │   │   ├── README.md
│   │   │   ├── lucas_series.cs
│   │   │   ├── lucas_series.py
│   │   │   └── lucas_series.ts
│   │   ├── Modular_Exponentiation/
│   │   │   ├── Modular_Exponentiation.cpp
│   │   │   ├── Modular_Exponentiation.py
│   │   │   ├── README.md
│   │   │   ├── modular_exponentiation.c
│   │   │   ├── modular_exponentiation.cpp
│   │   │   └── modular_exponentiation.java
│   │   ├── README.md
│   │   ├── Relative_Primes/
│   │   │   ├── README.md
│   │   │   ├── RelativePrimes.c
│   │   │   ├── RelativePrimes.java
│   │   │   ├── RelativePrimes.php
│   │   │   ├── RelativePrimes.py
│   │   │   ├── Relative_Prime.cpp
│   │   │   └── Relative_Primes.go
│   │   ├── Sum_of_AP/
│   │   │   ├── Sum_Of_AP.CPP
│   │   │   ├── Sum_Of_AP.py
│   │   │   ├── Sum_of_AP.c
│   │   │   ├── Sum_of_AP.go
│   │   │   ├── Sum_of_AP.js
│   │   │   └── Sum_of_AP_JAVA/
│   │   │       ├── SumOfAP.ctxt
│   │   │       └── Sum_of_AP.java
│   │   ├── Sum_of_GP/
│   │   │   ├── README.md
│   │   │   ├── Sum_Of_GP.c
│   │   │   ├── Sum_Of_GP.cpp
│   │   │   ├── Sum_of_GP.java
│   │   │   └── Sum_of_GP.py
│   │   ├── Sum_of_HP/
│   │   │   ├── HP_sum.py
│   │   │   ├── Sum_of_HP.cpp
│   │   │   ├── Sum_of_HP.cs
│   │   │   └── hpSum.js
│   │   ├── Sum_of_N/
│   │   │   ├── Sum_of_n.c
│   │   │   ├── sumOfNNumbers.sh
│   │   │   ├── sum_of_n_natural_no.cpp
│   │   │   ├── sum_of_n_natural_numbers.go
│   │   │   ├── sumn.py
│   │   │   ├── sumofNnaturalnums.cs
│   │   │   └── sumofNnaturalnums.py
│   │   ├── Sum_of_N2/
│   │   │   ├── SumOf_n^2.C++
│   │   │   ├── Sum_Of_n^2.py
│   │   │   ├── Sum_of_n^2.swift
│   │   │   ├── square_sum.cs
│   │   │   ├── sumOfNSquare.js
│   │   │   ├── sumOfn_squared.py
│   │   │   └── sumofnsqaure.php
│   │   └── Sum_of_N3/
│   │       ├── Sum of n3.cpp
│   │       ├── sum of n^3.cpp
│   │       └── sumofncube.php
│   └── Statistics/
│       ├── Compound_Interest/
│       │   ├── Compound_Interest.c
│       │   ├── Compound_Interest.cpp
│       │   ├── Compound_Interest.cs
│       │   ├── Compound_Interest.html
│       │   ├── Compound_Interest.java
│       │   ├── Compound_Interest.js
│       │   ├── Compound_Interest.py
│       │   ├── Compound_Interest.rb
│       │   └── Compound_Interest.ts
│       ├── Confidence_Interval/
│       │   ├── Confidence_Interval.cpp
│       │   ├── Confidence_Inverval.c
│       │   ├── README.md
│       │   ├── confidenceInterval.js
│       │   └── confidence_interval.py
│       ├── Exponential_Smoothing/
│       │   ├── Exponential_Smoothing.cpp
│       │   ├── Exponential_Smoothing.java
│       │   ├── Exponential_Smoothing.rb
│       │   └── README.md
│       ├── K-means_Clustering/
│       │   └── K-means_Clustering.py
│       ├── Logistic_Function/
│       │   └── README.md
│       ├── Mean/
│       │   ├── mean.cpp
│       │   ├── mean.java
│       │   ├── mean.py
│       │   ├── meanOfGivenNumbers.c
│       │   ├── meanOfGivenNumbers.cs
│       │   └── meanOfGivenNumbers.js
│       ├── Median/
│       │   ├── Median.c
│       │   ├── Median.java
│       │   ├── Median.js
│       │   ├── Median.py
│       │   ├── README.md
│       │   └── meadian.cpp
│       ├── Mode/
│       │   ├── Mode.java
│       │   ├── README.md
│       │   ├── mode.c
│       │   ├── mode.cpp
│       │   ├── mode.js
│       │   ├── mode.php
│       │   └── mode.py
│       ├── README.md
│       └── Standard_Deviation/
│           ├── README.md
│           ├── Standard_Deviation.c
│           ├── Standard_Deviation.cpp
│           ├── Standard_Deviation.js
│           ├── Standard_Deviation.py
│           └── Standard_Deviation.swift
├── README.md
├── STL/
│   ├── Array/
│   │   └── Array.cpp
│   ├── Map/
│   │   ├── MultiMap/
│   │   │   └── multimap.cpp
│   │   ├── Unodered-Map/
│   │   │   └── unorderedmap.cpp
│   │   └── map.cpp
│   ├── Queue/
│   │   ├── Deque/
│   │   │   ├── README.md
│   │   │   └── deque.cpp
│   │   ├── PriorityQueue/
│   │   │   └── priority_queue.cpp
│   │   └── Queue.cpp
│   ├── README.md
│   ├── Set/
│   │   ├── Unodered-Set/
│   │   │   └── UnorderedSet.cpp
│   │   └── set.cpp
│   ├── Stack/
│   │   └── stack.cpp
│   └── Vector/
│       └── Vector.cpp
└── _config.yml
Download .txt
Showing preview only (308K chars total). Download the full file or copy to clipboard to get everything.
SYMBOL INDEX (4063 symbols across 1038 files)

FILE: Algorithms/Array/Arr4 right shift.c
  function AcceptArray (line 7) | void AcceptArray(int *Arr1 , int n)
  function DisplayArray (line 24) | void DisplayArray(int *Arr1[],int n )
  function main (line 41) | void main(void)

FILE: Algorithms/Array/InsertArray.c
  function main (line 4) | int main()

FILE: Algorithms/Array/LinearSearch.java
  class Main (line 2) | public class Main {

FILE: Algorithms/Array/Merge-Sorted-Array.c
  function cmpfunc (line 3) | int cmpfunc (const void * a, const void * b) {
  function main (line 7) | int main()

FILE: Algorithms/Array/Merge-Sorted-Array.cpp
  function printArray (line 6) | void printArray(int arr[], int size)
  function mergeKArrays (line 12) | void mergeKArrays(int arr[][n], int a, int output[])
  function main (line 27) | int main()

FILE: Algorithms/Array/Merge-Sorted-Array.js
  function mergeSorted (line 3) | function mergeSorted(a, b) {

FILE: Algorithms/Array/Merge-Sorted-Array.py
  function mergeK (line 3) | def mergeK(arr, k):
  function printArray (line 9) | def printArray(arr):

FILE: Algorithms/Array/Merge_Sorted_Arrays.rb
  function merge_sorted_arrays (line 1) | def merge_sorted_arrays(arrays)
  function sort (line 13) | def sort(num_arr)
  function merge (line 23) | def merge(left, right)

FILE: Algorithms/Array/Rearrange-High-Low.js
  function swap (line 1) | function swap(arr, i, j)
  function rearrangeArray (line 10) | function rearrangeArray(arr, n)

FILE: Algorithms/Array/Remove-Dublicate.js
  function RemoveDuplicateItem (line 3) | function RemoveDuplicateItem(arr) {

FILE: Algorithms/Array/Remove-Duplicates-from-Sorted-Array.c
  function ll (line 24) | ll max(ll i,ll j){
  function removeDuplicates (line 29) | int removeDuplicates(vector<int>& nums) {
  function main (line 47) | int main(){

FILE: Algorithms/Array/Remove-Duplicates-from-Sorted-Array.cpp
  function removeDuplicates (line 9) | int removeDuplicates(int arr[], int n)
  function main (line 31) | int main()

FILE: Algorithms/Array/Shuffle.c
  function ll (line 24) | ll max(ll i,ll j){
  function main (line 29) | int main(){

FILE: Algorithms/Array/Two-Arrays-And-Swaps.c
  function main (line 26) | int main(){

FILE: Algorithms/Array/check_two_equal_array.cpp
  function main (line 7) | int main()

FILE: Algorithms/Array/copyarray.c
  function main (line 2) | int main()

FILE: Algorithms/Array/counting_frequency_of_char_in_string.c
  function main (line 2) | int main() {

FILE: Algorithms/Array/findpos.py
  function findposition (line 1) | def findposition(arr, x) :

FILE: Algorithms/Array/high-low-rearrangement.c
  function swap (line 3) | void swap(int arr[], int i, int j)
  function rearrange (line 10) | void rearrange(int arr[], int n)
  function main (line 23) | int main(void)

FILE: Algorithms/Array/high-low-rearrangement.py
  function swap (line 2) | def swap(A, i, j):
  function rearrangeArray (line 7) | def rearrangeArray(A):

FILE: Algorithms/Array/largest-smallest-number-and-sum-of-all-elements-in-array.java
  class t17question7 (line 2) | class t17question7
    method main (line 4) | public static void main(String args[])throws IOException

FILE: Algorithms/Array/merge-sorted-arrays-algo-only.py
  function mergeSortedArrays (line 3) | def mergeSortedArrays(arrays):
  function getMinValue (line 23) | def getMinValue(items):

FILE: Algorithms/Array/merge_without_extraspace.cpp
  function main (line 12) | int main()

FILE: Algorithms/Array/merging_2_arrays.c
  function main (line 2) | int main()

FILE: Algorithms/Array/rearrange-high-low.java
  class Main (line 2) | class Main
    method swap (line 5) | private static void swap(int[] A, int i, int j)
    method rearrangeArray (line 13) | public static void rearrangeArray(int[] A)
    method main (line 25) | public static void main (String[] args)

FILE: Algorithms/Array/revering_array.c
  type Array (line 3) | struct Array
  function Display (line 9) | void Display(struct Array arr)
  function swap (line 16) | void swap(int *x,int *y)
  function Reverse (line 22) | void Reverse(struct Array *arr)
  function Reverse2 (line 32) | void Reverse2(struct Array *arr)
  function main (line 40) | int main()

FILE: Algorithms/Array/rotate_matrix_90degree.cpp
  function main (line 13) | int main()

FILE: Algorithms/Array/rotated_sorted_array_search.cpp
  function rotatedSearch (line 4) | int rotatedSearch(vector<int> &A, int B) {

FILE: Algorithms/Array/twoSum.cpp
  function findTwoSumNaive (line 7) | pair<int, int> findTwoSumNaive(vector<int> nums, int target){
  function findTwoSumBetter (line 26) | pair<int, int> findTwoSumBetter(vector<int> nums, int target){
  function findTwoSumOptimal (line 46) | pair<int, int> findTwoSumOptimal(vector<int> nums, int target){
  function main (line 55) | int main(){

FILE: Algorithms/Backtracking/Crossword/Crossword.cpp
  function findString (line 17) | bool findString(vector<bool> &visited, int &index)
  function isPossible_col (line 30) | bool isPossible_col(vector<vector<char>> &grid, int row, int col, string...
  function isPossible_row (line 44) | bool isPossible_row(vector<vector<char>> &grid, int row, int col, string...
  function crossword (line 58) | bool crossword(vector<vector<char>> &grid, vector<bool> &visited, vector...
  function main (line 100) | int main()

FILE: Algorithms/Backtracking/Nqueen/N_Queen.java
  class N_Queen (line 2) | public class N_Queen {
    method solveNQUtil (line 4) | public boolean solveNQUtil(int board[][],int col) {
    method isSafe (line 18) | boolean isSafe(int board[][],int row,int col) {
    method solveNQ (line 31) | boolean solveNQ() {
    method printsolution (line 47) | void printsolution(int board[][]) {
    method main (line 54) | public static void main(String[] args) {

FILE: Algorithms/Backtracking/Nqueen/Nqueens.c
  function printmatrix (line 7) | void printmatrix() {
  function getmarkedcol (line 18) | int getmarkedcol(int row) {
  function feasible (line 27) | int feasible(int row, int col) {
  function nqueen (line 37) | void nqueen(int row) {
  function main (line 53) | int main() {

FILE: Algorithms/Backtracking/Nqueen/Nqueens.cpp
  function isvalid (line 5) | bool isvalid(int board[][10],int i,int j,int n)
  function showNqueen (line 38) | bool showNqueen(int board[][10],int i,int n)
  function main (line 74) | int main()

FILE: Algorithms/Backtracking/Nqueen/Nqueens_optimized.cpp
  function solve (line 8) | void solve(int i,int n)
  function main (line 29) | int main()

FILE: Algorithms/Backtracking/Nqueen/nqueen.cpp
  function print (line 6) | void print(int n) {
  function isSafe (line 18) | bool isSafe(int col, int row, int n) {
  function solve (line 37) | bool solve (int n, int row) {
  function main (line 52) | int main()

FILE: Algorithms/Backtracking/Nqueen/nqueens.py
  function printSolution (line 4) | def printSolution(board):
  function isSafe (line 10) | def isSafe(board, row, col):
  function solveNQUtil (line 29) | def solveNQUtil(board, col):
  function solveNQ (line 44) | def solveNQ():

FILE: Algorithms/Backtracking/Permutation/Permutations.c
  function swap (line 5) | void swap(int *ar, int i, int j)
  function printar (line 12) | void printar(int *ar, int n)
  function permute (line 20) | void permute(int *ar, int i, int n)
  function main (line 39) | int main()

FILE: Algorithms/Backtracking/Permutation/permutation.py
  function permutation (line 1) | def permutation(arr):

FILE: Algorithms/Backtracking/Permutation/permutations.cpp
  function solve (line 3) | void solve(vector<int>& nums, vector<int>& curr, vector<vector<int>> &re...
  function permute (line 19) | vector<vector<int>> permute(vector<int>& nums) {
  function main (line 25) | int main() {

FILE: Algorithms/Backtracking/Permutation/permutations.js
  function print (line 4) | function print(list,length){
  function permutation (line 12) | function permutation(list,size,length){

FILE: Algorithms/Backtracking/Rat-In-A-Maze/Rat-In-A-Maze.cpp
  function rat_in_a_maze (line 7) | void rat_in_a_maze(int i, int j, int n, vector<vector<int>> &grid, vecto...
  function main (line 65) | int main()

FILE: Algorithms/Cryptography/AES_Cipher/AES_Cipher.py
  function GetKey (line 15) | def GetKey():
  function AES_Encryption (line 27) | def AES_Encryption(cleartext):
  function AES_Decryption (line 39) | def AES_Decryption(ciphertext):

FILE: Algorithms/Cryptography/Affine_Cipher/Affine_Cipher.cpp
  function string (line 30) | string encryptMessage(string text, int (*func)(int)=NULL)
  function string (line 82) | string decryptMessage(string text, int (*func)(int)=NULL)
  function main (line 135) | int main(void)

FILE: Algorithms/Cryptography/Affine_Cipher/Affine_Cipher.py
  function encryptMessage (line 29) | def encryptMessage(text, func = lambda x: a*x + b):
  function decryptMessage (line 73) | def decryptMessage(text, func = lambda x: inv_a*(x - b)):
  function main (line 103) | def  main():

FILE: Algorithms/Cryptography/Affine_Cipher/affine_cipher.c
  function CalcGCD (line 10) | int CalcGCD(int alpha)
  function main (line 25) | int main()

FILE: Algorithms/Cryptography/Bifid_Cipher/Bifid_Cipher.py
  function find_pos (line 39) | def find_pos(polybius_square, character):
  function get_word (line 55) | def get_word(a, b, polybius_square):
  function create_polybius_square (line 62) | def create_polybius_square():
  function bifid_encryption (line 97) | def bifid_encryption(polybius_square, text):
  function decryption (line 121) | def decryption(polybius_square, encrypted_text):
  function main (line 139) | def main():

FILE: Algorithms/Cryptography/Caesar_Cipher/Caesar Cypher.cpp
  function main (line 4) | int main() {

FILE: Algorithms/Cryptography/Caesar_Cipher/Caesar Cypher.py
  function encrypt (line 1) | def encrypt(text,s):

FILE: Algorithms/Cryptography/Caesar_Cipher/CaesarCipher.java
  class CaesarCipher (line 3) | public class CaesarCipher {
    method shiftChar (line 6) | public static int shiftChar(int c, int shift) {
    method cipher (line 18) | public static String cipher(String str, int shift) {
    method cipher (line 25) | public static String cipher(String str) {
    method decipher (line 29) | public static String decipher(String str, int shift) {
    method decipher (line 33) | public static String decipher(String str) {
    method main (line 37) | public static void main(String [] args) {

FILE: Algorithms/Cryptography/Caesar_Cipher/Caesar_Cipher.c
  function main (line 3) | int main() {

FILE: Algorithms/Cryptography/Caesar_Cipher/Caesar_Cipher.cs
  class Program (line 3) | class Program
    method CaesarCipher (line 9) | private static string CaesarCipher(string text, int shiftAmount)
    method Encrypt (line 30) | private static string Encrypt(string text, int shiftAmount)
    method Decrypt (line 38) | private static string Decrypt(string text, int shiftAmount)
    method Main (line 46) | static void Main()
    method ExitAfterInvalidInput (line 80) | private static void ExitAfterInvalidInput()

FILE: Algorithms/Cryptography/Caesar_Cipher/Caesar_Cipher.php
  function cipher (line 2) | function cipher(string $str, int $key)

FILE: Algorithms/Cryptography/Caesar_Cipher/Caesar_Cypher.rb
  class CaesarCipher (line 1) | class CaesarCipher
    method encrypt (line 4) | def encrypt(sentence, times = 3)
    method rotate (line 14) | def rotate(times,current_char, index)

FILE: Algorithms/Cryptography/RSA_Cipher/RSA_Cipher.py
  function modInverse (line 15) | def modInverse(e, phin) :

FILE: Algorithms/Cryptography/RSA_Cipher/RSA_cipher.cpp
  function log_power (line 11) | int log_power(int n, int p, int mod)
  function new_func (line 23) | bool new_func(int n)
  function generate_prime (line 36) | int generate_prime()
  function gcd (line 44) | int gcd(int a, int b)
  function generate_coprime (line 55) | int generate_coprime(int n)
  function euclid_extended (line 63) | pair<int, int> euclid_extended(int a, int b) {
  function modular_inverse (line 72) | int modular_inverse(int n, int mod)
  type Keys (line 83) | struct Keys
  function Keys (line 89) | Keys generate_keys()
  function encrypt (line 111) | int encrypt(PublicKey key, int value)
  function decrypt (line 116) | int decrypt(PrivateKey key, int value)
  function main (line 121) | int main()

FILE: Algorithms/Cryptography/RSA_Cipher/RSA_cipher.java
  class Algorithm (line 11) | class Algorithm
    method Algorithm (line 22) | public Algorithm()
    method Algorithm (line 48) | public Algorithm(BigInteger e, BigInteger d, BigInteger N)
    method encryptMessage (line 59) | public byte[] encryptMessage(byte[] data)
    method decryptMessage (line 66) | public byte[] decryptMessage(byte[] data)
  class RSA_cipher (line 76) | public class RSA_cipher {
    method byte2String (line 78) | private static String byte2String(byte[] cipher)
    method main (line 88) | public static void main (String [] arguments) throws IOException

FILE: Algorithms/Cryptography/Shamir_Cipher/Shamir_Cipher.c
  function mod_expo (line 13) | int mod_expo(int base, int exp, int mod)
  function free_heap_mem (line 30) | void free_heap_mem(char **shares, int n)
  function modInverse (line 68) | int modInverse(int k)
  function join_shares (line 175) | int join_shares(int *xy_pairs, int n)
  function main (line 295) | int main(void)

FILE: Algorithms/Cryptography/Shamir_Cipher/Shamir_Cipher.cpp
  function calculate_Y (line 4) | int calculate_Y(int x, vector<int> &poly)
  function secret_sharing (line 16) | void secret_sharing(int S, vector<pair<int, int>> &points,
  type fraction (line 37) | struct fraction
    method fraction (line 40) | fraction(int n, int d)
    method reduce_fraction (line 45) | void reduce_fraction(fraction &f)
    method fraction (line 51) | fraction operator*(fraction f)
    method fraction (line 58) | fraction operator+(fraction f)
  function Generate_Secret (line 66) | int Generate_Secret(int x[], int y[], int M)
  function solve (line 86) | void solve(int S, int N, int K)
  function main (line 108) | int main()

FILE: Algorithms/Cryptography/Vernam_Cipher/Vernam_Cipher.cpp
  function apply_vernam (line 10) | void apply_vernam(void *data, void const * key, const size_t size)
  function generate_key (line 44) | void generate_key(void *key, const size_t size)
  function main (line 80) | int main()

FILE: Algorithms/Cryptography/Vernam_Cipher/Vernam_Cipher.py
  function vernam_enc (line 5) | def vernam_enc(msg):
  function main (line 65) | def main():

FILE: Algorithms/Cryptography/Vigenere_Cipher/Vigenere_Cipher.cpp
  function positive_modulo (line 11) | unsigned positive_modulo(const int x, const int div)
  function is_letter (line 21) | bool is_letter(const unsigned char ch)
  function encrypt_vigenere (line 36) | std::string encrypt_vigenere(const std::string &plaintext, const std::st...
  function decrypt_vigenere (line 62) | std::string decrypt_vigenere(const std::string &ciphertext, const std::s...
  function main (line 89) | int main()

FILE: Algorithms/Cryptography/Vigenere_Cipher/Vigenere_Cipher.py
  function create_key (line 3) | def create_key(msg, key):
  function encrypt (line 12) | def encrypt(msg, key):
  function decrypt (line 23) | def decrypt(msg, key):

FILE: Algorithms/Cryptography/Vigenere_Cipher/Vignere_Cipher.cs
  class Program (line 5) | public class Program
    method wrap (line 10) | static int wrap(int k, int n)
    method VignereCipher (line 16) | static string VignereCipher(string plaintext, string key)
    method VignereDecipher (line 39) | static string VignereDecipher(string ciphertext, string key)
    method Main (line 63) | public static void Main(string[] args)

FILE: Algorithms/Cryptography/Vigenere_Cipher/vigenereCipher.py
  function vignereCipher (line 1) | def vignereCipher(plain_text, key):
  function decryptVignereCipher (line 14) | def decryptVignereCipher(cipher_text, key):

FILE: Algorithms/DP/0-1_Knapsack_Problem/0-1 Knapsack Problem.java
  class Knapsack (line 3) | public class Knapsack {
    method max (line 6) | static int max(int a, int b)
    method knapSack (line 12) | static int knapSack(int W, int wt[], int val[], int n)
    method main (line 35) | public static void main(String args[])

FILE: Algorithms/DP/0-1_Knapsack_Problem/Branch_And_Bound/0-1_knapsack.cpp
  type Item (line 8) | struct Item
  type Node (line 16) | struct Node
  function cmp (line 30) | bool cmp(Item a, Item b)
  function bound (line 40) | int bound(Node u, int n, int W, Item arr[])
  function knapsack (line 74) | int knapsack(int W, Item arr[], int n)
  function main (line 146) | int main()

FILE: Algorithms/DP/0-1_Knapsack_Problem/knapsackProblem.java
  class knapsackProblem (line 3) | public class knapsackProblem {
    method max (line 6) | static int max(int a, int b)
    method knapSack (line 12) | static int knapSack(int W, int wt[], int val[], int n)
    method main (line 35) | public static void main(String args[])

FILE: Algorithms/DP/0-1_Knapsack_Problem/knapsack_problem_0_1.cpp
  function max (line 3) | int max(int x, int y)
  function knapSack (line 7) | int knapSack(int W, int w[], int v[], int n)
  function main (line 25) | int main()

FILE: Algorithms/DP/0-1_Knapsack_Problem/knapsack_problem_0_1.py
  function knapsack (line 4) | def knapsack(val, wt, N, C):

FILE: Algorithms/DP/AdjacentBitCounts.cpp
  function findAns (line 20) | int findAns(int n, int k, int firstBit, int ***dp)
  function main (line 47) | int main()

FILE: Algorithms/DP/AdjacentBitCounts.js
  function countStrings (line 4) | function countStrings(n, k) {

FILE: Algorithms/DP/Bitmask DP/TravellingSalesman.cpp
  function solve (line 8) | int solve(int i, int mask, int n)
  function main (line 29) | signed main()

FILE: Algorithms/DP/Branch_And_Bound/0_1_KnapSack.py
  function knapSack (line 3) | def knapSack(W, wt, val, n):

FILE: Algorithms/DP/Branch_And_Bound/Knapsack_Branch_and_Bound.java
  class Knapsack_Branch_and_Bound (line 4) | public class Knapsack_Branch_and_Bound {
    class Node (line 11) | static class Node {
      method Node (line 16) | Node(int lvl, int val, double cap, double bound) {
    class List (line 26) | static class List {
      method add (line 30) | void add(Node n)
      method get (line 54) | Node get() {
    class Item (line 63) | static class Item {
      method Item (line 67) | Item(double weight, int value) {
    class Sort_Value_By_Weight (line 74) | static class Sort_Value_By_Weight implements Comparator<Item> {
      method compare (line 75) | public int compare(Item a, Item b) {
    method upperBound (line 88) | static double upperBound(Item item[], double cap, int k, int n) {
    method knapsackBnB (line 105) | static void knapsackBnB(Item[] item, int n, Node curr, List list)
    method main (line 131) | public static void main(String[] args) throws IOException{

FILE: Algorithms/DP/Count_Square_Matrices.cpp
  function main (line 4) | int main()

FILE: Algorithms/DP/Count_Square_Matrices.py
  function countSquareMatrices (line 1) | def countSquareMatrices(a, N, M):

FILE: Algorithms/DP/Edit_Distance/Edit_distance.cpp
  function main (line 14) | int main() {

FILE: Algorithms/DP/Edit_Distance/edit_distance.py
  function edit_distance (line 11) | def edit_distance(string1, string2):

FILE: Algorithms/DP/Egg_Drop/Egg_Drop.cpp
  function max (line 4) | int max(int a, int b)
  function EggDrop (line 10) | int EggDrop(int n, int k)
  function main (line 52) | int main()

FILE: Algorithms/DP/Egg_Drop/Egg_Drop.cs
  class Program (line 5) | static class Program
    method Main (line 7) | private static void Main(string[] args)
    method max (line 15) | static int max(int a, int b)
    method eggDrop (line 23) | static int eggDrop(int n, int k)

FILE: Algorithms/DP/Egg_Drop/egg drop.java
  class EggDroppDP (line 1) | public class EggDroppDP {
    method getDrops (line 3) | public int getDrops(int eggs, int floors){
    method main (line 32) | public static void main(String[] args) {

FILE: Algorithms/DP/Egg_Drop/egg_drop.py
  function egg_drop (line 3) | def egg_drop(n,k):

FILE: Algorithms/DP/Fibonacci_Series/Fibonacci.c
  function main (line 2) | int main()

FILE: Algorithms/DP/Fibonacci_Series/Fibonacci.php
  function fibonacci (line 13) | function fibonacci(int $n) : int {

FILE: Algorithms/DP/Fibonacci_Series/fibonacci.go
  function Fibonacci (line 5) | func Fibonacci(n uint) uint64 {
  function main (line 19) | func main() {

FILE: Algorithms/DP/Fibonacci_Series/fibonacci.js
  function fibonacci (line 4) | function fibonacci(n, memoizer) {

FILE: Algorithms/DP/Fibonacci_Series/fibonacci.py
  function fibonacci (line 1) | def fibonacci(n):

FILE: Algorithms/DP/Gauss_Easter_Date/CalculateEasterDate.java
  class CalculateEasterDate (line 8) | public class CalculateEasterDate {
    method main (line 19) | public static void main(String[] args) {
    method gaussEaster (line 24) | static void gaussEaster(int year) {
    method is29Days (line 43) | private static boolean is29Days(Double days, Double daysToSunday) {
    method is28Days (line 47) | private static boolean is28Days(Double days, Double daysToSunday) {
    method getGaussNumbers (line 51) | private static Map<String, Double> getGaussNumbers(int year) {
    method calculateCentury (line 69) | private static Double calculateCentury(Double yearsDividedBy100) {

FILE: Algorithms/DP/Gauss_Easter_Date/Gauss_Easter_Date.cpp
  function main (line 6) | int main()
  function gaussAlgorithm (line 19) | void gaussAlgorithm(int year, int *month, int *day) //https://math.stack...

FILE: Algorithms/DP/Gauss_Easter_Date/Gauss_Easter_Date.php
  function Gauss_Easter (line 2) | function Gauss_Easter($year){

FILE: Algorithms/DP/Gauss_Easter_Date/Gauss_Easter_Date.py
  function Easter (line 3) | def Easter(Year):

FILE: Algorithms/DP/Gauss_Easter_Date/Gauss_Easter_Date.rb
  function gauss_easter (line 1) | def gauss_easter(y)

FILE: Algorithms/DP/Gauss_Easter_Date/easterDate.cpp
  function main (line 6) | int main()

FILE: Algorithms/DP/Gauss_Easter_Date/easterDate.go
  function getEasterDate (line 5) | func getEasterDate(_year int) {
  function main (line 19) | func main() {

FILE: Algorithms/DP/Gauss_Easter_Date/easterDate.java
  class Main (line 6) | class Main {
    method gaussEaster (line 8) | static void gaussEaster(int Y)
    method main (line 62) | public static void main(String[] args)

FILE: Algorithms/DP/Gold_Mine_Problem/goldmine.java
  class goldmine (line 4) | class goldmine {
    method getMaxGold (line 12) | static int getMaxGold(int gold[][], int m, int n)
    method main (line 68) | public static void main(String arg[])

FILE: Algorithms/DP/Gold_Mine_Problem/goldmine.py
  function getMaxGold (line 4) | def getMaxGold(gold, m, n):

FILE: Algorithms/DP/Golomb_Sequence/Golomb Sequence.cpp
  function printGolomb (line 4) | void printGolomb(int n)
  function main (line 15) | int main()

FILE: Algorithms/DP/Golomb_Sequence/Golomb.cpp
  function printGolomb (line 8) | void printGolomb(int n)
  function main (line 25) | int main()

FILE: Algorithms/DP/Golomb_Sequence/Golomb.java
  class Golomb (line 3) | class Golomb
    method printGolomb (line 6) | public static void printGolomb(int n)
    method main (line 18) | public static void main (String[] args)

FILE: Algorithms/DP/Golomb_Sequence/golomb.py
  function findGolomb (line 2) | def findGolomb(n):
  function printGolomb (line 9) | def printGolomb(n):

FILE: Algorithms/DP/Knight_Probability/Knight_Probability_in_a_ChessBoard.cpp
  function knightProbability (line 4) | double knightProbability(int N, int K, int sr, int sc)
  function main (line 33) | int main()

FILE: Algorithms/DP/LCS/LCS_of_three_strings.py
  function three_LCS (line 1) | def three_LCS(A,B,C):

FILE: Algorithms/DP/LCS/LongestCommonSubsequence.cpp
  function LCS (line 4) | int LCS(string s1, string s2){//function to get the longest common subse...
  function main (line 16) | int main()

FILE: Algorithms/DP/LCS/LongestCommonSubsequenceLength.java
  class LongestCommonSubsequenceLength (line 2) | class LongestCommonSubsequenceLength{
    method main (line 3) | public static void main(String[]args){

FILE: Algorithms/DP/LCS/Longest_Common_Subsequence_of_Three_String.java
  class LCS3Strings (line 3) | class LCS3Strings {
    method lcsOf3 (line 4) | public static int lcsOf3(String X, String Y, String Z, int m,int n, in...
    method main (line 33) | public static void main(String args[])

FILE: Algorithms/DP/LCS/Longest_Common_Subsequence_of_Two_Sequences.c
  function max (line 18) | int max(int a,int b) {
  function main (line 25) | int main() {

FILE: Algorithms/DP/LCS/Longest_Common_Subsequence_of_Two_Sequences.cpp
  function max (line 18) | int max(int a,int b) {
  function main (line 25) | int main() {

FILE: Algorithms/DP/LCS/lcs_of_3_strings.cpp
  function main (line 14) | signed main()

FILE: Algorithms/DP/LIS/LIS.c
  function lis (line 5) | int lis( int arr[], int n )
  function main (line 31) | int main()

FILE: Algorithms/DP/LIS/LIS.cpp
  function main (line 36) | int main()

FILE: Algorithms/DP/LIS/LIS.go
  function binarySearch (line 5) | func binarySearch(array []int, l int, r int, key int) int {
  function LongestIncreasingSubsequence (line 20) | func LongestIncreasingSubsequence(input []int) int {
  function main (line 43) | func main() {

FILE: Algorithms/DP/LIS/LIS.java
  class Main (line 21) | class Main
    method findLIS (line 23) | public static void findLIS(int[] arr)
    method main (line 64) | public static void main(String[] args)

FILE: Algorithms/DP/LIS/LongestIncreaseSubSequence.cpp
  function lis (line 4) | int lis(int* input, int n) {
  function main (line 29) | int main() {

FILE: Algorithms/DP/LIS/lis.py
  function lis (line 1) | def lis(arr):

FILE: Algorithms/DP/LSCS/LSCS.c
  function largest_subarray_sum (line 4) | int largest_subarray_sum(int *arr, int size)

FILE: Algorithms/DP/LSCS/LSCS.cpp
  function maxSubArraySum (line 5) | int maxSubArraySum(int a[], int size)

FILE: Algorithms/DP/LSCS/lscs.go
  function max (line 5) | func max(x, y int) int {
  function sol (line 12) | func sol(s1 string, s2 string, n int, m int) int {
  function main (line 29) | func main() {

FILE: Algorithms/DP/LSCS/lscs.py
  function find_max_subarray (line 1) | def find_max_subarray(alist, start, end):

FILE: Algorithms/DP/LSCS/shortest_common_supersequence.c
  function max (line 2) | int max(int a,int b)
  function sol (line 6) | int sol(char* s1,char* s2,int n,int m)
  function main (line 27) | int main() {

FILE: Algorithms/DP/Largest Divisible Subset.cpp
  function largestDivisibleSubset (line 21) | vector<int> largestDivisibleSubset(vector<int>& nums)
  function main (line 54) | int main()

FILE: Algorithms/DP/Largest divisible subset in array/file.py
  function findLargest (line 4) | def findLargest(arr, n):

FILE: Algorithms/DP/Largest_Divisible_Subsets.java
  class DivSubset (line 3) | public class DivSubset {
    method findLargest (line 7) | static void findLargest(int[] arr) {
    method main (line 37) | public static void main(String[] args) {

FILE: Algorithms/DP/Largest_Divisible_Subsets.py
  function largestDivisibleSubset (line 1) | def largestDivisibleSubset(nums):

FILE: Algorithms/DP/Largest_Sum_Contiguous_Subarray/C++_Implementation/src/functions.cpp
  function Kadane (line 4) | int Kadane(int arr[], int size)

FILE: Algorithms/DP/Largest_Sum_Contiguous_Subarray/C++_Implementation/src/main.cpp
  function main (line 5) | int main()

FILE: Algorithms/DP/Largest_Sum_Contiguous_Subarray/Kadane's Algorithm.cpp
  function main (line 6) | int main() {

FILE: Algorithms/DP/Largest_Sum_Contiguous_Subarray/LSCS.cpp
  function Kadane (line 3) | int Kadane(int arr[], int size)

FILE: Algorithms/DP/Largest_Sum_Contiguous_Subarray/lscs.c
  function max (line 3) | int max(int a,int b)
  function maxSubArray (line 12) | int maxSubArray(int* nums, int numsSize){
  function main (line 39) | int main() {

FILE: Algorithms/DP/MOS_Algorithm.cpp
  type Mo (line 11) | struct Mo
    method process (line 17) | void process(int number, int delta)
    method Mo (line 24) | Mo()
    method get_answer (line 30) | long long get_answer() const
    method add (line 35) | void add(int number)
    method remove (line 40) | void remove(int number)
  function main (line 46) | int main()

FILE: Algorithms/DP/Max_Product_Subarray/max_product_subarray.py
  function max_product (line 1) | def max_product(nums):

FILE: Algorithms/DP/Maximum_Achievable_Coins/Maximum_Achievable_Coins.php
  function maxAchieveable (line 2) | function maxAchieveable($num)

FILE: Algorithms/DP/Maximum_Achievable_Coins/Maximum_Achievable_coins.c
  function swap (line 3) | void swap(int *xp, int *yp)
  function bubbleSort (line 11) | void bubbleSort(int arr[], int n)
  function main (line 22) | int main(void) {

FILE: Algorithms/DP/Maximum_Achievable_Coins/Maximum_Achievable_coins.java
  class MaximumAchievablecoins (line 2) | class MaximumAchievablecoins {
    method Maximum_Achievable_coins (line 4) | static int Maximum_Achievable_coins(
    method main (line 36) | public static void main(String[] args)

FILE: Algorithms/DP/Maximum_Achievable_Coins/Maximum_Achievable_coins.py
  function Maximum_Achievable_coins (line 1) | def Maximum_Achievable_coins(arr, n):

FILE: Algorithms/DP/Maximum_Achievable_Coins/maximum_achievable_coins.cpp
  function optimalStrategyOfGame (line 6) | int optimalStrategyOfGame(
  function main (line 36) | int main()

FILE: Algorithms/DP/Minimum_Sum_Descent/min-sum.c
  function minimum (line 26) | int minimum(int a, int b){
  function tabular (line 33) | int tabular(int ** arr,  int n){
  function main (line 45) | int main(){

FILE: Algorithms/DP/Minimum_Sum_Descent/minsum.cs
  class Program (line 7) | class Program
    method Main (line 9) | static void Main(string[] args)
  class Triangle (line 19) | class Triangle
    method minSumPath (line 22) | public static int minSumPath(ref List<List<int>> A)

FILE: Algorithms/DP/Minimum_Sum_Descent/minsum.go
  function main (line 7) | func main() {
  function minimum (line 44) | func minimum(a, b int) int {
  function tabular (line 54) | func tabular(arr [][]int, n int) int {

FILE: Algorithms/DP/Partition_Sum/DP_PartitionSum.java
  class DP_PartitionSum (line 4) | public class DP_PartitionSum
    method checking (line 6) | public static boolean checking(int arr[],int SUM)
    method main (line 34) | public static void main(String[] args)

FILE: Algorithms/DP/Partition_Sum/partition_sum.c
  function findPartiion (line 5) | int findPartiion (int arr[], int n)
  function main (line 42) | int main()

FILE: Algorithms/DP/Partition_Sum/partition_sum.cpp
  function findPartiion (line 6) | bool findPartiion (int arr[], int n)
  function main (line 44) | int main()

FILE: Algorithms/DP/Partition_Sum/partition_sum.cs
  class GFG (line 4) | class GFG {
    method isSubsetSum (line 8) | static bool isSubsetSum(int[] arr, int n, int sum)
    method findPartition (line 32) | static bool findPartition(int[] arr, int n)
    method Main (line 50) | public static void Main()

FILE: Algorithms/DP/Partition_Sum/partition_sum.php
  function partitionSum (line 4) | function partitionSum(array $input): array

FILE: Algorithms/DP/Recaman's Sequence.c
  function main (line 3) | int main()

FILE: Algorithms/DP/Scramble Strings/ScrambleString.cpp
  function scramble (line 5) | bool scramble(string s1,string s2)
  function isScramble (line 33) | bool isScramble(string s1, string s2) {
  function main (line 45) | int main()

FILE: Algorithms/DP/Shortest_Common_Supersequence/shortest_common_sequence.java
  class Solution (line 1) | class Solution {
    method shortestCommonSupersequence (line 3) | public String shortestCommonSupersequence(String str1, String str2) {

FILE: Algorithms/DP/Shortest_Common_Supersequence/shortest_common_supersequence.cpp
  function max (line 4) | int max(int a, int b)
  function shortestSuperSequence (line 11) | int shortestSuperSequence(string X, string Y)
  function lcs (line 20) | int lcs(string X,string Y,int m,int n)
  function main (line 40) | int main()

FILE: Algorithms/DP/Shortest_Common_Supersequence/shortest_common_supersequence.cs
  class SCS (line 3) | class SCS
    method printShortestSuperSeq (line 7) | static String printShortestSuperSeq(String X, String Y)
    method reverse (line 96) | static String reverse(String input)
    method Main (line 112) | public static void Main(String[] args)

FILE: Algorithms/DP/Shortest_Common_Supersequence/shortest_common_supersequence.js
  function shortestCommonSuperstring (line 4) | function shortestCommonSuperstring(str1, str2) {

FILE: Algorithms/DP/Shortest_Common_Supersequence/shortest_common_supersequence.py
  function superSeq (line 7) | def superSeq(X, Y, m, n):

FILE: Algorithms/DP/Sudoku_Solver/SudokuSolver.java
  class SudokuSolver (line 3) | class SudokuSolver {
    class FastReader (line 4) | static class FastReader{
      method FastReader (line 7) | FastReader(){
      method next (line 10) | String next(){
      method nextInt (line 21) | int nextInt(){
    method main (line 25) | public static void main(String[] args) {
    method isSafe (line 36) | public static boolean isSafe(int[][] board,int row,int col,int index){
    method solveSudoku (line 61) | public static void solveSudoku(int[][] board, int row, int col){

FILE: Algorithms/DP/Sudoku_Solver/SudokuSolver.py
  function print_grid (line 2) | def print_grid(arr):
  function find_empty_location (line 9) | def find_empty_location(arr, l):
  function used_in_row (line 18) | def used_in_row(arr, row, num):
  function used_in_col (line 24) | def used_in_col(arr, col, num):
  function used_in_box (line 30) | def used_in_box(arr, row, col, num):
  function check_location_is_safe (line 37) | def check_location_is_safe(arr, row, col, num):
  function solve_sudoku (line 41) | def solve_sudoku(arr):

FILE: Algorithms/DP/Sudoku_Solver/Sudoku_Solver.cpp
  function SolveSudoku (line 18) | bool SolveSudoku(int grid[N][N])
  function FindUnassignedLocation (line 47) | bool FindUnassignedLocation(int grid[N][N],
  function UsedInRow (line 58) | bool UsedInRow(int grid[N][N], int row, int num)
  function UsedInCol (line 67) | bool UsedInCol(int grid[N][N], int col, int num)
  function UsedInBox (line 76) | bool UsedInBox(int grid[N][N], int boxStartRow,
  function isSafe (line 89) | bool isSafe(int grid[N][N], int row,
  function printGrid (line 101) | void printGrid(int grid[N][N])
  function main (line 111) | int main()

FILE: Algorithms/DP/Sudoku_Solver/Sudoku_Solver.cs
  class GFG (line 3) | class GFG {
    method isSafe (line 5) | public static bool isSafe(int[, ] board,
    method solveSudoku (line 38) | public static bool solveSudoku(int[, ] board, int n)
    method print (line 76) | public static void print(int[, ] board, int N)
    method Main (line 90) | public static void Main(String[] args)

FILE: Algorithms/DP/Sudoku_Solver/Sudoku_Solver.js
  function isValid (line 17) | function isValid(board, row, col, k) {
  function sodokuSolver (line 29) | function sodokuSolver(data) {

FILE: Algorithms/DP/Target_Sum/Target_Sum.c
  function CntSum (line 4) | int CntSum(int arr[], int N, int required_sum)
  function main (line 23) | int main()

FILE: Algorithms/DP/Target_Sum/Target_Sum.cpp
  function SubsetSum (line 5) | int SubsetSum(int arr[],int n, int sum)
  function main (line 27) | int main()

FILE: Algorithms/DP/Target_Sum/Target_Sum.java
  class Target_Sum (line 4) | public class Target_Sum
    method Sum (line 7) | static int Sum(int arr[], int n, int i,
    method main (line 25) | public static void main(String[] args)

FILE: Algorithms/DP/Target_Sum/Target_Sum.js
  function targetSum (line 1) | function targetSum(arr, target) {
  function countSub (line 5) | function countSub(arr, n, i, sum, count) {

FILE: Algorithms/DP/Target_Sum/Target_Sum.py
  function findNumberOfSubsetsMemo (line 7) | def findNumberOfSubsetsMemo(arr, i, targetSum, n) :
  function findNumberOfSubsetsRecur (line 34) | def findNumberOfSubsetsRecur(arr, n, i,sum, count):

FILE: Algorithms/DP/Tower_Of_Hanoi/TOH.java
  class TowersOfHanoi (line 5) | public class TowersOfHanoi {
    method solveTowersOfHanoi (line 7) | public void solveTowersOfHanoi(int n, String source, String aux, Strin...
    method main (line 27) | public static void main(String args[])

FILE: Algorithms/DP/Tower_Of_Hanoi/Tower_Of_Hanoi.cs
  class Tower_Of_Hanoi (line 5) | class Tower_Of_Hanoi
    method Main (line 7) | static void Main(string[] args)
    method TowerOfHanoi (line 26) | public static void TowerOfHanoi(int numDisk, char source, char auxilia...

FILE: Algorithms/DP/Tower_Of_Hanoi/Tower_Of_Hanoi.js
  function Tower_Of_Hanoi (line 3) | function Tower_Of_Hanoi () {

FILE: Algorithms/DP/Tower_Of_Hanoi/Tower_of_hanoi.ts
  function solveHanoi (line 1) | function solveHanoi(

FILE: Algorithms/DP/Tower_Of_Hanoi/tower_of_hanoi.c
  function hanoi (line 3) | void hanoi(char from, char helper, char to, int n) {
  function main (line 16) | int main() {

FILE: Algorithms/DP/Tower_Of_Hanoi/tower_of_hanoi.cpp
  function towerOfHanoi (line 5) | void towerOfHanoi(char from,char to,char aux,int n){
  function main (line 16) | int main(){

FILE: Algorithms/DP/Tower_Of_Hanoi/tower_of_hanoi.go
  function main (line 16) | func main() {
  function moveTower (line 37) | func moveTower(height int, from int, to int, help int) {
  function moveDisc (line 47) | func moveDisc(index int, from int, to int) {
  function printStacks (line 56) | func printStacks() {

FILE: Algorithms/DP/Tower_Of_Hanoi/tower_of_hanoi.py
  function TowerOfHanoi (line 1) | def TowerOfHanoi(n , source, destination, auxiliary):

FILE: Algorithms/DP/TrappingWater/TrappingWater.cpp
  function trap (line 8) | int trap(vector<int>& h) {
  function main (line 30) | int main(){

FILE: Algorithms/DP/Water_Area/Water-area.py
  function waterArea (line 3) | def waterArea(heights):

FILE: Algorithms/DP/Water_Area/water_area.rb
  function calculateWaterArea (line 3) | def calculateWaterArea(pillarHeights)

FILE: Algorithms/DP/Z_Algorithm/Z_Algo.py
  function get_Z_arr (line 17) | def get_Z_arr(pattern, text):
  function ZSearch (line 77) | def ZSearch(text, pattern):
  function main (line 90) | def main():

FILE: Algorithms/DP/creating an string input function in C.c
  function input (line 3) | int input(char str[],int n)
  function main (line 16) | int main()

FILE: Algorithms/DP/partition_sum.py
  function findPartition (line 1) | def findPartition(arr, n):

FILE: Algorithms/DP/rod-cutting-problem.cpp
  function rodCut (line 13) | int rodCut(vector<int> price,int n){
  function main (line 28) | int main() {

FILE: Algorithms/Graph/A_Star/A_star.cpp
  type cell (line 7) | struct cell
  function isValid (line 12) | bool isValid(int row, int col)
  function isUnBlocked (line 17) | bool isUnBlocked(int grid[][COL], int row, int col)
  function isDestination (line 25) | bool isDestination(int row, int col, Pair dest)
  function calculateHValue (line 33) | double calculateHValue(int row, int col, Pair dest)
  function tracePath (line 38) | void tracePath(cell cellDetails[][COL], Pair dest)
  function aStarSearch (line 66) | void aStarSearch(int grid[][COL], Pair src, Pair dest)
  function main (line 441) | int main()

FILE: Algorithms/Graph/A_Star/A_star.cs
  class AStar (line 12) | public class AStar
    method AStar (line 18) | public AStar(IList<Node> nodes, Point start, Point finish)
    method GetPath (line 25) | public IEnumerable<Point> GetPath()
    method PathExists (line 43) | private bool PathExists(Node currentNode)
    method GetSurroundingWalkableNodes (line 69) | private IEnumerable<Node> GetSurroundingWalkableNodes(Node currentNode)
    method GetSurroundingPoints (line 98) | private IEnumerable<Point> GetSurroundingPoints(Node currentNode)
    method UpdateNodeParameters (line 106) | private Node UpdateNodeParameters(Node nextNode, Node currentNode)
    method StraightLineDistance (line 126) | private double StraightLineDistance(Point a, Point b)
    method ReadPath (line 133) | private IEnumerable<Point> ReadPath()
  class Node (line 149) | public class Node
    method Node (line 159) | public Node(int x, int y, bool isWalkable)
  type NodeState (line 166) | public enum NodeState
  class Tools (line 223) | public static class Tools {
    method PrintMaze (line 224) | public static void PrintMaze(List<Node> maze, IList<Point> solution, P...
    method GetCharacter (line 246) | private static char GetCharacter(IList<Point> solution, Point? start, ...
    method SetConsoleColor (line 257) | private static void SetConsoleColor(IList<Point> solution, Node node, ...

FILE: Algorithms/Graph/A_Star/A_star.py
  class Node (line 1) | class Node:
    method __init__ (line 2) | def __init__(self, position:(), parent:()):
    method __eq__ (line 8) | def __eq__(self, other):
    method __lt__ (line 10) | def __lt__(self, other):
    method __repr__ (line 13) | def __repr__(self):
  function draw_grid (line 16) | def draw_grid(map, width, height, spacing=2, **kwargs):
  function draw_tile (line 22) | def draw_tile(map, position, kwargs):
  function astar_search (line 32) | def astar_search(map, start, end):
  function add_to_open (line 81) | def add_to_open(open, neighbor):
  function main (line 86) | def main():

FILE: Algorithms/Graph/A_Star/A_star.ts
  class GraphNode (line 8) | class GraphNode {
    method constructor (line 16) | constructor(position: Position, parent?: GraphNode) {
    method isEqual (line 24) | isEqual(other: Position): boolean {
  class Position (line 169) | class Position {
    method constructor (line 170) | constructor(public x: number, public y: number) {}

FILE: Algorithms/Graph/A_Star/astar.py
  class Node (line 1) | class Node():
    method __init__ (line 2) | def __init__(self, parent=None, position=None):
    method __eq__ (line 8) | def __eq__(self, other):
  function astar (line 10) | def astar(maze, start, end):
  function main (line 56) | def main():

FILE: Algorithms/Graph/BFS/BFS.c
  type queue (line 7) | struct queue {
  type queue (line 13) | struct queue
  type queue (line 14) | struct queue
  type queue (line 15) | struct queue
  type queue (line 16) | struct queue
  type queue (line 17) | struct queue
  type queue (line 18) | struct queue
  type node (line 20) | struct node {
  type node (line 25) | struct node
  type Graph (line 27) | struct Graph {
  function bfs (line 34) | void bfs(struct Graph* graph, int startVertex) {
  type node (line 60) | struct node
  type node (line 61) | struct node
  type node (line 61) | struct node
  type Graph (line 68) | struct Graph
  type Graph (line 69) | struct Graph
  type Graph (line 69) | struct Graph
  type node (line 72) | struct node
  function addEdge (line 85) | void addEdge(struct Graph* graph, int src, int dest) {
  type queue (line 98) | struct queue
  type queue (line 99) | struct queue
  type queue (line 99) | struct queue
  function isEmpty (line 106) | int isEmpty(struct queue* q) {
  function enqueue (line 114) | void enqueue(struct queue* q, int value) {
  function dequeue (line 126) | int dequeue(struct queue* q) {
  function printQueue (line 143) | void printQueue(struct queue* q) {
  function main (line 156) | int main() {

FILE: Algorithms/Graph/BFS/BFS.cpp
  class Graph (line 8) | class Graph
  function main (line 76) | int main()

FILE: Algorithms/Graph/BFS/BFS.go
  type node (line 11) | type node struct
  function Nodes (line 17) | func Nodes(n *node) []*node {
  function main (line 49) | func main() {

FILE: Algorithms/Graph/BFS/BFS.java
  class Graph (line 6) | class Graph
    method Graph (line 12) | Graph(int v)
    method addEdge (line 21) | void addEdge(int v,int w)
    method BFS (line 27) | void BFS(int s)
    method main (line 63) | public static void main(String args[])

FILE: Algorithms/Graph/BFS/BFS.py
  function BFS (line 9) | def BFS(graph, point, explored, to_explore):

FILE: Algorithms/Graph/BFS/BFS.rb
  function bfs (line 1) | def bfs(node)

FILE: Algorithms/Graph/BFS/bfs.js
  function bfs (line 1) | function bfs(at) {
  function addNode (line 27) | function addNode(node) {
  function addEdge (line 32) | function addEdge(origin, destination) {

FILE: Algorithms/Graph/Bellman_Ford/BellMan_Ford.py
  class Graph (line 4) | class Graph:
    method __init__ (line 7) | def __init__(self, nodes):
    method createEdge (line 13) | def createEdge(self, u, v, weight):
  class Solution (line 22) | class Solution:
    method printSoln (line 25) | def printSoln(self, dist, src):
    method bellmanFord (line 31) | def bellmanFord(self, graph, src):

FILE: Algorithms/Graph/Bellman_Ford/bellmanFord.cpp
  type Edge (line 6) | struct Edge {
  type Graph (line 12) | struct Graph {
    type Edge (line 17) | struct Edge
  type Graph (line 21) | struct Graph
    type Edge (line 17) | struct Edge
  type Graph (line 23) | struct Graph
    type Edge (line 17) | struct Edge
  function printArr (line 31) | void printArr(int dist[], int n)
  function BellmanFord (line 41) | void BellmanFord(struct Graph* graph, int src)
  function main (line 86) | int main()

FILE: Algorithms/Graph/Bellman_Ford/bellman_ford.c
  type Edge (line 6) | struct Edge
  type Graph (line 14) | struct Graph
  type Graph (line 23) | struct Graph
  type Graph (line 25) | struct Graph
  type Graph (line 25) | struct Graph
  type Graph (line 25) | struct Graph
  type Edge (line 32) | struct Edge
  type Edge (line 32) | struct Edge
  function FinalSolution (line 38) | void FinalSolution(int dist[], int n)
  function BellmanFord (line 49) | void BellmanFord(struct Graph* graph, int source)
  function main (line 104) | int main()

FILE: Algorithms/Graph/Bidirectional_search/Bidirectional_Search.py
  class AdjacentNode (line 6) | class AdjacentNode:
    method __init__ (line 8) | def __init__(self, vertex):
  class BidirectionalSearch (line 14) | class BidirectionalSearch:
    method __init__ (line 16) | def __init__(self, vertices):
    method add_edge (line 39) | def add_edge(self, src, dest):
    method bfs (line 55) | def bfs(self, direction = 'forward'):
    method is_intersecting (line 89) | def is_intersecting(self):
    method print_path (line 101) | def print_path(self, intersecting_node,
    method bidirectional_search (line 127) | def bidirectional_search(self, src, dest):

FILE: Algorithms/Graph/Bidirectional_search/Bidirectional_search.cpp
  class Graph (line 8) | class Graph
  function main (line 167) | int main()

FILE: Algorithms/Graph/Bidirectional_search_algo.py
  class AdjacentNode (line 3) | class AdjacentNode:
    method __init__ (line 5) | def __init__(self, vertex):
  class BidirectionalSearch (line 9) | class BidirectionalSearch:
    method __init__ (line 10) | def __init__(self, vert):
    method add_edge (line 21) | def add_edge(self, src, dest):
    method bfs (line 30) | def bfs(self, direction='forward'):
    method is_intersecting (line 55) | def is_intersecting(self):
    method print_path (line 66) | def print_path(self, intersecting_node,src, dest):                  # ...
    method bidirectional_search (line 87) | def bidirectional_search(self, src, dest):

FILE: Algorithms/Graph/DFS/DFS.cpp
  class Graph (line 8) | class Graph
  function main (line 70) | int main()

FILE: Algorithms/Graph/DFS/DFS.java
  class Graph (line 7) | class Graph
    method Graph (line 15) | @SuppressWarnings("unchecked")
    method addEdge (line 25) | void addEdge(int v, int w)
    method DFSUtil (line 31) | void DFSUtil(int v,boolean visited[])
    method DFS (line 48) | void DFS(int v)
    method main (line 58) | public static void main(String args[])

FILE: Algorithms/Graph/DFS/Depth First Search[DFS].cpp
  class Graph (line 7) | class Graph {
  function main (line 43) | int main() {

FILE: Algorithms/Graph/DFS/dfs.js
  function dfs (line 1) | function dfs(at) {
  function addNode (line 16) | function addNode(node) {
  function addEdge (line 21) | function addEdge(origin, destination) {

FILE: Algorithms/Graph/DFS/dfs.py
  class Graph (line 28) | class Graph(object):
    method __init__ (line 29) | def __init__(self):
    method addNode (line 33) | def addNode(self, node):
    method addEdge (line 37) | def addEdge(self, edge):
    method peek (line 41) | def peek(self):
  function dfs (line 69) | def dfs(currNode):

FILE: Algorithms/Graph/DSU/dsu.cpp
  class AbstractDSU (line 50) | class AbstractDSU
    method process_set_boundaries (line 70) | bool process_set_boundaries(int x)
    method AbstractDSU (line 78) | AbstractDSU(int n) : prev(n + 1), rank(n + 1)
    method find_set (line 92) | int find_set(int v)
    method union_sets (line 107) | void union_sets(int a, int b)
  class DSUBySize (line 133) | class DSUBySize : public AbstractDSU
    method DSUBySize (line 138) | DSUBySize(int n) : AbstractDSU(n) {}
    method update_rank (line 139) | void update_rank(int x, int y)
  class DSUByRank (line 145) | class DSUByRank : public AbstractDSU
    method DSUByRank (line 150) | DSUByRank(int n) : AbstractDSU(n) {}
    method update_rank (line 151) | void update_rank(int x, int y)
  function main (line 160) | int main()

FILE: Algorithms/Graph/DSU/dsu.py
  class AbstractDSU (line 51) | class AbstractDSU:
    method __init__ (line 66) | def __init__(self, n):
    method _process_set_boundaries (line 70) | def _process_set_boundaries(self, x):
    method find_set (line 84) | def find_set(self, v):
    method union_sets (line 101) | def union_sets(self, a, b):
    method update_ranks (line 123) | def update_ranks(self, x, y):
  class DSUBySize (line 135) | class DSUBySize(AbstractDSU):
    method update_ranks (line 138) | def update_ranks(self, x, y):
  class DSUByRank (line 142) | class DSUByRank(AbstractDSU):
    method update_ranks (line 145) | def update_ranks(self, x, y):

FILE: Algorithms/Graph/Depth First Transversal/DFT.py
  class graph (line 1) | class graph:
    method __init__ (line 3) | def __init__(self,gdict=None):
  function dfs (line 8) | def dfs(graph, start, visited = None):

FILE: Algorithms/Graph/Dijkstra/Dijikstra.java
  class Dijikstra (line 1) | class Dijikstra {
    method minDistance (line 3) | int minDistance(int dist[], Boolean sptSet[]) {
    method printSolution (line 15) | void printSolution(int dist[]) {
    method dijkstra (line 21) | void dijkstra(int graph[][], int src) {
    method main (line 42) | public static void main(String[] args) {

FILE: Algorithms/Graph/Dijkstra/Dijkstra.c
  function getMinVertex (line 5) | int getMinVertex(bool* visited,int* distance,int n){
  function dijkstra (line 15) | void dijkstra(int** edges,int n){
  function main (line 38) | int main(){

FILE: Algorithms/Graph/Dijkstra/Dijkstra.cpp
  class Graph (line 14) | class Graph{
  function main (line 69) | int main(){

FILE: Algorithms/Graph/Dijkstra/Dijkstra.cs
  class DA (line 3) | class DA {
    method minDistance (line 5) | int minDistance(int[] dist,
    method printSolution (line 18) | void printSolution(int[] dist, int n)
    method dijkstra (line 25) | void dijkstra(int[, ] graph, int src)
    method Main (line 51) | public static void Main()

FILE: Algorithms/Graph/Dijkstra/Dijkstra.go
  type PriorityQueue (line 9) | type PriorityQueue struct
    method Len (line 15) | func (pq *PriorityQueue) Len() int {
    method Less (line 19) | func (pq *PriorityQueue) Less(i, j int) bool {
    method Swap (line 23) | func (pq *PriorityQueue) Swap(i, j int) {
    method Push (line 29) | func (pq *PriorityQueue) Push(x interface{}) {
    method Pop (line 36) | func (pq *PriorityQueue) Pop() interface{} {
    method update (line 45) | func (pq *PriorityQueue) update(item Vertex, priority int) {
    method addWithPriority (line 50) | func (pq *PriorityQueue) addWithPriority(item Vertex, priority int) {
  type Graph (line 56) | type Graph interface
  type Vertex (line 63) | type Vertex
  type DijkstraGraph (line 67) | type DijkstraGraph struct
    method edge (line 83) | func (dg DijkstraGraph) edge(u, v string, w int) {
    method path (line 89) | func (dg DijkstraGraph) path(v Vertex, path map[Vertex]Vertex) (s stri...
    method Vertices (line 97) | func (dg DijkstraGraph) Vertices() []Vertex {
    method Neighbors (line 104) | func (dg DijkstraGraph) Neighbors(u Vertex) []Vertex {
    method Weight (line 111) | func (dg DijkstraGraph) Weight(u, v Vertex) int { return dg.edges[u][v] }
  function NewDijkstraGraph (line 74) | func NewDijkstraGraph(ids map[string]Vertex) DijkstraGraph {
  constant Infinity (line 114) | Infinity      = int(^uint(0) >> 1)
  constant Uninitialized (line 115) | Uninitialized = -1
  function Dijkstra (line 119) | func Dijkstra(g Graph, source Vertex) (dist map[Vertex]int, path map[Ver...
  function main (line 151) | func main() {

FILE: Algorithms/Graph/Dijkstra/Dijkstra.php
  class Vertex (line 3) | class Vertex {
    method __construct (line 6) | public function __construct() {
    method addEdge (line 10) | public function addEdge($to, $d) {
  class MinHeap (line 15) | class MinHeap extends SplPriorityQueue {
    method compare (line 16) | public function compare($p1, $p2) {
  class Graph (line 21) | class Graph {
    method __construct (line 24) | public function __construct() {
    method insertVertex (line 28) | public function insertVertex($label) {
    method insertEdge (line 32) | public function insertEdge($from, $to, $d) {
    method dijkstra (line 36) | public function dijkstra($from, $destination) {
    method pathToString (line 74) | public function pathToString($prev, $destination) {

FILE: Algorithms/Graph/Dijkstra/dijkstra_leftist_heap/WDGraph.cpp
  function VertexNode (line 162) | VertexNode* WDGraph::getVertex(int e) {

FILE: Algorithms/Graph/Dijkstra/dijkstra_leftist_heap/WDGraph.h
  function class (line 30) | class EdgeNode {   // Edges
  function class (line 41) | class VertexNode {   // Adyacency list (linked list)
  function class (line 55) | class WDGraph {

FILE: Algorithms/Graph/Dijkstra/dijkstra_leftist_heap/dijkstra.cpp
  function main (line 19) | int main(int argc, char **argv) {
  function dijkstra (line 47) | void dijkstra(WDGraph g, int src) {
  function readGraph (line 85) | void readGraph(WDGraph &g) {
  function createGraph (line 94) | void createGraph(int N_VERTICES, int MAX_WEIGHT, float EDGE_CHANCE, long...

FILE: Algorithms/Graph/Dijkstra/dijkstra_leftist_heap/leftistHeap.cpp
  function LeftistHeap (line 139) | LeftistHeap& LeftistHeap::operator =(LeftistHeap &h) {
  function Node (line 153) | Node* LeftistHeap::mergeHeaps(Node *heap1, Node *heap2) {
  function Node (line 164) | Node* LeftistHeap::MergeRecursive(Node *heap1, Node *heap2) {
  function Node (line 193) | Node* LeftistHeap::cloneNode(Node *node) {

FILE: Algorithms/Graph/Dijkstra/dijkstra_leftist_heap/leftistHeap.h
  function class (line 31) | class Node {
  function class (line 44) | class LeftistHeap {

FILE: Algorithms/Graph/Dijkstra/djikstra.py
  class Graph (line 3) | class Graph():
    method __init__ (line 5) | def __init__(self, vertices):
    method printSolution (line 10) | def printSolution(self, dist):
    method minDistance (line 15) | def minDistance(self, dist, sptSet):
    method dijkstra (line 26) | def dijkstra(self, src):

FILE: Algorithms/Graph/Flood_Fill/Flood_Fill.cpp
  function floodFillUtil (line 7) | void floodFillUtil(int screen[][N], int x, int y, int prevC, int newC)
  function floodFill (line 24) | void floodFill(int screen[][N], int x, int y, int newC)
  function main (line 30) | int main()

FILE: Algorithms/Graph/Flood_Fill/Flood_Fill.java
  class GFG (line 2) | class GFG
    method floodFillUtil (line 11) | static void floodFillUtil(int screen[][], int x, int y,int prevC, int ...
    method floodFill (line 31) | static void floodFill(int screen[][], int x, int y, int newC)
    method main (line 38) | public static void main(String[] args)

FILE: Algorithms/Graph/Flood_Fill/Flood_Fill.js
  class Image (line 3) | class Image {
    method constructor (line 4) | constructor (imageAsMatrix) {
    method COLORS (line 8) | static get COLORS () {
    method get (line 17) | get () {
    method randomColor (line 21) | randomColor () {
    method buildWhithRandomColors (line 26) | buildWhithRandomColors (rows = 5, cols = 5) {
  class Floodfill (line 34) | class Floodfill {
    method constructor (line 35) | constructor (imageAsMatrix) {
    method get (line 39) | get () {
    method bucket (line 43) | bucket (row, column, newPixel) {
    method fill (line 52) | fill (row, column, newPixel, currentPixel) {
    method fillCurrentPixel (line 67) | fillCurrentPixel (row, column, newPixel) {
    method fillPreviousRow (line 71) | fillPreviousRow (row, column, newPixel, currentPixel) {
    method fillNextRow (line 75) | fillNextRow (row, column, newPixel, currentPixel) {
    method fillPreviousCol (line 79) | fillPreviousCol (row, column, newPixel, currentPixel) {
    method fillNextCol (line 83) | fillNextCol (row, column, newPixel, currentPixel) {
    method rowIsLessThenZero (line 87) | rowIsLessThenZero (row) {
    method columnIsLessThenZero (line 91) | columnIsLessThenZero (column) {
    method rowIsGreaterThenImageLength (line 95) | rowIsGreaterThenImageLength (row) {
    method columnIsGreaterThenImageLength (line 99) | columnIsGreaterThenImageLength (row, column) {
    method currentPixelNoNeedToFill (line 103) | currentPixelNoNeedToFill (row, column, currentPixel) {

FILE: Algorithms/Graph/Flood_Fill/flood_fill_algorithm.cs
  class Uebung1_2 (line 1) | public class Uebung1_2

FILE: Algorithms/Graph/Floyd_Warshall/Floyd_Warshall.c
  function floydWarshall (line 15) | void floydWarshall (int graph[][V])
  function printSolution (line 56) | void printSolution(int dist[][V])
  function main (line 74) | int main()

FILE: Algorithms/Graph/Floyd_Warshall/Floyd_Warshall.cpp
  function floydWarshall (line 14) | void floydWarshall(int graph[][nV]) {
  function printMatrix (line 32) | void printMatrix(int matrix[][nV]) {
  function main (line 44) | int main() {

FILE: Algorithms/Graph/Floyd_Warshall/Floyd_Warshall.java
  class Floyd_Warshall (line 3) | public class Floyd_Warshall {
    method warshall (line 18) | public void warshall() {

FILE: Algorithms/Graph/Floyd_Warshall/Floyd_Warshall.py
  function floydWarshall (line 11) | def floydWarshall(graph):
  function printSolution (line 49) | def printSolution(dist):

FILE: Algorithms/Graph/Hopcroft_Karp/Hopcroft_Karp_algorithm.cpp
  class bipartiteGraph (line 28) | class bipartiteGraph
  function main (line 198) | int main()

FILE: Algorithms/Graph/Johnson_algorithm/Johnson_algorithm.cpp
  type Edge (line 74) | struct Edge {
  type Graph (line 80) | struct Graph {
    type Edge (line 85) | struct Edge
  type Graph (line 89) | struct Graph
    type Edge (line 85) | struct Edge
  type Graph (line 91) | struct Graph
    type Edge (line 85) | struct Edge
  function BellmanFord (line 102) | vector<int> BellmanFord(struct Graph* graph)
  function printSolution (line 155) | void printSolution(int dist[])
  function minDistance (line 165) | int minDistance(int dist[], bool sptSet[], int V)
  function dijkstra (line 179) | void dijkstra(struct Graph* graph, int src, vector<int> h){
  function johnsonAlgorithm (line 221) | void johnsonAlgorithm(struct Graph* graph){
  function main (line 246) | int main()

FILE: Algorithms/Graph/Karger_algorithm/Karger_algorithm.cpp
  type std (line 8) | namespace std {   }
  class karger_graph (line 11) | class karger_graph
    method set (line 14) | void   set(size_t r, size_t c, size_t d) {   _data[(r * _rc) + c] = d;...
    method get (line 15) | size_t get(size_t r, size_t c) const {   return _data[(r * _rc) + c];   }
    method set_size (line 17) | void   set_size(size_t rc) {   _rc = rc;   _data.resize(_rc * _rc);   ...
    method get_size (line 18) | size_t get_size() const {   return _rc;   }
  function karger_graph (line 66) | karger_graph& karger_graph::remove_self_loops()
    method set (line 14) | void   set(size_t r, size_t c, size_t d) {   _data[(r * _rc) + c] = d;...
    method get (line 15) | size_t get(size_t r, size_t c) const {   return _data[(r * _rc) + c];   }
    method set_size (line 17) | void   set_size(size_t rc) {   _rc = rc;   _data.resize(_rc * _rc);   ...
    method get_size (line 18) | size_t get_size() const {   return _rc;   }
  function karger_graph (line 76) | karger_graph& karger_graph::merge_vertices(size_t u, size_t v)
    method set (line 14) | void   set(size_t r, size_t c, size_t d) {   _data[(r * _rc) + c] = d;...
    method get (line 15) | size_t get(size_t r, size_t c) const {   return _data[(r * _rc) + c];   }
    method set_size (line 17) | void   set_size(size_t rc) {   _rc = rc;   _data.resize(_rc * _rc);   ...
    method get_size (line 18) | size_t get_size() const {   return _rc;   }
  function random_contraction_algorithm (line 99) | void random_contraction_algorithm(karger_graph& km)
  function istream (line 127) | istream& operator>>(istream& is, karger_graph& km)
  function ostream (line 149) | ostream& operator<<(ostream& os, const karger_graph& km)
  function main (line 168) | int main(int argc, char* argv[])

FILE: Algorithms/Graph/Kosarajus_Algorithm/kosajaru.rs
  type Node (line 3) | type Node  = usize;
  type Graph (line 4) | type Graph = Vec<Vec<Node>>;
  type Stack (line 5) | type Stack = Vec<Node>;
  function main (line 9) | fn main() {
  function kosajaru (line 50) | fn kosajaru(graph : Graph, n_nodes : usize) -> Vec<usize> {
  function reverse_graph (line 85) | fn reverse_graph(graph : &Graph) -> Graph{
  function dfs_traversal (line 106) | fn dfs_traversal(graph : &Graph, v : Node, memo : &mut Vec<Node>, stack ...
  function dfs_color (line 119) | fn dfs_color(graph : &Graph, v : Node, memo : &mut Vec<Node>, color : us...

FILE: Algorithms/Graph/Kosarajus_Algorithm/kosaraju.ts
  class Graph (line 3) | class Graph {
    method constructor (line 6) | constructor(vertices: number) {
    method addEdge (line 14) | addEdge(v: number, w: number): void {
    method printSCCs (line 18) | printSCCs(): void {
    method fillOrder (line 46) | fillOrder(v: number, visited: boolean[], stack: number[]): void {
    method getTranspose (line 62) | getTranspose(): Graph {
    method DFSUtil (line 74) | DFSUtil(v: number, visited: boolean[]): string {

FILE: Algorithms/Graph/Kosarajus_Algorithm/kosaraju_algorithm_strongly_connected_components.cpp
  function init (line 4) | void init() {
  function dfs (line 11) | void dfs(vector<int> graph[], int node, bool *visited, vector<int> &orde...
  function dfs2 (line 22) | void dfs2(vector<int> rev_graph[], int node, bool *visited) {
  function solve (line 31) | void solve(vector<int> graph[], vector<int> rev_graph[], int V) {
  function main (line 56) | int main() {

FILE: Algorithms/Graph/Kruskal's_MST/KruskalMST.c
  type Edge (line 15) | typedef struct Edge{
  type EdgeList (line 20) | typedef struct EdgeList{
  function SortEdges (line 32) | void SortEdges(){
  function FindVertexSet (line 49) | int FindVertexSet(int vertexSet[], int vertexNo){
  function Union (line 57) | void Union(int vertexSet[], int srcNode, int destNode){
  function KruskalMST (line 68) | void KruskalMST(){
  function PrintResult (line 113) | void PrintResult(){
  function main (line 131) | void main(){

FILE: Algorithms/Graph/Kruskal's_MST/Kruskal_Algorithm.cpp
  class Graph (line 8) | class Graph {
  function main (line 71) | int main() {

FILE: Algorithms/Graph/Kruskal's_MST/cpp/kruskal.cpp
  function main (line 60) | int main() {
  function disjoint_set (line 97) | disjoint_set create_set(int n) {
  function get_parent (line 111) | int get_parent(disjoint_set &s, int i) {
  function set_union (line 128) | void set_union(disjoint_set &s, int u, int v) {
  function contains (line 141) | bool contains(disjoint_set &s, int u, int v) {
  function kruskal (line 150) | vector<edge> kruskal(vector<edge> graph, const int n_nodes) {

FILE: Algorithms/Graph/Kruskal's_MST/python/KruskalMST.py
  function takeInput (line 4) | def takeInput():
  class Graph (line 20) | class Graph:
    method __init__ (line 21) | def __init__(self, vertices,graph ):
    method find (line 31) | def find(self, parent, i):
    method union (line 42) | def union(self, parent, rank, x, y):
    method KruskalMST (line 66) | def KruskalMST(self):

FILE: Algorithms/Graph/Kruskal's_MST/rust/kruskal.rs
  type DisjointSet (line 5) | struct DisjointSet {
    method new (line 75) | fn new(n_nodes : usize) -> DisjointSet {
    method get_parent (line 92) | fn get_parent(&mut self, i : usize) -> usize {
    method union (line 109) | fn union(&mut self, u : usize, v : usize) {
    method contains (line 122) | fn contains(&mut self, u : usize, v : usize) -> bool {
  type Edge (line 12) | struct Edge {
    method new (line 58) | fn new(weight : i32, u : usize, v : usize) -> Edge {
  type Graph (line 23) | type Graph = vec::Vec<Edge>;
  function main (line 25) | fn main() {
  function kruskal (line 145) | fn kruskal(mut graph : Graph, n_nodes : usize) -> Graph {

FILE: Algorithms/Graph/Level order traversal.cpp
  type node (line 4) | struct node{
  function node (line 9) | node* newnode(ll int data)
  function levelorder (line 19) | void levelorder(node* root)
  function node (line 34) | node* inser(node* root,int data)
  function main (line 50) | int main()

FILE: Algorithms/Graph/Lowest_Common_Manager/Lowest_Common_Manager.py
  function getLowestCommonManager (line 5) | def getLowestCommonManager(topManager, reportOne, reportTwo):
  function getOrgInfo (line 9) | def getOrgInfo(manager, reportOne, reportTwo):
  class OrgInfo (line 22) | class OrgInfo:
    method __init__ (line 23) | def __init__(self, lcm, numIP):
  class OrgChart (line 30) | class OrgChart:
    method __init__ (line 31) | def __init__(self, name):

FILE: Algorithms/Graph/Prim's_MST/Prims_MST.java
  class Node (line 7) | class Node {
    method Node (line 12) | Node (int node, int cost) {
  class Prims_MST (line 18) | public class Prims_MST {
    method Find_MST (line 20) | public static int Find_MST(int source_node, List<List<Node>> graph) {
    method main (line 60) | public static void main(String args[]) {

FILE: Algorithms/Graph/Tarjan's Algorithm/StronglyConnectedComponents.cpp
  function DFS (line 7) | void DFS(int u, vector<int> adj[], stack<int> &st)
  function tarjans (line 45) | vector<vector<int>> tarjans(int V, vector<int> adj[])
  function main (line 64) | int main()

FILE: Algorithms/Graph/Topological Sort/topo_sort.py
  function topologicalSort (line 6) | def topologicalSort(jobs, deps):
  function createJobGraph (line 11) | def createJobGraph(jobs, deps):
  function getOrderedJobs (line 18) | def getOrderedJobs(graph):
  function dft (line 29) | def dft(node, orderedJobs):
  class JobGraph (line 45) | class JobGraph:
    method __init__ (line 46) | def __init__(self, jobs):
    method addNode (line 52) | def addNode(self, job):
    method getNode (line 56) | def getNode(self, job):
    method addPrereq (line 61) | def addPrereq(self, job, prereq):
    method __init__ (line 110) | def __init__(self, jobs):
    method addNode (line 116) | def addNode(self, job):
    method addDep (line 120) | def addDep(self, job, dep):
    method getNode (line 126) | def getNode(self, job):
  class JobNode (line 67) | class JobNode:
    method __init__ (line 68) | def __init__(self, job):
    method __init__ (line 133) | def __init__(self, job):
  function topologicalSort (line 78) | def topologicalSort(jobs, deps):
  function createJobGraph (line 83) | def createJobGraph(jobs, deps):
  function getOrderedJobs (line 90) | def getOrderedJobs(graph):
  function removeDeps (line 101) | def removeDeps(node, nwnp):
  class JobGraph (line 109) | class JobGraph:
    method __init__ (line 46) | def __init__(self, jobs):
    method addNode (line 52) | def addNode(self, job):
    method getNode (line 56) | def getNode(self, job):
    method addPrereq (line 61) | def addPrereq(self, job, prereq):
    method __init__ (line 110) | def __init__(self, jobs):
    method addNode (line 116) | def addNode(self, job):
    method addDep (line 120) | def addDep(self, job, dep):
    method getNode (line 126) | def getNode(self, job):
  class JobNode (line 132) | class JobNode:
    method __init__ (line 68) | def __init__(self, job):
    method __init__ (line 133) | def __init__(self, job):

FILE: Algorithms/Graph/Topological sort/Topological_sort.cpp
  function check (line 12) | bool check(int V, vector <int> &res, vector<int> adj[]) {
  function main (line 26) | int main() {
  function dfs (line 56) | void dfs(int s,vector<int> adj[])
  function topoSort (line 68) | vector<int> topoSort(int V, vector<int> adj[]) {

FILE: Algorithms/Graph/Youngest_Common_Ancestor/YoungerCommonAncestor.cpp
  type Node (line 9) | struct Node
    type Node (line 12) | struct Node
  function Node (line 16) | Node * newNode(int k)
    type Node (line 12) | struct Node
  function findPath (line 26) | bool findPath(Node *root, vector<int> &path, int k)
  function findLCA (line 52) | int findLCA(Node *root, int n1, int n2)
  function main (line 71) | int main()

FILE: Algorithms/Graph/Youngest_Common_Ancestor/YoungestCommonAncestor.java
  class YoungestCommonAncestor (line 1) | public class YoungestCommonAncestor {
    method main (line 10) | public static void main(String[] args) {
    method findYoungestCommon (line 26) | static boolean findYoungestCommon(TreeNode node, int val1, int val2) {
    method insert (line 43) | static TreeNode insert(int index) {
    method inOrder (line 56) | static void inOrder(TreeNode root) {
    class TreeNode (line 67) | static class TreeNode {
      method TreeNode (line 72) | public TreeNode(int val) {
    class NodeWrap (line 77) | static class NodeWrap {
      method NodeWrap (line 80) | public NodeWrap(TreeNode treeNode) {

FILE: Algorithms/Graph/Youngest_Common_Ancestor/youngest-comm-anc.py
  class AncestralTree (line 5) | class AncestralTree:
    method __init__ (line 6) | def __init__(self, name):
  function getYoungestCommonAncestor (line 11) | def getYoungestCommonAncestor(topAncestor, descendantOne, descendantTwo):
  function getDescDep (line 20) | def getDescDep(desc, top):
  function youngCommon (line 27) | def youngCommon(lowerDesc, higherDesc, diff):

FILE: Algorithms/Graph/articulation_points.py
  class Graph (line 2) | class Graph:
    method __init__ (line 3) | def __init__(self,vertices):
    method addEdge (line 9) | def addEdge(self,u,v):
    method APUtil (line 14) | def APUtil(self,u, visited, ap, parent, low, disc):
    method AP (line 54) | def AP(self):

FILE: Algorithms/Graph/flood_fill.py
  function floodFillUtil (line 4) | def floodFillUtil(screen, x, y, prevC, newC):
  function floodFill (line 20) | def floodFill(screen, x, y, newC):

FILE: Algorithms/Graph/lagrange_interpolation.cpp
  function main (line 5) | int main()

FILE: Algorithms/Graph/lowest_common_manager/lowest_common_manager.java
  class Employee (line 1) | public class Employee {
    method Employee (line 5) | Employee(String name) {
    method setManager (line 9) | public  void setManager(Employee m) {
    method addReprotee (line 12) | public  void addReprotee(Employee e) {
    method closestCommonManager2 (line 18) | static Employee closestCommonManager2(Employee a, Employee b) {
    method closestCommonManager (line 53) | static Employee closestCommonManager(Employee a, Employee b) {
    method toString (line 78) | public String toString() {

FILE: Algorithms/Graph/newton_raphson_method.c
  function main (line 9) | void main()

FILE: Algorithms/Hashing/Amicable/Amicable_Number.rb
  class AmicableNumber (line 1) | class AmicableNumber
    method are_amicables? (line 3) | def are_amicables?(number_1, number_2)
    method is_valid? (line 11) | def is_valid?(number)
    method sum_divisors_of (line 16) | def sum_divisors_of(number)
    method divisors_of (line 22) | def divisors_of(number)

FILE: Algorithms/Hashing/Amicable/Amicable_Numbers..c
  function main (line 2) | int main(){

FILE: Algorithms/Hashing/Amicable/Amicable_Numbers.cpp
  function main (line 3) | int main(){

FILE: Algorithms/Hashing/Amicable/Amicable_Numbers.java
  class AmicableNum (line 8) | class AmicableNum{
    method findAmicable (line 11) | boolean findAmicable(int num1, int num2){
    method main (line 51) | public static void main(String[] args) {

FILE: Algorithms/Hashing/Amicable/amicable.cs
  class AmicableNumbersCS (line 6) | public class AmicableNumbersCS {
    method AreAmicable (line 7) | public bool AreAmicable(int x, int y)
    method EqualsDivisorsOf (line 17) | private bool EqualsDivisorsOf(int x, int y)
    method GetDivisors (line 35) | private int[] GetDivisors(int n)

FILE: Algorithms/Hashing/Amicable/amicable_numbers.php
  function sumOfDiv (line 2) | function sumOfDiv( $x)
  function isAmicable (line 20) | function isAmicable( $a, $b)

FILE: Algorithms/Hashing/Amicable/amicable_numbers.py
  function sumOfDiv (line 5) | def sumOfDiv(x):
  function isAmbicle (line 19) | def isAmbicle(a, b):
  function countPairs (line 24) | def countPairs(arr,n):

FILE: Algorithms/Hashing/Brick_Wall/Brick_wall.cpp
  class Solution (line 1) | class Solution
    method leastBricks (line 4) | int leastBricks(vector<vector<int>> &wall)

FILE: Algorithms/Hashing/Chaining/chainingHashing.cpp
  type Node (line 5) | struct Node
    type Node (line 8) | struct Node
  function init (line 12) | void init()
  function add (line 22) | void add(int x, int h)
  function display (line 45) | void display(int mod)
  function get_hash (line 71) | int get_hash(int x, int mod)
  function find (line 80) | void find(int x, int h)
  function main (line 101) | int main(void)

FILE: Algorithms/Hashing/Cuckoo_Hashing/Cuckoo_Hashing.cpp
  function fillTable (line 19) | void fillTable(){
  function printTable (line 33) | void printTable(){
  function getHashValue (line 66) | int getHashValue(int function, int key){
  function getArrange (line 79) | void getArrange(int key, int hashTable, int currPosition, int n){
  function cuckooFunction (line 124) | void cuckooFunction(int keys[], int n){
  function main (line 142) | int main(){

FILE: Algorithms/Hashing/Cuckoo_Hashing/Cuckoo_Hashing.java
  class Cuckoo_Hashing (line 3) | class Cuckoo_Hashing
    method initTable (line 12) | static void initTable()
    method hash (line 19) | static int hash(int function, int key)
    method place (line 28) | static void place(int key, int tableID, int cnt, int n)
    method printTable (line 52) | static void printTable()
    method cuckoo (line 66) | static void cuckoo(int keys[], int n)
    method main (line 73) | public static void main(String[] args)

FILE: Algorithms/Hashing/Divisible_Pair_Count/DivisiblePairCount.c
  function DivisiblePairsCount (line 4) | int DivisiblePairsCount(int arr[], int n)
  function main (line 16) | int main()

FILE: Algorithms/Hashing/Divisible_Pair_Count/DivisiblePairCount.go
  function main (line 7) | func main() {

FILE: Algorithms/Hashing/Divisible_Pair_Count/DivisiblePairCount.java
  class DivisiblePairCount (line 4) | class DivisiblePairCount{
    method countDivisibles (line 6) | public static int countDivisibles(int arr[],int n)
    method main (line 22) | public static void main(String[] args)

FILE: Algorithms/Hashing/Divisible_Pair_Count/DivisiblePairCount.py
  function DivisiblePairCount (line 1) | def DivisiblePairCount(arr, n) :

FILE: Algorithms/Hashing/Divisible_Pair_Count/DivsiblePairCount.cpp
  function DivisiblePairsCount (line 7) | int DivisiblePairsCount(vector<int> v, int n)
  function main (line 19) | int main()

FILE: Algorithms/Hashing/Group_Anagrams/Group_Anagrams.cpp
  function groupAnagrams (line 7) | vector<vector<string>> groupAnagrams(vector<string> &strs)
  function main (line 29) | int main()

FILE: Algorithms/Hashing/Group_Anagrams/group_anagrams.js
  function groupAnagrams (line 1) | function groupAnagrams(stringValue) {

FILE: Algorithms/Hashing/Open Addressing/doubleHashHashingTable.cpp
  type Entry (line 13) | struct Entry
    method Entry (line 28) | explicit Entry(int key = notPresent) : key(key) {}
  type Entry (line 20) | struct Entry
    method Entry (line 28) | explicit Entry(int key = notPresent) : key(key) {}
  type Entry (line 27) | struct Entry {
    method Entry (line 28) | explicit Entry(int key = notPresent) : key(key) {}
  function hashFxn (line 33) | int hashFxn(int key) {
  function otherHashFxn (line 39) | int otherHashFxn(int key) {
  function doubleHash (line 45) | int doubleHash(int key, bool searching) {
  function putProber (line 82) | bool putProber(Entry entry, int key) {
  function searchingProber (line 90) | bool searchingProber(Entry entry, int key) {
  function display (line 96) | void display() {
  function rehash (line 112) | void rehash() {
  function add (line 132) | void add(int key) {
  function remove (line 144) | void remove(int key) {
  function addInfo (line 155) | void addInfo(int key) {
  function removalInfo (line 168) | void removalInfo(int key) {
  function main (line 181) | int main(void) {

FILE: Algorithms/Hashing/Open Addressing/linearProbingHashTable.cpp
  type Entry (line 13) | struct Entry
    method Entry (line 28) | explicit Entry(int key = notPresent) : key(key) {}
  type Entry (line 20) | struct Entry
    method Entry (line 28) | explicit Entry(int key = notPresent) : key(key) {}
  type Entry (line 27) | struct Entry {
    method Entry (line 28) | explicit Entry(int key = notPresent) : key(key) {}
  function hashFxn (line 33) | int hashFxn(int key) {
  function linearProbe (line 39) | int linearProbe(int key, bool searching) {
  function putProber (line 73) | bool putProber(Entry entry, int key) {
  function searchingProber (line 81) | bool searchingProber(Entry entry, int key) {
  function display (line 87) | void display() {
  function rehash (line 103) | void rehash() {
  function add (line 123) | void add(int key) {
  function remove (line 135) | void remove(int key) {
  function addInfo (line 146) | void addInfo(int key) {
  function removalInfo (line 159) | void removalInfo(int key) {
  function main (line 172) | int main(void) {

FILE: Algorithms/Hashing/Open Addressing/quadraticProbingHashTable.cpp
  type Entry (line 13) | struct Entry
    method Entry (line 28) | explicit Entry(int key = notPresent) : key(key) {}
  type Entry (line 20) | struct Entry
    method Entry (line 28) | explicit Entry(int key = notPresent) : key(key) {}
  type Entry (line 27) | struct Entry {
    method Entry (line 28) | explicit Entry(int key = notPresent) : key(key) {}
  function hashFxn (line 33) | int hashFxn(int key) {
  function quadraticProbe (line 39) | int quadraticProbe(int key, bool searching) {
  function putProber (line 78) | bool putProber(Entry entry, int key) {
  function searchingProber (line 86) | bool searchingProber(Entry entry, int key) {
  function Entry (line 92) | Entry find(int key) {
    method Entry (line 28) | explicit Entry(int key = notPresent) : key(key) {}
  function display (line 99) | void display() {
  function rehash (line 115) | void rehash() {
  function add (line 135) | void add(int key) {
  function remove (line 147) | void remove(int key) {
  function addInfo (line 158) | void addInfo(int key) {
  function removalInfo (line 171) | void removalInfo(int key) {
  function main (line 184) | int main(void) {

FILE: Algorithms/Hashing/Recaman_Sequence/Recamans_Sequence.java
  class Sequence (line 7) | class Sequence{
    method recamansSeq (line 10) | void recamansSeq(int n){
    method main (line 45) | public static void main (String[] args)

FILE: Algorithms/Hashing/Recaman_Sequence/recaman.py
  function recaman (line 1) | def recaman(n):

FILE: Algorithms/Hashing/Recaman_Sequence/recaman_sequence.cpp
  function get_recaman_sequence (line 4) | int get_recaman_sequence(int n)
  function main (line 27) | int main()

FILE: Algorithms/Hashing/Recaman_Sequence/recamans_sequence.cs
  class Program (line 5) | class Program
    method Main (line 7) | static void Main(string[] args)

FILE: Algorithms/LinkedList/Floyd_Cylce_detection/floyd_cycle_detection.cpp
  type ListNode (line 4) | struct ListNode {
  function push (line 9) | void push(ListNode** head, int new_val) {
  function isCyclePresent (line 19) | int isCyclePresent(ListNode* head) {
  function main (line 43) | int main() {

FILE: Algorithms/LinkedList/Floyd_Cylce_detection/floyd_cycle_detection.java
  class LinkedList (line 3) | class LinkedList {
    class Node (line 7) | class Node {
      method Node (line 10) | Node(int d)
    method push (line 18) | public void push(int new_data)
    method detectLoop (line 31) | boolean detectLoop()
    method main (line 50) | public static void main(String args[])

FILE: Algorithms/LinkedList/Floyd_Cylce_detection/floyd_cycle_detection.py
  class Node (line 1) | class Node:
    method __init__ (line 2) | def __init__(self, data):
  class LinkedList (line 6) | class LinkedList:
    method __init__ (line 7) | def __init__(self):
    method push (line 11) | def push(self, new_data):
    method printList (line 17) | def printList(self):
    method detectLoop (line 24) | def detectLoop(self):

FILE: Algorithms/Matrix/Spiral-Matrix/Spiral-Matrix.cpp
  function isInBounds (line 8) | bool isInBounds(int i, int j)
  function isBlocked (line 15) | bool isBlocked(int matrix[R][C], int i, int j)
  function spirallyDFSTravserse (line 24) | void spirallyDFSTravserse(int matrix[R][C], int i, int j,
  function spirallyTraverse (line 84) | vector<int> spirallyTraverse(int matrix[R][C])
  function main (line 91) | int main()

FILE: Algorithms/Merging-Interval/#999 merging_intervals.py
  function mergeIntervals (line 1) | def mergeIntervals(arr):

FILE: Algorithms/Merging-Interval/Merging_Intervals.java
  class Merging_Intervals (line 5) | public class Merging_Intervals {
    method main (line 7) | public static void main(String args[]) {
    method merge (line 24) | public static int[][] merge(int[][] intervals) {

FILE: Algorithms/Merging-Interval/merge_intervals.cpp
  type Interval (line 5) | struct Interval
  function myComp (line 11) | bool myComp(Interval interval1, Interval interval2)
  function mergeIntervals (line 18) | void mergeIntervals(Interval arr[], int n)
  function main (line 64) | int main()

FILE: Algorithms/Merging-Interval/merge_intervals.js
  function mergeIntervals (line 10) | function mergeIntervals(arr) {

FILE: Algorithms/Pattern-Searching/Binary_Search/search_in_2D_matrix.java
  class search_in_2D_matrix (line 1) | public class search_in_2D_matrix {
    method searchMatrix (line 2) | public static boolean searchMatrix(int[][] matrix, int target) {
    method main (line 16) | public static void main(String[] args)

FILE: Algorithms/Pattern-Searching/Substring_Check/search.php
  function search (line 4) | function search($pat, $txt, $q)

FILE: Algorithms/Queue/first_negative_integer_in_window.cpp
  function findd (line 27) | int findd(int low,int high,int a[]){
  function main (line 33) | int main() {

FILE: Algorithms/Queue/first_nonrepeating_char_in_stream.cpp
  function main (line 22) | int main(){

FILE: Algorithms/Queue/reversing a queue.cpp
  function Print (line 5) | void Print(queue<int>& Queue)
  function reverseQueue (line 14) | void reverseQueue(queue<int>& Queue)
  function main (line 28) | int main()

FILE: Algorithms/Recursion/All_Subsets.c
  type Stack (line 10) | typedef struct _Stack{
  function main (line 27) | int main(int argc, char const *argv[]){
  function is_empty (line 40) | int is_empty(Stack *stack){
  function push (line 44) | void push(Stack *stack, int value){
  function pop (line 48) | int pop(Stack *stack){
  function show_stack (line 52) | void show_stack(Stack *stack){
  function set_value_seq (line 59) | void set_value_seq(Stack *stack, int start, int end){
  function generate (line 64) | void generate(Stack *stack, int max){

FILE: Algorithms/Recursion/Combination_Sum/Combination_Sum.php
  function combinationalSum (line 9) | function combinationalSum(array $elements, int $target)
  function findCombination (line 39) | function findCombination(array $elements, int $target, array $combinatio...
  function printCombinations (line 64) | function printCombinations(array $combinations)

FILE: Algorithms/Recursion/Combination_Sum/combination_sum.cpp
  function generatePermutation (line 5) | void generatePermutation(vector<int> &arr, int target, int currSum, int ...
  function combinationSum (line 21) | vector<vector<int>> combinationSum(vector<int> &candidates, int target) {
  function main (line 28) | int main() {

FILE: Algorithms/Recursion/Factorial/Factorial.c
  function run (line 10) | int run(int value){
  function main (line 15) | int main(int argc, char const *argv[]){

FILE: Algorithms/Recursion/Factorial/Factorial.cs
  class Factorial (line 5) | class Factorial {
    method checkFact (line 7) | public int checkFact(int n) {
    method Main (line 14) | static void Main(string[] args) {

FILE: Algorithms/Recursion/Factorial/Factorial.go
  function fact (line 4) | func fact(n int) int {
  function main (line 11) | func main() {

FILE: Algorithms/Recursion/Factorial/Factorial_Algorithm.cpp
  function main (line 6) | int main()    // main function: the execution of the program starts from...
  function factorial (line 16) | int factorial(int n)  // funtion definition
  function recursiveFactorial (line 32) | int recursiveFactorial(int n) { // takes int n, to calculate n!
  function main (line 47) | int main() {

FILE: Algorithms/Recursion/Factorial/Factorial_Algorithm.py
  function factorial (line 13) | def factorial(n):

FILE: Algorithms/Recursion/Factorial/factorial.js
  function factorial (line 1) | function factorial(n) {

FILE: Algorithms/Recursion/Factorial/factorial.py
  function factorial (line 1) | def factorial(n):

FILE: Algorithms/Recursion/Josephus/Josephus.c
  type person (line 4) | typedef struct person
  function findWinner (line 10) | int findWinner(int n, int k)
  function main (line 48) | int main()

FILE: Algorithms/Recursion/Josephus/Josephus.cs
  class TEMP (line 3) | class TEMP {
    method josephus (line 5) | static int josephus(int n, int k)
    method Main (line 15) | public static void Main()

FILE: Algorithms/Recursion/Josephus/Josephus.java
  class Josephus (line 3) | public class Josephus {
    method execute (line 4) | public static int execute(int n, int k) {
    method main (line 20) | public static void main(String[] args){

FILE: Algorithms/Recursion/Josephus/josephus.cpp
  function main (line 6) | int main()
  function Josephus (line 14) | int Josephus(int n, int k)

FILE: Algorithms/Recursion/Keypadcodes.cpp
  function sub (line 4) | int sub(string s,string output[],string s1[])
  function main (line 39) | int main() {

FILE: Algorithms/Recursion/Permutation/Permutation.cs
  class Permutations (line 7) | class Permutations
    method SinglePermutations (line 9) | public static List<string> SinglePermutations(string s)
    method GetPermutations (line 23) | private static void GetPermutations(string item, SortedSet<string> has...

FILE: Algorithms/Recursion/Permutation/Permutation.js
  function getPermutations (line 1) | function getPermutations(input) {

FILE: Algorithms/Recursion/Permutation/Permutation.ts
  class Permutation (line 1) | class Permutation {
    method getPermutations (line 2) | getPermutations(input: string): string | string[] {

FILE: Algorithms/Recursion/Permutation/Permutations_Recursion.cpp
  function permute (line 7) | void permute(string a, int l, int r)
  function main (line 22) | int main()

FILE: Algorithms/Recursion/Permutation/Permutations_Recursion.py
  function convert (line 1) | def convert(a):
  function permutation (line 9) | def permutation(s):

FILE: Algorithms/Searching/Binary-Search/Binary_Search_CubicRoot.cpp
  function f (line 8) | double f(double x){
  function binsearch (line 12) | double binsearch(double l, double r)
  function main (line 24) | int main(){

FILE: Algorithms/Searching/Binary-Search/Koko_Eating_Bananas/KEB.java
  class KEB (line 5) | public class KEB
    method check (line 7) | public static boolean check(int p[],int h,int K)    //check if bananas...
    method main (line 17) | public static void main(String args[])throws IOException

FILE: Algorithms/Searching/Binary-Search/Koko_Eating_Bananas/Koko_Eating_Bananas.cpp
  function computeMinHours (line 6) | int computeMinHours(vector<int> &piles, int speed)
  function computeMax (line 15) | int computeMax(vector<int> &piles)
  function minEatingSpeed (line 23) | int minEatingSpeed(vector<int> &piles, int H)
  function main (line 52) | int main()

FILE: Algorithms/Searching/Binary-Search/Koko_Eating_Bananas/Koko_Eating_Bananas.py
  function min_rate (line 17) | def min_rate(pile,hrs):
  function banana_per_hour (line 23) | def banana_per_hour(pile,hrs):
  function main (line 44) | def main():

FILE: Algorithms/Searching/Binary-Search/Rotated-Sorted-Array-Search.cs
  class PairInSortedRotated (line 6) | class PairInSortedRotated
    method pairInSortedRotated (line 10) | static bool pairInSortedRotated(int []arr,
    method Main (line 46) | public static void Main ()

FILE: Algorithms/Searching/Binary-Search/Rotated-Sorted-Array-Search.js
  function rotatedSearch (line 1) | function rotatedSearch(arr, target) {

FILE: Algorithms/Searching/Binary-Search/Rotated-Sorted-Array-Search.py
  function pivotedBinarySearch (line 1) | def pivotedBinarySearch(arr, n, key):
  function findPivot (line 23) | def findPivot(arr, low, high):
  function binarySearch (line 42) | def binarySearch(arr, low, high, key):

FILE: Algorithms/Searching/Binary-Search/binarySearch.c
  function binarySearch (line 3) | int binarySearch(int arr[], int l, int r, int x)
  function main (line 28) | int main(void)

FILE: Algorithms/Searching/Binary-Search/binarySearch.cpp
  function main (line 4) | int main()

FILE: Algorithms/Searching/Binary-Search/binary_search.cpp
  function binarySearch (line 6) | int binarySearch(int arr[], int l,int r,int x)
  function main (line 31) | int main()

FILE: Algorithms/Searching/Binary-Search/binary_search.java
  class Binary (line 2) | class Binary
    method Search (line 4) | int Search(int array[], int r, int l, int y)
    method main (line 17) | public static void main(String args[])

FILE: Algorithms/Searching/Binary-Search/binarysearch.java
  class Solution (line 1) | class Solution {
    method BinarySearch (line 3) | public int BinarySearch(int[] nums, int target) {

FILE: Algorithms/Searching/Binary-Search/binarysearch.php
  function binarySearch (line 3) | function binarySearch(Array $arr, $x)

FILE: Algorithms/Searching/Binary-Search/binarysearch.py
  function binarySearch (line 1) | def binarySearch (arr, l, r, x):

FILE: Algorithms/Searching/Binary-Search/matrix_binary_search.py
  function searchMatrix (line 1) | def searchMatrix(matrix:list,target:int)->bool:

FILE: Algorithms/Searching/Binary-Search/search_in_2d_matrix.cpp
  function searchMatrix (line 5) | bool searchMatrix(vector<vector<int>>& mat, int target)
  function main (line 36) | int main()

FILE: Algorithms/Searching/Exponential-Search/exponential_search.cpp
  function expoSearch (line 39) | int expoSearch(int arr[], int n, int x)
  function binSearch (line 48) | int binSearch(int arr[], int l, int r, int x)
  function main (line 61) | int main(void)

FILE: Algorithms/Searching/Exponential-Search/exponential_search.php
  function expoSearch (line 2) | function expoSearch($arr, $n, $x)
  function binSearch (line 11) | function binSearch($arr, $l, $r, $x)

FILE: Algorithms/Searching/Exponential-Search/exponential_search.py
  function bin_search (line 1) | def bin_search(arr, x, low=0, high=None):
  function exp_search (line 16) | def exp_search(arr, x):

FILE: Algorithms/Searching/Fibonacci-Search/Fibonacci_Search.cpp
  function min (line 7) | int min(int x, int y) {
  function fibMonaccianSearch (line 12) | int fibMonaccianSearch(int arr[], int x, int n)
  function main (line 72) | int main(void)

FILE: Algorithms/Searching/Fibonacci-Search/Fibonacci_search.java
  class Fibonacci (line 4) | class Fibonacci
    method min (line 8) | public static int min(int x, int y)
    method fibMonaccianSearch (line 12) | public static int fibMonaccianSearch(int arr[],
    method main (line 73) | public static void main(String[] args)

FILE: Algorithms/Searching/Fibonacci-Search/Fibonacci_search.php
  function fibMonaccianSearch (line 4) | function fibMonaccianSearch($arr, $x, $n)

FILE: Algorithms/Searching/Fibonacci-Search/Fibonacci_search_in_C.c
  function min (line 5) | int min(int x, int y) { return (x<=y)? x : y; }
  function fibMonaccianSearch (line 8) | int fibMonaccianSearch(int arr[], int x, int n)
  function main (line 66) | int main(void)

FILE: Algorithms/Searching/Fibonacci-Search/fibonacciSearch.py
  function FibonacciGenerator (line 5) | def FibonacciGenerator(n):
  function FibonacciSearch (line 14) | def FibonacciSearch(arr, x):

FILE: Algorithms/Searching/Fibonacci-Search/fibonacci_search.c
  function min (line 5) | int min(int x, int y) { return (x<=y)? x : y; }
  function fibMonaccianSearch (line 8) | int fibMonaccianSearch(int arr[], int x, int n)
  function main (line 66) | int main(void)

FILE: Algorithms/Searching/Fibonacci-Search/fibonacci_search.js
  function fibonacciSearch (line 12) | function fibonacciSearch(n, arr, x){

FILE: Algorithms/Searching/Interpolation-Search/IS.cpp
  function interpolationSearch (line 3) | int interpolationSearch(int array[], int start, int end, int key) {
  function main (line 21) | int main() {

FILE: Algorithms/Searching/Interpolation-Search/IS.py
  function intpolsearch (line 1) | def intpolsearch(values,x ):

FILE: Algorithms/Searching/Jump-Search/JumpSearch.java
  class JumpSearch (line 2) | public class JumpSearch
    method jumpSearch (line 4) | public static int jumpSearch(int[] arr, int x)
    method main (line 42) | public static void main(String [ ] args)

FILE: Algorithms/Searching/Jump-Search/Jump_Search.cpp
  function jumpSearch (line 6) | int jumpSearch(int arr[], int x, int n)
  function main (line 41) | int main()

FILE: Algorithms/Searching/Jump-Search/jumpSearch.cs
  class MainClass (line 5) | class MainClass {
    method Main (line 6) | public static void Main (string[] args) {

FILE: Algorithms/Searching/Jump-Search/jumpSearch.go
  function main (line 8) | func main() {
  function jumpSearch (line 20) | func jumpSearch(arr []int, x int, n int) (inx float64){

FILE: Algorithms/Searching/Jump-Search/jump_search.py
  function jumpSearch (line 3) | def jumpSearch( arr , x , n ):

FILE: Algorithms/Searching/Linear-Search/LINEAR_SEARH.cpp
  function main (line 4) | int main()

FILE: Algorithms/Searching/Linear-Search/LinearSearch.js
  function linearSearch (line 3) | function linearSearch(arr, ele) {

FILE: Algorithms/Searching/Linear-Search/Linear_Search.cpp
  function main (line 4) | int main(){

FILE: Algorithms/Searching/Linear-Search/Linear_Search.go
  function LinearSearch (line 9) | func LinearSearch(array []int, target int) bool {
  function main (line 19) | func main() {

FILE: Algorithms/Searching/Linear-Search/Linear_Search.py
  function LinearSearch (line 4) | def LinearSearch(arr, element):

FILE: Algorithms/Searching/Linear-Search/Linearsearch.c
  function main (line 8) | void main()

FILE: Algorithms/Searching/Linear-Search/linear_search.java
  class Search (line 1) | class Search
    method Linear (line 3) | public static int Linear (int array[], int num)
    method main (line 13) | public static void main(String args[])

FILE: Algorithms/Searching/Sublist-Search/Sublist_Search.php
  class Node (line 3) | class Node {
  function createNewNode (line 13) | function createNewNode (int $key) {
  function subListSearch (line 27) | function subListSearch(Node $first, Node $second): bool
  function printList (line 70) | function printList(Node $node)
  function testSubListSearch (line 82) | function testSubListSearch()

FILE: Algorithms/Searching/Sublist-Search/sublist_search.cpp
  type Node (line 38) | struct Node
  function findList (line 43) | bool findList(Node* first, Node* second)
  function printList (line 72) | void printList(Node* node)
  function Node (line 80) | Node *newNode(int key)
  function main (line 87) | int main()

FILE: Algorithms/Searching/Sublist-Search/sublist_search.cs
  class GFG (line 10) | class GFG
    class Node (line 14) | class Node
    method findList (line 22) | static Boolean findList(Node first,
    method printList (line 83) | static void printList(Node node)
    method newNode (line 93) | static Node newNode(int key)
    method Main (line 102) | public static void Main(String[] args)

FILE: Algorithms/Searching/Sublist-Search/sublist_search.java
  class GFG (line 2) | class GFG
    class Node (line 4) | static class Node
    method findList (line 9) | static boolean findList(Node first, Node second)
    method printList (line 37) | static void printList(Node node)
    method newNode (line 45) | static Node newNode(int key)
    method main (line 52) | public static void main(String[] args)

FILE: Algorithms/Searching/Sublist-Search/sublist_search.js
  class node (line 1) | class node {
    method constructor (line 2) | constructor(value) {

FILE: Algorithms/Searching/Sublist-Search/sublist_search.py
  class Node (line 1) | class Node:
    method __init__ (line 2) | def __init__(self, value = 0):
  function findList (line 5) | def findList(first, second):

FILE: Algorithms/Searching/Ternary-Search/Ternary-String.c
  function ll (line 26) | ll max(ll i,ll j){
  function main (line 30) | int main(){

FILE: Algorithms/Searching/Ternary-Search/ternarySearch.cpp
  function ternarySearch (line 5) | int ternarySearch(int l, int r, int key, int ar[])
  function main (line 43) | int main()

FILE: Algorithms/Searching/Ternary-Search/unimodal_func.cpp
  function func1 (line 14) | double func1(double x){
  function func2 (line 19) | double func2(double x){
  function find_maxima (line 38) | double find_maxima(double l, double r){
  function find_minima (line 67) | double find_minima(double l, double r){
  function main (line 81) | int main(){

FILE: Algorithms/Searching/Ternary-Search/unimodal_func.java
  class TernarySearch (line 8) | public class TernarySearch
    method func1 (line 12) | public static double func1(double x){
    method func2 (line 17) | public static double func2(double x){
    method find_maxima (line 35) | public static double find_maxima(double l, double r){
    method find_minima (line 64) | public static double find_minima(double l, double r){
    method main (line 80) | public static void main(String args[]){

FILE: Algorithms/Searching/Ternary-Search/unimodal_func.js
  constant PRECISION (line 2) | const PRECISION = 0.0000001
  function func1 (line 11) | function func1(x) {
  function func2 (line 16) | function func2(x) {
  function find_maxima (line 35) | function find_maxima(l, r) {
  function find_minima (line 64) | function find_minima(l, r) {

FILE: Algorithms/Searching/Ternary-Search/unimodal_func.py
  function func1 (line 11) | def func1(x):
  function func2 (line 16) | def func2(x):
  function find_maxima (line 35) | def find_maxima(l,r):
  function find_minima (line 63) | def find_minima(l,r):
  function main_func (line 76) | def main_func():

FILE: Algorithms/Searching/Trie-Search/Trie Data Structure.cpp
  class Node (line 4) | class Node{
    method Node (line 9) | Node(char d){
  class Trie (line 14) | class Trie{
    method Trie (line 19) | Trie(){
    method insert (line 23) | void insert(char *w){
    method find (line 38) | bool find(char *w){
  function main (line 53) | int main(){

FILE: Algorithms/Searching/Trie-Search/Trie1_HashMap.java
  class Trie1_HashMap (line 4) | public class Trie1_HashMap{
    method main (line 6) | public static void main(String[] args) {
  class TrieNode (line 19) | class TrieNode{
    method TrieNode (line 24) | public TrieNode(char data,boolean terminate) {
  class Trie (line 31) | class Trie{
    method Trie (line 34) | public Trie() {
    method search (line 38) | public boolean search(String s) {
    method display (line 53) | public void display() {
    method display (line 57) | private void display(TrieNode root) {
    method insert (line 68) | public void insert(String data) {
    method insert (line 72) | private void insert(TrieNode root, String s) {

FILE: Algorithms/Searching/Trie-Search/TrieDataStructure.java
  class TrieDataStructure (line 5) | public class TrieDataStructure {
    class TrieNode (line 8) | static class TrieNode
      method TrieNode (line 14) | TrieNode(){
    method insert (line 23) | static void insert(String key)
    method search (line 43) | static boolean search(String key)
    method main (line 64) | public static void main(String args[])

FILE: Algorithms/Searching/Trie-Search/Trie_Search.cpp
  type Trie (line 8) | struct Trie
    type Trie (line 11) | struct Trie
  type Trie (line 15) | struct Trie
    type Trie (line 11) | struct Trie
  type Trie (line 17) | struct Trie
    type Trie (line 11) | struct Trie
  type Trie (line 17) | struct Trie
    type Trie (line 11) | struct Trie
  type Trie (line 17) | struct Trie
    type Trie (line 11) | struct Trie
  function insert (line 27) | void insert(struct Trie *head, char* str)
  function search (line 50) | int search(struct Trie* head, char* str)
  function haveChildren (line 76) | int haveChildren(struct Trie* curr)
  function deletion (line 86) | int deletion(struct Trie **curr, char* str)
  function main (line 138) | int main()

FILE: Algorithms/Searching/Trie-Search/Trie_Search.go
  type Trie (line 9) | type Trie struct
    method Insert (line 26) | func (this *Trie) Insert(word string) {
    method Search (line 40) | func (this *Trie) Search(word string) bool {
  type trieNode (line 13) | type trieNode struct
  function Constructor (line 19) | func Constructor() Trie {
  function main (line 56) | func main() {

FILE: Algorithms/Searching/Trie-Search/Trie_Search.py
  class TrieNode (line 4) | class TrieNode:
    method __init__ (line 5) | def __init__(self):
  class Trie (line 10) | class Trie:
    method __init__ (line 11) | def __init__(self):
    method getNode (line 14) | def getNode(self):
    method toIndex (line 17) | def toIndex(self, ch):
    method insert (line 21) | def insert(self, key):
    method search (line 33) | def search(self, key):
  function main (line 47) | def main():

FILE: Algorithms/Sorting/3-Way_Quick_Sort/3-Way_Quick_Sort.cpp
  function quick_sort_partition3 (line 19) | std::vector<int> quick_sort_partition3(std::vector<int> &arr, int low, i...
  function randomized_quick_sort (line 46) | void randomized_quick_sort(std::vector<int> &arr, int low, int high) {
  function main (line 57) | int main() {

FILE: Algorithms/Sorting/3-Way_Quick_Sort/3-Way_Quick_Sort.cs
  class Sort (line 4) | class Sort {
    method swap (line 6) | static void swap<T>(ref T lhs, ref T rhs)
    method partition (line 14) | public static void partition(int[] a, int l, int r, ref int i, ref int j)
    method quicksort (line 63) | public static void quicksort(int[] a, int l, int r)
    method printarr (line 78) | public static void printarr(int[] a, int n)
    method Main (line 86) | static void Main()

FILE: Algorithms/Sorting/3-Way_Quick_Sort/3-Way_Quick_Sort.java
  class QuickSort (line 5) | public class QuickSort {
    method swap (line 7) | private static void swap(Comparable[] arr, int first, int second)
    method quickSort3Way (line 15) | private static void quickSort3Way(Comparable[] arr, int low, int high)
    method printSortedArray (line 46) | private static void printSortedArray(Comparable[] arr)
    method main (line 53) | public static void main(String[] args) throws IOException

FILE: Algorithms/Sorting/3-Way_Quick_Sort/3_Way_Quick_Sort.c
  function swap (line 4) | void swap(int &x, int &y)
  function partition (line 11) | void partition(int a[], int l, int r, int& i, int& j)
  function quicksort (line 47) | void quicksort(int a[], int l, int r)
  function printarr (line 57) | void printarr(int a[], int n)
  function main (line 64) | int main()

FILE: Algorithms/Sorting/Bead_Sort/Bead_Sort.php
  function columns (line 2) | function columns($my_array) {
  function bead_sort (line 12) | function bead_sort($my_array) {

FILE: Algorithms/Sorting/Bead_Sort/Bead_Sort.rb
  class Array (line 1) | class Array
    method beadsort (line 2) | def beadsort
    method columns (line 6) | def columns

FILE: Algorithms/Sorting/Bead_Sort/Bead_sort.cpp
  function beadSort (line 3) | void beadSort(int *a, int len)
  function main (line 36) | int main()

FILE: Algorithms/Sorting/Bead_Sort/bead_sort.py
  function bead_sort (line 1) | def bead_sort(obj):

FILE: Algorithms/Sorting/Binary_Insertion_Sort/Binary Insertion Sort.c
  function binarySearch (line 7) | int binarySearch(int a[], int item, int low, int high)
  function insertionSort (line 23) | void insertionSort(int a[], int n)
  function main (line 46) | int main()

FILE: Algorithms/Sorting/Binary_Insertion_Sort/Binary_Insertion_Sort.cpp
  function binarySearch (line 4) | int binarySearch(int a[], int item, int low, int high)
  function insertionSort (line 20) | void insertionSort(int a[], int n)
  function main (line 42) | int main()

FILE: Algorithms/Sorting/Binary_Insertion_Sort/Binary_Insertion_Sort.py
  function binsertion_sort (line 3) | def binsertion_sort(arr):

FILE: Algorithms/Sorting/Bitonic_Search/BitonicSort.java
  class BitonicSort (line 2) | public class BitonicSort
    method merge (line 11) | void merge(int a[], int low, int cnt, int arr)
    method swap (line 27) | void swap(int a[], int i, int j, int arr)
    method bitonicSort (line 43) | void bitonicSort(int a[], int low, int cnt, int arr)
    method sort (line 63) | void sort(int a[], int N, int up)
    method printArray (line 69) | static void printArray(int arr[])
    method main (line 78) | public static void main(String args[])

FILE: Algorithms/Sorting/Bitonic_Search/Bitonic_sort.c
  function compAndSwap (line 9) | void compAndSwap(int a[], int i, int j, int dir)
  function bitonicMerge (line 19) | void bitonicMerge(int a[], int low, int cnt, int dir)
  function bitonicSort (line 34) | void bitonicSort(int a[],int low, int cnt, int dir)
  function sort (line 54) | void sort(int a[], int N, int up)
  function main (line 60) | int main()

FILE: Algorithms/Sorting/Bitonic_Search/bitonic_search.py
  function compAndSwap (line 1) | def compAndSwap(a, i, j, dire):
  function bitonic_merge (line 5) | def bitonic_merge(a, low, cnt, dire):
  function bitonic_sort (line 13) | def bitonic_sort(a, low, cnt, dire):
  function sort (line 20) | def sort(a, N, up):

FILE: Algorithms/Sorting/Brick_Sort/BrickSort.js
  function swap (line 4) | function swap(arr, first_Index, second_Index) {
  function brickSort (line 11) | function brickSort(arr) {

FILE: Algorithms/Sorting/Brick_Sort/Brick_Sort.c
  function oddEvenSort (line 6) | void oddEvenSort(int arr[], int n)
  function printArray (line 39) | void printArray(int arr[], int n)
  function main (line 47) | int main()

FILE: Algorithms/Sorting/Brick_Sort/brickSort.py
  function brickSort (line 1) | def brickSort(array, n):

FILE: Algorithms/Sorting/Bubble_Sort/BubbleSort.js
  function swap (line 1) | function swap(arr, first_Index, second_Index) {
  function bubbleSort (line 7) | function bubbleSort(arr) {

FILE: Algorithms/Sorting/Bubble_Sort/Bubble_Sort.c
  function main (line 3) | int main()

FILE: Algorithms/Sorting/Bubble_Sort/Bubble_Sort.cs
  class MySort (line 3) | class MySort {
    method Main (line 4) | static void Main(string[] args) {

FILE: Algorithms/Sorting/Bubble_Sort/Bubble_sort_optimised.cpp
  function swap (line 6) | void swap(int *xp, int *yp)
  function bubbleSort (line 14) | void bubbleSort(int arr[], int n)
  function printArray (line 37) | void printArray(int arr[], int size)
  function main (line 46) | int main()

FILE: Algorithms/Sorting/Bubble_Sort/bubbleSort.cpp
  function bubble_sort (line 4) | void bubble_sort(int arr[],int n)
  function main (line 17) | int main()

FILE: Algorithms/Sorting/Bubble_Sort/bubble_sort.java
  class Bubble (line 1) | class Bubble
    method Sort (line 3) | void Sort(int array[])
    method printarrayay (line 18) | void printarrayay(int array[])//to print the array
    method main (line 26) | public static void main(String args[])

FILE: Algorithms/Sorting/Bucket_Sort/BucketSort.c
  type Node (line 10) | struct Node {
  type Node (line 16) | struct Node
  type Node (line 16) | struct Node
  type Node (line 18) | struct Node
  function BucketSort (line 22) | void BucketSort(int arr[]) {
  type Node (line 78) | struct Node
  type Node (line 78) | struct Node
  type Node (line 79) | struct Node
  type Node (line 88) | struct Node
  type Node (line 90) | struct Node
  type Node (line 104) | struct Node
  function getBucketIndex (line 120) | int getBucketIndex(int value) {
  function print (line 124) | void print(int ar[]) {
  function printBuckets (line 133) | void printBuckets(struct Node *list) {
  function main (line 142) | int main(void) {

FILE: Algorithms/Sorting/Bucket_Sort/BucketSort.java
  class BucketSort (line 7) | public class BucketSort {
    method bucketSort (line 8) | public void bucketSort(float[] arr, int n) {
    method main (line 39) | public static void main(String[] args) {

FILE: Algorithms/Sorting/Bucket_Sort/BucketSort.py
  function bucket_sort (line 1) | def bucket_sort(input_list):

FILE: Algorithms/Sorting/Bucket_Sort/bucket_sort.cpp
  function bucketSort (line 7) | void bucketSort(float arr[], int n)
  function main (line 24) | int main()

FILE: Algorithms/Sorting/Bucket_Sort/bucketsort.php
  function insertion_sort (line 2) | function insertion_sort(&$elements, $fn = 'comparison_function') {
  function comparison_function (line 15) | function comparison_function(&$a, &$b) {
  function bucket_sort (line 19) | function bucket_sort(&$elements) {

FILE: Algorithms/Sorting/Bucket_Sort/bucketsort.rb
  function bucket_sort (line 7) | def bucket_sort(arr, n, buckets, m)

FILE: Algorithms/Sorting/Bucket_Sort/bucketsortinC.c
  function Bucket_Sort (line 7) | void Bucket_Sort(int array[], int n)
  function main (line 24) | int main()

FILE: Algorithms/Sorting/Circle_Sort/Circle_Sort.c
  function circle_sort_inner (line 4) | int circle_sort_inner(int *start, int *end)
  function circle_sort (line 16) | void circle_sort(int a[], int n)
  function main (line 24) | int main(void)

FILE: Algorithms/Sorting/Circle_Sort/Circle_Sort.cs
  class Program (line 4) | class Program
    method Main (line 9) | public static void Main()
    method CircleSort (line 22) | public static void CircleSort(int[] array)
    method CircleSort (line 38) | private static bool CircleSort(int[] array, int lowIndex, int highIndex)

FILE: Algorithms/Sorting/Circle_Sort/Circle_Sort.java
  class circleSortClass (line 2) | class circleSortClass
    method circleSortInner (line 4) | boolean circleSortInner(int a[], int low, int high)
    method circleSort (line 34) | void circleSort (int a[], int n)
    method swap (line 40) | void swap(int arr[],int l,int h)
    method main (line 50) | public static void main(String[] args)

FILE: Algorithms/Sorting/Circle_Sort/Circle_Sort.rb
  class Array (line 1) | class Array
    method circle_sort! (line 2) | def circle_sort!
    method _circle_sort! (line 10) | def _circle_sort!(lo, hi, swaps=0)

FILE: Algorithms/Sorting/Cocktail_Sort/Cocktail_Sort.c
  function swap (line 5) | void swap(int *a, int *b){
  function CocktailSort (line 12) | void CocktailSort(int a[], int n)
  function printArray (line 46) | void printArray(int a[], int n)
  function main (line 55) | int main()

FILE: Algorithms/Sorting/Cocktail_Sort/Cocktail_Sort.cpp
  function cocktailSort (line 3) | void cocktailSort(int arr[], int n){
  function main (line 28) | main() {int n;

FILE: Algorithms/Sorting/Cocktail_Sort/Cocktail_Sort.java
  class Cocktailsort (line 4) | public class Cocktailsort {
    method cocktailsort (line 5) | void cocktailsort(int l[], int n) {
    method printArray (line 50) | void printArray(int a[]) {
    method main (line 57) | public static void main(String[] args) {

FILE: Algorithms/Sorting/Cocktail_Sort/Cocktail_Sort.py
  function cocktailsort (line 3) | def cocktailsort(l):

FILE: Algorithms/Sorting/Comb_Sort/Comb_Sort.c
  function newGap (line 5) | int newGap(int gap) {
  function combsort (line 13) | void combsort(int a[], int aSize) {
  function main (line 31) | int main()

FILE: Algorithms/Sorting/Comb_Sort/Comb_Sort.cpp
  function display (line 4) | void display(int *array, int size){
  function combSort (line 9) | void combSort(int *array, int size){
  function main (line 25) | int main(){

FILE: Algorithms/Sorting/Comb_Sort/comb.py
  function getNextGap (line 1) | def getNextGap(gap):
  function combSort (line 7) | def combSort(array_to_sort):

FILE: Algorithms/Sorting/Comb_Sort/comb_sort.rb
  function comb_sort (line 2) | def comb_sort(arr)

FILE: Algorithms/Sorting/Counting_Sort/Count_sort.py
  function count_sort (line 7) | def count_sort(ls):

FILE: Algorithms/Sorting/Counting_Sort/Counting_Sort.c
  function countSort (line 4) | void countSort(int arr[], int len)
  function main (line 30) | int main()

FILE: Algorithms/Sorting/Counting_Sort/Counting_Sort.cs
  class Program (line 3) | class Program
    method CountingSort (line 8) | public static int[] CountingSort(int[] arrayToSort)
    method Main (line 52) | static void Main()
    method ExitAfterInvalidInput (line 85) | private static void ExitAfterInvalidInput()

FILE: Algorithms/Sorting/Counting_Sort/Counting_Sort.java
  class Counting_Sort (line 6) | class Counting_Sort
    method main (line 8) | public static void main(String[] args) {

FILE: Algorithms/Sorting/Counting_Sort/Counting_sort.js
  function counting_sort (line 1) | function counting_sort(arrin) {

FILE: Algorithms/Sorting/Counting_Sort/counting_sort.py
  function countingSort (line 1) | def countingSort(array):

FILE: Algorithms/Sorting/Counting_Sort/countingsort.py
  function countSort (line 1) | def countSort(arr):

FILE: Algorithms/Sorting/Cycle_Sort/CYCLESort.cs
  class GFG (line 5) | class GFG {
    method cycleSort (line 11) | public static void cycleSort(int[] arr, int n)
    method Main (line 133) | public static void Main()

FILE: Algorithms/Sorting/Cycle_Sort/Cyclesort.py
  function cycleSort (line 1) | def cycleSort(array):

FILE: Algorithms/Sorting/Cycle_Sort/cyclesort.c
  function cycleSort (line 1) | void cycleSort(int arr[], int n)
  function main (line 59) | int main()

FILE: Algorithms/Sorting/Cycle_Sort/stoogesort.java
  class stooge (line 3) | public class stooge {
    method stoogesort (line 5) | static void stoogesort(int arr[], int l, int h)
    method main (line 29) | public static void main(String args[])

FILE: Algorithms/Sorting/Gnome_Sort/Gnome_Sort.cs
  class GFG (line 4) | class GFG {
    method gnomeSort (line 6) | static void gnomeSort(int[] arr, int n)
    method Main (line 28) | public static void Main()

FILE: Algorithms/Sorting/Gnome_Sort/Gnome_Sort.java
  class GFG (line 4) | public class GFG {
    method gnomeSort (line 5) | static void gnomeSort(int arr[], int n)
    method main (line 26) | public static void main(String[] args)

FILE: Algorithms/Sorting/Gnome_Sort/Gnome_Sort.php
  function gnomeSort (line 7) | function gnomeSort($arr, $n)

FILE: Algorithms/Sorting/Gnome_Sort/Gnome_Sort.py
  function gnomeSort (line 4) | def gnomeSort( arr, n):

FILE: Algorithms/Sorting/Gnome_Sort/gnomeSort.java
  class gnomeSort (line 3) | class gnomeSort {
    method gnomeSort (line 4) | void gnomeSort(int[] nums)
    method main (line 23) | public static void main(String args[])

FILE: Algorithms/Sorting/Heap_Sort/Max_heap_sort.cpp
  function downadj (line 12) | void downadj(int heap[],int i,int n) //down adjust
  function show (line 31) | void show(int arr[],int n,int x) //print array
  function upadj (line 51) | void upadj(int heap[],int i) //up adjust
  function insert (line 60) | void insert(int a[],int x) //construct max heap (Step 1)
  function main (line 83) | int main()

FILE: Algorithms/Sorting/Heap_Sort/heap-sort.c
  function swap (line 3) | void swap(int *a, int *b)
  function heapify (line 11) | void heapify(int arr[], int n, int i)
  function heapSort (line 31) | void heapSort(int arr[], int n)
  function printArray (line 44) | void printArray(int arr[], int n)
  function main (line 52) | int main()

FILE: Algorithms/Sorting/Heap_Sort/heap-sort.php
  function build_heap (line 2) | function build_heap(&$array, $i, $t){
  function heap_sort (line 22) | function heap_sort(&$array) {

FILE: Algorithms/Sorting/Heap_Sort/heap-sort.py
  function heapify (line 17) | def heapify(arr, n, index):
  function heapSort (line 40) | def heapSort(arr):

FILE: Algorithms/Sorting/Heap_Sort/heap-sort.rb
  function heap_sort (line 1) | def heap_sort(array)
  function heapify (line 21) | def heapify(a, parent, limit)

FILE: Algorithms/Sorting/Heap_Sort/heap_sort.cpp
  function heapify (line 6) | void heapify(int arr[], int n, int i) {
  function heapSort (line 22) | void heapSort(int arr[], int n) {
  function printArray (line 31) | void printArray(int arr[], int n) {
  function main (line 37) | int main() {

FILE: Algorithms/Sorting/Heap_Sort/heap_sort.go
  function heapify (line 5) | func heapify(array []int, n, i int) {
  function HeapSort (line 24) | func HeapSort(array []int, n int) {
  function main (line 34) | func main() {

FILE: Algorithms/Sorting/Heap_Sort/heap_sort.java
  class HeapSort (line 2) | public class HeapSort
    method sort (line 4) | public void sort(int arr[])
    method heapify (line 21) | void heapify(int arr[], int n, int i)
    method printArray (line 43) | static void printArray(int arr[])
    method main (line 51) | public static void main(String args[])

FILE: Algorithms/Sorting/Heap_Sort/heapsorting.py
  function heapify (line 1) | def heapify(arr, n, i):
  function heapSort (line 19) | def heapSort(arr):

FILE: Algorithms/Sorting/Insertion_Sort/InsertSort.py
  function insertion_sort (line 1) | def insertion_sort(InputList):

FILE: Algorithms/Sorting/Insertion_Sort/Insertion Sort.cpp
  function insertionSort (line 6) | void insertionSort(int arr[], int n)
  function printArray (line 27) | void printArray(int arr[], int n)
  function main (line 36) | int main()

FILE: Algorithms/Sorting/Insertion_Sort/InsertionSort.java
  class InsertionSort (line 3) | class InsertionSort {
    method sort (line 5) | void sort(int arr[])
    method printArray (line 21) | static void printArray(int arr[])
    method main (line 31) | public static void main(String args[])

FILE: Algorithms/Sorting/Insertion_Sort/InsertionSort.py
  function insertionSort (line 1) | def insertionSort(arr):

FILE: Algorithms/Sorting/Insertion_Sort/Insertion_Sort.cpp
  function insertionsort (line 4) | void insertionsort(int arr[],int len){
  function main (line 15) | int main(){

FILE: Algorithms/Sorting/Insertion_Sort/Insertion_sort_2.cpp
  function Insertion_sort (line 4) | void Insertion_sort(int a[],int n){
  function main (line 17) | int main(){

FILE: Algorithms/Sorting/Insertion_Sort/insertion_sort.py
  function insertion_sort (line 3) | def insertion_sort(a):

FILE: Algorithms/Sorting/Insertion_Sort/insertion_sort.ts
  class InsertionSort (line 7) | class InsertionSort{
    method constructor (line 10) | constructor(){
    method sort (line 20) | public sort(arr:number[]):number[]{

FILE: Algorithms/Sorting/Merge_Sort/Application of Merge Sort/Count_Inversions.c
  function merge (line 4) | long long int  merge(long long int a[], long long int start, long long i...
  function merge_sort (line 49) | long long int merge_sort(long long int a[],long long int start,long long...
  function main (line 73) | int main()

FILE: Algorithms/Sorting/Merge_Sort/Application of Merge Sort/Count_Inversions.cpp
  function merge (line 4) | long long merge(long long a[], long long start, long long mid, long long...
  function merge_sort (line 49) | long long merge_sort(long long a[],long long start,long long end)
  function main (line 73) | int main()

FILE: Algorithms/Sorting/Merge_Sort/MERGE_SORT.c
  function merging (line 9) | void merging(int low, int mid, int high) {
  function sort (line 30) | void sort(int low, int high) {
  function main (line 43) | int main() {

FILE: Algorithms/Sorting/Merge_Sort/MERGE_SORT.cpp
  function merge (line 5) | void merge(int arr[], int p, int q, int r)
  function mergeSort (line 60) | void mergeSort(int arr[], int l, int r) {
  function printArray (line 74) | void printArray(int arr[], int size) {
  function main (line 81) | int main() {

FILE: Algorithms/Sorting/Merge_Sort/MERGE_SORT.java
  class MergeSort (line 2) | class MergeSort {
    method merge (line 6) | void merge(int arr[], int l, int m, int r)
    method sort (line 58) | void sort(int arr[], int l, int r)
    method printArray (line 74) | static void printArray(int arr[])
    method main (line 83) | public static void main(String args[])

FILE: Algorithms/Sorting/Merge_Sort/MERGE_SORT.js
  function mergeSort (line 1) | function mergeSort(array,half = array.length/2){
  function merger (line 12) | function merger(left,right){

FILE: Algorithms/Sorting/Merge_Sort/Non_recursive_merge_sort.cpp
  function merge (line 6) | void merge(int *a, int size, int low, int high, int mid)
  function mergeSortIterative (line 46) | void mergeSortIterative(int* arr, int size, int low, int high)
  function main (line 70) | int main()

FILE: Algorithms/Sorting/Merge_Sort/mergeSort.py
  function mergeSort (line 2) | def mergeSort(arr):
  function printList (line 35) | def printList(arr):

FILE: Algorithms/Sorting/Merge_Sort/merge_Sort.rb
  function merge_sort (line 2) | def merge_sort(unsorted_array)
  function merge (line 15) | def merge(left_array, right_array)

FILE: Algorithms/Sorting/Merge_Sort/non_recursive_merge_sort.c
  type Element (line 6) | struct Element{                    // this is the structure of element t...
  type Stack (line 12) | struct Stack{                           //Structure for Stack
  function IsEmpty (line 17) | int IsEmpty(struct Stack *stack){
  function Push (line 24) | int Push(struct Stack *stack, struct Element val){      // val is of typ...
  function Top (line 30) | struct Element Top(struct Stack *stack){
  function Pop (line 39) | struct Element Pop(struct Stack *stack){
  function merge (line 53) | void merge(int* A,int* B, int n, int left, int mid, int right){         ...
  function merge_sort (line 85) | void merge_sort(int* A,int* B, int n){              //we will call this ...
  function main (line 113) | int main() {

FILE: Algorithms/Sorting/Merge_Sort/non_recursive_merge_sort.cs
  class MS (line 3) | class MS {
    method mergeSort (line 4) | static void mergeSort(int[] arr,
    method merge (line 16) | static void merge(int[] arr, int l,
    method printArray (line 65) | static void printArray(int []A, int size)
    method Main (line 73) | public static void Main()

FILE: Algorithms/Sorting/Merge_Sort/non_recursive_merge_sort.py
  function mergeSort (line 1) | def mergeSort(a):
  function merge (line 21) | def merge(a, l, m, r):

FILE: Algorithms/Sorting/Merge_Sort_on_Doubly_Linked_List/Mergesort_doubly.c
  type Node (line 3) | struct Node
  type Node (line 9) | struct Node
  type Node (line 9) | struct Node
  type Node (line 12) | struct Node
  type Node (line 12) | struct Node
  type Node (line 12) | struct Node
  type Node (line 40) | struct Node
  type Node (line 40) | struct Node
  type Node (line 44) | struct Node
  function insert (line 56) | void insert(struct Node **head, int data)
  function print (line 74) | void print(struct Node *head)
  function swap (line 93) | void swap(int *A, int *B)
  type Node (line 102) | struct Node
  type Node (line 102) | struct Node
  type Node (line 104) | struct Node
  type Node (line 110) | struct Node
  function main (line 116) | int main(void)

FILE: Algorithms/Sorting/Merge_Sort_on_Doubly_Linked_List/Mergesort_doubly.cpp
  class Node (line 3) | class Node
  function Node (line 11) | Node *merge(Node *first, Node *second)
  function Node (line 33) | Node *mergeSort(Node *head)
  function insert (line 43) | void insert(Node **head, int data)
  function print (line 58) | void print(Node *head)
  function swap (line 75) | void swap(int *A, int *B)
  function Node (line 81) | Node *split(Node *head)
  function main (line 94) | int main(void)

FILE: Algorithms/Sorting/Merge_Sort_on_Doubly_Linked_List/Mergesort_doubly.java
  class LinkedList (line 1) | class LinkedList {
    class Node (line 4) | static class Node {
      method Node (line 9) | Node(int d) {
    method print (line 15) | void print(Node node) {
    method split (line 30) | Node split(Node head) {
    method mergeSort (line 41) | Node mergeSort(Node node) {
    method merge (line 53) | Node merge(Node first, Node second) {
    method main (line 72) | public static void main(String[] args) {

FILE: Algorithms/Sorting/Merge_Sort_on_Doubly_Linked_List/Mergesort_doubly.py
  class Node (line 1) | class Node:
    method __init__ (line 2) | def __init__(self,data):
  class DoubleLinkedList (line 7) | class DoubleLinkedList:
    method __init__ (line 8) | def __init__(self):
    method merge (line 11) | def merge(self,a,b):
    method mergesort (line 26) | def mergesort(self,head):
    method div (line 36) | def div(self,head):
    method insert (line 50) | def insert(self,d):
    method display (line 58) | def display(self,node):

FILE: Algorithms/Sorting/Pancake_Sort/PancakeSort.java
  class PancakeSort (line 6) | public class PancakeSort {
    method main (line 8) | public static void main(String[] args) {
    method pancakeSort (line 13) | static int[] pancakeSort(int[] arr) {
    method flip (line 26) | public static void flip(int[] arr, int k) {
    method findGreatestElement (line 38) | public static int findGreatestElement(int[] arr, int start, int end) {

FILE: Algorithms/Sorting/Pancake_Sort/Pancake_Sort.c
  function flip (line 5) | void flip(int arr[], int i)
  function findMax (line 19) | int findMax(int arr[], int n)
  function pancakeSort (line 29) | int pancakeSort(int *ar, int n)
  function main (line 51) | int main()

FILE: Algorithms/Sorting/Pancake_Sort/Pancake_Sort.cs
  class Program (line 4) | class Program
    method Main (line 9) | public static void Main()
    method PancakeSort (line 26) | public static int[] PancakeSort(int[] array)
    method IndexOfMax (line 51) | private static int IndexOfMax(int[] array, int n)
    method Flip (line 70) | private static void Flip(int[] array, int end)

FILE: Algorithms/Sorting/Pancake_Sort/Pancake_Sort.js
  function pancakeSort (line 1) | function pancakeSort(arr){

FILE: Algorithms/Sorting/Pancake_Sort/Pancake_Sort.py
  function pancake_sort (line 3) | def pancake_sort(nums):

FILE: Algorithms/Sorting/Pancake_Sort/Pancake_Sort.rb
  class Array (line 1) | class Array
    method pancake_sort! (line 2) | def pancake_sort!

FILE: Algorithms/Sorting/Patience_Sort/PatienceSort.cs
  class Program (line 7) | class Program
    method Main (line 10) | static void Main(string[] args)
    method PatienceSort (line 56) | static void PatienceSort(ref int[] numbers)

FILE: Algorithms/Sorting/Patience_Sort/Patience_sort.cpp
  function main (line 59) | int main (void) //(int argC,char* argV[])

FILE: Algorithms/Sorting/Patience_sort.py
  function new_stack (line 4) | def new_stack(val):             #create new stack
  function patience_sort (line 9) | def patience_sort(t,n):         #gives sorted list

FILE: Algorithms/Sorting/Pigeonhole_Sort/PigeonholeSort.cpp
  function pigeonholeSort (line 6) | void pigeonholeSort(int arr[], int n)
  function main (line 42) | int main()

FILE: Algorithms/Sorting/Pigeonhole_Sort/Pigeonhole_Sort.c
  function pigeonhole_sort (line 5) | void pigeonhole_sort(int arr[], int num, int min, int max)
  function main (line 23) | int main()

FILE: Algorithms/Sorting/Pigeonhole_Sort/Pigeonhole_Sort.java
  class Pigeonhole_Sort (line 4) | public class Pigeonhole_Sort
    method pigeonhole_sort (line 6) | public static void pigeonhole_sort(int arr[],
    method main (line 37) | public static void main(String[] args)

FILE: Algorithms/Sorting/Pigeonhole_Sort/pigeonhole.py
  function pigeonhole_sort (line 1) | def pigeonhole_sort(a):

FILE: Algorithms/Sorting/Quick_Select/QuickSelect.cpp
  class Solution (line 5) | class Solution {
    method findKthLargest (line 7) | int findKthLargest(vector<int>& nums, int k) {
    method findKthLargest (line 11) | int findKthLargest(vector<int>& nums, int left, int right ,int k) {
    method swap (line 28) | void swap( vector<int>& A, int i, int j) {

FILE: Algorithms/Sorting/Quick_Select/Quick_Select.js
  function partition (line 1) | function partition(array3, l, r){
  function termFinder (line 16) | function termFinder(array1, l, r, k){

FILE: Algorithms/Sorting/Quick_Select/Quick_Select.php
  function kthSmallest (line 10) | function kthSmallest(array $list, int $kthPosition) {
  function quickSelect (line 30) | function quickSelect(array $list, int $low, int $high, int $kthIndex) {
  function partition (line 55) | function partition(array &$list, int $low, int $high) {

FILE: Algorithms/Sorting/Quick_Select/Quick_select.py
  class Solution (line 3) | class Solution:
    method findKthLargest (line 4) | def findKthLargest(self, nums: 'List[int]', k: 'int') -> 'int':
    method findKthLargest (line 20) | def findKthLargest(self, nums: 'List[int]', k: 'int') -> 'int':

FILE: Algorithms/Sorting/Quick_Select/quick_select.java
  class quick_select (line 1) | class quick_select {
    method kthLargest (line 2) | public int kthLargest(int[] arr, int k) {
    method partition (line 21) | private int partition(int[] arr, int left, int right, int pivotIndex) {
    method swap (line 38) | private void swap(int[] arr, int first, int second) {

FILE: Algorithms/Sorting/Quick_Select/quick_select.rb
  function find_kth_largest (line 4) | def find_kth_largest(nums, k)
  function quick_select (line 9) | def quick_select(a, p, r, k)            # Note the k here refers to (n -...
  function partition (line 22) | def partition(a, p, r)
  function rand_partition (line 36) | def rand_partition(a, p, r)

FILE: Algorithms/Sorting/Quick_Sort/QuickSort.java
  class QuickSort (line 3) | class QuickSort
    method partition (line 7) | int partition(int arr[], int low, int high)
    method sort (line 34) | void sort(int arr[], int low, int high)
    method printArray (line 50) | static void printArray(int arr[])
    method main (line 59) | public static void main(String args[])

FILE: Algorithms/Sorting/Quick_Sort/QuickSort.js
  function quickSort (line 1) | function quickSort(array) { // assumes an array of ints

FILE: Algorithms/Sorting/Quick_Sort/QuickSort.py
  function partition (line 12) | def partition(arr,low,high):
  function quickSort (line 29) | def quickSort(arr,low,high):

FILE: Algorithms/Sorting/Quick_Sort/Quick_Sort.cpp
  function swap (line 6) | void swap(int* a, int* b)
  function partition (line 13) | int partition (int arr[], int low, int high)
  function quickSort (line 31) | void quickSort(int arr[], int low, int high)
  function printArray (line 44) | void printArray(int arr[], int size)
  function main (line 53) | int main()

FILE: Algorithms/Sorting/Quick_Sort/Quick_Sort.go
  function swap (line 5) | func swap(num1 *int, num2 *int) {
  function partition (line 12) | func partition(elements []int, low int, high int) int {
  function quickSort (line 28) | func quickSort(elements []int, low int, high int) {
  function main (line 37) | func main() {

FILE: Algorithms/Sorting/Quick_Sort/quicksort.C
  function main (line 4) | void main()
  function partition (line 13) | int partition(int a[], int beg, int end)
  function quickSort (line 49) | void quickSort(int a[], int beg, int end)

FILE: Algorithms/Sorting/Quick_Sort/quicksort.c
  function main (line 4) | void main()
  function partition (line 13) | int partition(int a[], int beg, int end)
  function quickSort (line 49) | void quickSort(int a[], int beg, int end)

FILE: Algorithms/Sorting/Radix_Sort/Radix Sort With C (Mayukh Mitra)/Radix_sort.c
  function max (line 4) | int max(int arr[], int n)
  function counting_sort (line 14) | void counting_sort(int arr[], int n, int j)
  function radix_sort (line 35) | void radix_sort(int arr[], int n)
  function main (line 45) | int main()

FILE: Algorithms/Sorting/Radix_Sort/RadixSort.java
  class Radix_Sort (line 1) | public class Radix_Sort {
    method main (line 2) | public static void main(String[] args) {
    method largest (line 12) | static int largest(inta[])
    method radix_sort (line 22) | static void radix_sort(inta[])

FILE: Algorithms/Sorting/Radix_Sort/RadixSort.py
  function countingSort (line 5) | def countingSort(arr, exp1):
  function radixSort (line 40) | def radixSort(arr):

FILE: Algorithms/Sorting/Radix_Sort/Radix_Sort.js
  function radixSort (line 13) | function radixSort(list) {

FILE: Algorithms/Sorting/Radix_Sort/Radix_Sort.rb
  function counting_sort (line 1) | def counting_sort(input_arr, exp)
  function radix_sort (line 27) | def radix_sort(arr)

FILE: Algorithms/Sorting/Radix_Sort/Radix_sort.cs
  class Program (line 4) | class Program
    method Sort (line 6) | static void Sort(int[] arr)
    method Main (line 24) | static void Main(string[] args)

FILE: Algorithms/Sorting/Radix_Sort/radixSort.php
  function countSort (line 9) | function countSort(&$arr, $size, $exp)
  function radixsort (line 41) | function radixsort(&$arr, $size)
  function printArray (line 57) | function printArray(&$arr,$size)

FILE: Algorithms/Sorting/Radix_Sort/radixsort.cpp
  function max (line 4) | int max(int arr[], int n)
  function counting_sort (line 14) | void counting_sort(int arr[], int n, int j)
  function radix_sort (line 35) | void radix_sort(int arr[], int n)
  function main (line 43) | int main()

FILE: Algorithms/Sorting/Selection_Algorithms.cpp
  function swapping (line 3) | void swapping(int &a, int &b) {         //swap the content of a and b
  function display (line 9) | void display(int *array, int size) {
  function selectionSort (line 14) | void selectionSort(int *array, int size) {
  function main (line 25) | int main() {

FILE: Algorithms/Sorting/Selection_Sort/SelectionSort.java
  class SelectionSort (line 3) | class SelectionSort
    method sort (line 5) | void sort(int arr[])
    method printArray (line 26) | void printArray(int arr[])
    method main (line 35) | public static void main(String args[])

FILE: Algorithms/Sorting/Selection_Sort/SelectionSort.py
  function selection_sort (line 1) | def selection_sort(lst):

FILE: Algorithms/Sorting/Selection_Sort/Selection_Sort.cpp
  function selection_sort (line 4) | void selection_sort(int a[],int n){
  function main (line 15) | int main(){

FILE: Algorithms/Sorting/Selection_Sort/Selection_Sort.go
  function selectionSort (line 8) | func selectionSort(arr [100]int, n int) {
  function printArray (line 25) | func printArray(arrs [100]int, n int) {
  function main (line 32) | func main() {

FILE: Algorithms/Sorting/Selection_Sort/selection sort.cs
  class GFG (line 5) | class GFG
    method sort (line 7) | static void sort(int []arr)
    method printArray (line 29) | static void printArray(int []arr)
    method Main (line 38) | public static void Main()

FILE: Algorithms/Sorting/Selection_Sort/selection_sort.c
  function main (line 2) | int main(){

FILE: Algorithms/Sorting/Shell_Sort/Shell_Sort.c
  function main (line 4) | int main()

FILE: Algorithms/Sorting/Shell_Sort/Shell_Sort.cpp
  function ShellSort (line 7) | void ShellSort(int sortArray[], int size) {
  function main (line 24) | int main() {

FILE: Algorithms/Sorting/Shell_Sort/Shell_Sort.cs
  class ShellSort (line 1) | class ShellSort
    method printArray (line 3) | static void printArray(int []arr)
    method sort (line 11) | int sort(int []arr)
    method Main (line 32) | public static void Main()

FILE: Algorithms/Sorting/Shell_Sort/Shell_Sort.java
  class ShellSort (line 5) | public class ShellSort {
    method shellSort (line 7) | private static void shellSort(Comparable[] arr)
    method lessThan (line 24) | private static boolean lessThan(Comparable first, Comparable second)
    method swap (line 29) | private static void swap(Comparable[] arr, int first, int second)
    method printSortedArray (line 36) | private static void printSortedArray(Comparable[] arr)
    method main (line 43) | public static void main(String[] args) throws IOException

FILE: Algorithms/Sorting/Shell_Sort/shell_sort.py
  function shell (line 1) | def shell(a):

FILE: Algorithms/Sorting/Stooge_Sort/Stooge_Sort.cs
  class Program (line 12) | class Program
    method Main (line 17) | public static void Main()
    method StoogeSort (line 37) | public static void StoogeSort(ref int[] arr)
    method StoogeSort (line 47) | public static void StoogeSort(ref int[] arr, int lowIndex, int highInd...

FILE: Algorithms/Sorting/Stooge_Sort/Stooge_Sort.go
  function main (line 7) | func main() {
  function stoogesort (line 13) | func stoogesort(arr []int) {

FILE: Algorithms/Sorting/Stooge_Sort/Stooge_Sort.py
  function stooge (line 14) | def stooge(number_list: List[int], last: int, first: int = 0):

FILE: Algorithms/Sorting/Strand_Sort/Strand_Sort.cpp
  function strandSort (line 42) | void strandSort(list<int> &ip, list<int> &op)
  function main (line 61) | int main(void)

FILE: Algorithms/Sorting/Strand_Sort/Strand_sort.java
  class Strand_sort (line 2) | public class Strand_sort {
    method main (line 3) | public static void main(String args[])

FILE: Algorithms/Sorting/Strand_Sort/strand_sort.c
  type node_t (line 3) | typedef struct node_t *node, node_t;
  type node_t (line 4) | struct node_t { int v; node next; }
  type slist (line 5) | typedef struct { node head, tail; } slist;
  function push (line 7) | void push(slist *l, node e) {
  function node (line 13) | node removehead(slist *l) {
  function join (line 22) | void join(slist *a, slist *b) {
  function merge (line 27) | void merge(slist *a, slist *b) {
  function sort (line 37) | void sort(int *ar, int len)
  function show (line 60) | void show(const char *title, int *x, int len)
  function main (line 68) | int main(void)

FILE: Algorithms/Sorting/Strand_Sort/strand_sort.ts
  function strandSort (line 1) | function strandSort(arrin: number[]): number[] {

FILE: Algorithms/Sorting/Tim_Sort/Tim_Sort.c
  function min (line 6) | int min (int a, int b)
  function insertionSort (line 14) | void insertionSort (int a[], int low, int high)
  function merge (line 27) | void merge (int a[], int left, int mid, int right)
  function timSort (line 56) | void timSort (int a[], int n)
  function main (line 72) | void main ()

FILE: Algorithms/Sorting/Tim_Sort/Tim_Sort.java
  class Timsort (line 1) | class Timsort{
    method insertionSort (line 5) | public static void insertionSort(int[] arr, int left, int right)
    method merge (line 20) | public static void merge(int[] arr, int l,int m, int r)
    method timSort (line 68) | public static void timSort(int[] arr, int n)
    method printArray (line 86) | public static void printArray(int[] arr, int n)
    method main (line 95) | public static void main(String[] args)

FILE: Algorithms/Sorting/Tim_Sort/Tim_Sort.py
  function InsSort (line 3) | def InsSort(arr,start,end):
  function merge (line 13) | def merge(arr,start,mid,end):
  function TimSort (line 46) | def TimSort(arr):

FILE: Algorithms/Sorting/Topological_Sort/Topological_Sort.cpp
  class Graph (line 9) | class Graph {
  function main (line 90) | int main()

FILE: Algorithms/Sorting/Topological_Sort/Topological_sort.cs
  class Graph (line 7) | class Graph {
    method Graph (line 16) | Graph(int v)
    method AddEdge (line 25) | public void AddEdge(int v, int w) { adj[v].Add(w); }
    method TopologicalSortUtil (line 28) | void TopologicalSortUtil(int v, bool[] visited,
    method TopologicalSort (line 45) | void TopologicalSort()
    method Main (line 64) | public static void Main(string[] args)

FILE: Algorithms/Sorting/Topological_Sort/Topological_sort.py
  class Graph (line 4) | class Graph:
    method __init__ (line 5) | def __init__(self,vertices):
    method addEdge (line 10) | def addEdge(self,u,v):
    method topologicalSortUtil (line 14) | def topologicalSortUtil(self,v,visited,stack):
    method topologicalSort (line 29) | def topologicalSort(self):

FILE: Algorithms/Sorting/Tree_Sort/Tree_Sort.c
  type Node (line 6) | struct Node
  type Node (line 13) | struct Node
  type Node (line 15) | struct Node
  function storeSorted (line 23) | void storeSorted(Node *root, int arr[], int &i)
  function Node (line 35) | Node* insert(Node* node, int key)
  function treeSort (line 51) | void treeSort(int arr[], int n)
  function main (line 67) | int main()

FILE: Algorithms/Sorting/Tree_Sort/tree sort.cpp
  type tree (line 3) | struct tree{
  class TreeSort (line 8) | class TreeSort{
  function tree (line 32) | tree* TreeSort::insert2(tree *temp,tree *newnode){
  function main (line 67) | int main(){

FILE: Algorithms/Sorting/Tree_Sort/treesort.java
  class Node (line 1) | class Node{
    method Node (line 5) | Node(int value){
  class BST (line 12) | class BST{
    method BST (line 14) | BST(int value){
    method insert (line 17) | public Node insert(Node node, int value){
    method inOrder (line 33) | public void inOrder(Node node){
  class TreeSort (line 44) | public class TreeSort {
    method main (line 45) | public static void main(String[] args) {

FILE: Algorithms/Sorting/Wave_Sort/Wave_Sort.py
  function sortInWave (line 1) | def sortInWave(arr_demo, n):

FILE: Algorithms/Sorting/Wave_Sort/wave_sort.c
  function swap (line 6) | void swap(int *x, int *y)
  function sortInWave (line 14) | void sortInWave(int arr[], int n)
  function main (line 29) | int main()

FILE: Algorithms/Sorting/Wave_Sort/wave_sort.cpp
  function printArray (line 6) | void printArray(int arr[], int size)
  function swap (line 20) | void swap(int *x, int *y)
  function waveSort (line 30) | void waveSort(int arr[], int size)
  function main (line 56) | int main()

FILE: Algorithms/Stack-Algorithm/Next_Greater_Element.cpp
  function ll (line 18) | inline ll mul(ll a, ll b){ return (a * 1ll * b) % mod; }
  function ll (line 19) | inline ll sub(ll a, ll b){ ll c = a - b; if(c < 0) c += mod; return c; }
  function ll (line 20) | inline ll add(ll a, ll b){ ll c = a + b; if(c >= mod) c -= mod; return c; }
  function next_greater (line 30) | void next_greater(vector<int> &A)
  function main (line 52) | int main()

FILE: Algorithms/Stack-Algorithm/RemoveKDigitsToGetSmallestPossibleInteger.java
  class RemoveKDigitsToGetSmallestPossibleInteger (line 3) | public class RemoveKDigitsToGetSmallestPossibleInteger{
    method main (line 4) | public static void main(String[]args){
    method removeKdigits (line 19) | public static String removeKdigits(String num, int k) {

FILE: Algorithms/Stack-Algorithm/Simplify-Path/Simplify_Path.cpp
  function string (line 5) | string simplifyPath(string path)
  function main (line 28) | int main()

FILE: Algorithms/Stack-Algorithm/balanced_brackets_stack.cpp
  function isBalanced (line 4) | bool isBalanced(string str)
  function main (line 24) | int main()

FILE: Algorithms/Stack-Algorithm/immediate_smaller_element.cpp
  function main (line 25) | int main(){

FILE: Algorithms/Stack-Algorithm/longest_valid_substring.cpp
  function main (line 26) | int main(){

FILE: Algorithms/String/Anagram/AnagramChecker.c
  function main (line 2) | int main()
  function check_anagram (line 19) | int check_anagram(char a[] , char b[])

FILE: Algorithms/String/Anagram/anagram c#.cs
  class Anagrams (line 3) | class Anagrams {
    method isAnagram (line 5) | static bool isAnagram(string a, string b){
    method Main (line 28) | static void Main()

FILE: Algorithms/String/Anagram/anagram.c
  function main (line 5) | int main()
  function check_anagram (line 27) | int check_anagram(char a[], char b[])

FILE: Algorithms/String/Anagram/anagram.java
  class AnagramProgram (line 3) | public class AnagramProgram {
    method isAnagram (line 4) | static void isAnagram(String s1, String s2) {
    method main (line 36) | public static void main(String[] args) {

FILE: Algorithms/String/Anagram/anagram.py
  function check (line 2) | def check(s1, s2):

FILE: Algorithms/String/Isomorphic/Isomorphic-String.java
  class Main (line 3) | class Main
    method isIsomorphic (line 6) | public static boolean isIsomorphic(String X, String Y)
    method main (line 54) | public static void main(String[] args)

FILE: Algorithms/String/Isomorphic/isomorphic.cpp
  function isIsomorphic (line 8) | bool isIsomorphic(string X, string Y)
  function main (line 51) | int main()

FILE: Algorithms/String/KMP/KMP_Algorithm.php
  function KMPSearch (line 3) | function KMPSearch($pat, $txt)
  function computeLPSArray (line 34) | function computeLPSArray($pat, $M, &$lps)

FILE: Algorithms/String/KMP/kmp.cpp
  function KMPSearch (line 8) | void KMPSearch(string pat, string txt)
  function computeLPSArray (line 46) | void computeLPSArray(string pat, int M, string lps)
  function main (line 82) | int main()

FILE: Algorithms/String/KMP/kmp.js
  function buildLPSArray (line 6) | function buildLPSArray(pattern, M) {
  function KMPSearch (line 28) | function KMPSearch(text, pattern) {
  function test (line 57) | function test() {

FILE: Algorithms/String/LCS/LCS.py
  function LCS (line 6) | def LCS(A,B,m,n):

FILE: Algorithms/String/LCS/lcs.cpp
  function lcs (line 6) | void lcs( char *X, char *Y, int m, int n )
  function main (line 47) | int main()

FILE: Algorithms/String/LPS/longest_palindromic_substring.c
  function print (line 3) | void print(char* str, int low, int high)
  function longestSubstr (line 10) | void longestSubstr(char* str)
  function main (line 45) | int main()

FILE: Algorithms/String/LPS/longest_palindromic_substring.cpp
  function string (line 5) | string expandAroundCenter(string s, int c1, int c2) {
  function string (line 15) | string LPS(string A) {
  function main (line 33) | int main() {

FILE: Algorithms/String/LPS/longest_palindromic_substring.java
  class Solution (line 3) | class Solution {
    method longestPalindrome (line 4) | public static String longestPalindrome(String s) {
    method main (line 50) | public static void main(String[] args)

FILE: Algorithms/String/LPS/longest_palindromic_substring.js
  function longestPalSubstr (line 23) | function longestPalSubstr(str) {

FILE: Algorithms/String/LPS/longest_palindromic_substring.py
  function longestPalSubstr (line 1) | def longestPalSubstr(string):

FILE: Algorithms/String/Palindrome/Palindrome.c
  function main (line 13) | int main(int argc, char const *argv[]){
  function is_palindrome (line 36) | int is_palindrome(char *word){

FILE: Algorithms/String/Palindrome/Palindrome.cs
  class Test (line 5) | public class Test
    method Main (line 7) | public static void Main()

FILE: Algorithms/String/Palindrome/Palindrome.java
  class palindrome (line 1) | public class palindrome {
    method isPalindrome (line 2) | static boolean isPalindrome(String word) {
    method main (line 16) | public static void main(String[] args) {

FILE: Algorithms/String/Palindrome/isPalindrome.cpp
  function main (line 8) | int main() {

FILE: Algorithms/String/Palindrome/palindrome.go
  function reverse (line 10) | func reverse(s string) string {
  function main (line 18) | func main() {

FILE: Algorithms/String/Palindrome/palindrome.java
  class palindrome (line 1) | public class palindrome {
    method isPalindrome (line 2) | static boolean isPalindrome(String word) {
    method main (line 16) | public static void main(String[] args) {

FILE: Algorithms/String/Palindrome/palindrome.js
  function palindromeCheck (line 20) | function palindromeCheck(word) {

FILE: Algorithms/String/Palindrome/palindrome.php
  function isPalindrome (line 3) | function isPalindrome($str) {

FILE: Algorithms/String/Palindrome/palindrome.py
  function palindrome (line 4) | def palindrome(rawString):

FILE: Algorithms/String/Palindrome/palindrome.ts
  function palindromeCheck (line 8) | function palindromeCheck(str: string): boolean {

FILE: Algorithms/String/Palindrome/palindromecheck.go
  function Reverse (line 8) | func Reverse(s string) (result string) {
  function isPalindrome (line 15) | func isPalindrome(str string) interface{} {
  function main (line 22) | func main() {

FILE: Algorithms/String/Rabin-Karp/RabinKarpAlgo.java
  class RabinKarb (line 1) | public class RabinKarb {
    method search (line 6) | static void search(String pat, String txt, int primeNum) {
    method main (line 49) | public static void main(String[] args) {

FILE: Algorithms/String/Rabin-Karp/Rabin_Karp.cpp
  function search (line 13) | void search(char pat[], char txt[], int q)
  function main (line 70) | int main()

FILE: Algorithms/String/Rabin-Karp/Rabin_Karp.ts
  function strStr (line 1) | function strStr(text: string, pattern: string): number {

FILE: Algorithms/String/Rabin-Karp/Rabin_karp.c
  function main (line 6) | int main(){

FILE: Algorithms/String/Rabin-Karp/rabin_karp.py
  function search (line 2) | def search(pat, txt, q):

FILE: Algorithms/String/SCS/SCS.cpp
  function LCS (line 13) | int LCS(string X,string Y,int n,int m)
  function SCS (line 31) | int SCS(string X,string Y,int n,int m)
  function main (line 35) | int main()

FILE: Algorithms/String/ScrambleString.java
  class Sample (line 6) | public class Sample
    method isScramble (line 8) | static boolean isScramble(String S1, String S2)
    method main (line 55) | public static void main(String[] args) throws IOException

FILE: Algorithms/String/suffix_array.cpp
  function count_sort (line 5) | void count_sort(vector<ll>&p,vector<ll>&c)
  function main (line 24) | int main() {

FILE: Algorithms/Tree/Binary_Lifting/Binary Lifting.py
  function dfs (line 4) | def dfs(u, p, memo, lev, log, g):
  function lca (line 16) | def lca(u, v, log, lev, memo):

FILE: Algorithms/Tree/Binary_Lifting/Binary-Lifting.cpp
  function dfs (line 22) | void dfs(int ver, int par) {
  function precompute (line 44) | void precompute(int root) {
  function is_Ancestor (line 53) | bool is_Ancestor(int v1, int v2) {
  function LCA (line 57) | int LCA(int v1, int v2) {
  function main (line 82) | int main() {

FILE: Algorithms/Tree/GenericTreeImplementation/GenericTree.c
  type element (line 6) | typedef int element;
  type node (line 7) | struct node
  function GenericTree (line 14) | GenericTree create()
  function isEmpty (line 19) | int isEmpty(GenericTree gt)
  function GenericTree (line 24) | GenericTree build(element e, GenericTree firstchild, GenericTree nextsib...
  function nodeCount (line 36) | int nodeCount(GenericTree tree)
  function nodeSum (line 44) | int nodeSum(GenericTree tree)
  function nbS (line 51) | int nbS(GenericTree tree)
  function nbC (line 62) | int nbC(GenericTree tree)
  function main (line 75) | int main()

FILE: Algorithms/Tree/GenericTreeImplementation/GenericTree.cpp
  class treenode (line 6) | class treenode{
    method treenode (line 11) | treenode(int data){
  function treenode (line 22) | treenode* takeinput(){
    method treenode (line 11) | treenode(int data){
  function printtree (line 52) | void printtree(treenode* root){
  function main (line 71) | int main(){

FILE: Algorithms/Tree/GenericTreeImplementation/GenericTree.java
  class Main (line 3) | public class Main {
    method main (line 4) | public static void main(String[] args) {
  class GenericTreeImplementation (line 8) | class GenericTreeImplementation {
    class Node (line 9) | class Node {
      method Node (line 13) | Node(int d) {
    method GenericTreeImplementation (line 21) | GenericTreeImplementation() {
    method good (line 26) | private Node good(Scanner s, Node parent, int i) {

FILE: Algorithms/Tree/LCA/LCA.cpp
  class Solution (line 15) | class Solution
    method TreeNode (line 18) | TreeNode *lowestCommonAncestor(TreeNode *root, TreeNode *p, TreeNode *q)

FILE: Algorithms/Tree/LCA/LCA.cs
  class Node (line 4) | public class Node
    method Node (line 9) | public Node(int item)
  class BinaryTree (line 16) | public class BinaryTree
    method lca (line 22) | public virtual Node lca(Node node, int n1, int n2)
    method Main (line 45) | public static void Main(string[] args)

FILE: Algorithms/Tree/LCA/LCA.py
  class Solution (line 11) | class Solution:
    method lowestCommonAncestor (line 12) | def lowestCommonAncestor(self, root: 'TreeNode', p: 'TreeNode', q: 'Tr...

FILE: Algorithms/Tree/Max_Heap_Construction/minmaxheap.cpp
  function min_heapify (line 5) | void min_heapify(int *heap,int i,int n)
  function build_minheap (line 25) | void build_minheap(int *heap, int n)
  function max_heapify (line 33) | void max_heapify(int *heap, int i, int n)
  function build_maxheap (line 53) | void build_maxheap(int *heap,int n)
  function main (line 62) | int main()

FILE: Algorithms/Tree/Max_Path_Sum_BST/Max_Path_Sum_BST.cpp
  class Solution (line 13) | class Solution {
    method maxPathSum_ (line 16) | int maxPathSum_(TreeNode* root)
    method maxPathSum (line 28) | int maxPathSum(TreeNode* root) {

FILE: Algorithms/Tree/Max_Path_Sum_BST/Max_Path_Sum_BST.py
  class TestProgram (line 19) | class TestProgram(unittest.TestCase):
    method test_case_1 (line 20) | def test_case_1(self):
  class BinaryTree (line 25) | class BinaryTree:
    method __init__ (line 26) | def __init__(self, value):
    method insert (line 31) | def insert(self, values, i=0):
  function maxPathSum (line 52) | def maxPathSum(tree):
  function findMaxSum (line 57) | def findMaxSum(tree):

FILE: Algorithms/Tree/Min_Heap_Construction/min-heap-construc.cpp
  function public (line 3) | public

FILE: Algorithms/Tree/Min_Heap_Construction/min-heap-construc.py
  class MinHeap (line 1) | class MinHeap:
    method __init__ (line 2) | def __init__(self, array):
    method buildHeap (line 6) | def buildHeap(self, array):
    method siftDown (line 13) | def siftDown(self, currIdx, endIdx, heap):
    method siftUp (line 29) | def siftUp(self, currIdx, heap):
    method peek (line 37) | def peek(self):
    method remove (line 42) | def remove(self):
    method insert (line 49) | def insert(self, value):
    method swap (line 53) | def swap(self,i,j,heap):

FILE: Algorithms/Tree/Sorted-Array-To-BST/Sorted-Array-To-BST.cpp
  class TNode (line 5) | class TNode
  function TNode (line 17) | TNode* sortArrayToBST(int arr[], int start, int end)
  function TNode (line 41) | TNode* newNode(int data)
  function preOrder (line 53) | void preOrder(TNode* node)
  function main (line 63) | int main()

FILE: Algorithms/Tree/Sorted_Array_To_BST/SortedArrayToBST.java
  class Node (line 1) | class Node {
    method Node (line 6) | Node(int d) {
  class BinaryTree (line 12) | class BinaryTree {
    method sortedArrayToBST (line 14) | Node sortedArrayToBST(int arr[], int start, int end) {
    method preOrder (line 36) | void preOrder(Node node) {
  class SortedArrayToBST (line 46) | public class SortedArrayToBST {
    method main (line 48) | public static void main(String[] args) {

FILE: Algorithms/Tree/Validate_BST/Validate_BST.cpp
  type node (line 8) | struct node {
    type node (line 9) | struct node
    type node (line 10) | struct node
    method node (line 15) | node(int k): val(k), left(NULL), right(NULL), maxTillNow(MIN), minTill...
  function max (line 18) | int max(int a, int b){
  function min (line 21) | int min(int a, int b){
  function setMaxMinTillNode (line 33) | void setMaxMinTillNode( node * root){
  function isBST (line 67) | bool isBST(node * root){
  function main (line 106) | int main() {

FILE: Algorithms/Tree/Validate_BST/Validate_BST.cs
  class Node (line 3) | internal class Node
    method Node (line 8) | public Node(int item)
  class Validate_BST (line 15) | public class Validate_BST
    method IsBST (line 17) | static bool IsBST(
    method Main (line 36) | public static void Main(string[] args)

FILE: Algorithms/Tree/Validate_BST/Validate_BST.java
  class Node (line 3) | class Node {
    method Node (line 8) | Node(int value) {
  class Solution (line 14) | class Solution {
    method isValidBST (line 16) | public boolean isValidBST(Node root) {
    method helper (line 19) | public boolean helper(Node root, Integer small, Integer large)
  class Validate_BST (line 31) | public class Validate_BST
    method main (line 34) | public static void main(String[] args){

FILE: Algorithms/Tree/level_traversing/level_traversing.php
  class TreeNode (line 3) | class TreeNode {//Definition for binary tree node.
    method __construct (line 7) | function __construct($val = 0, $left = null, $right = null) {
  class Solution (line 14) | class Solution {//Recursive solution for level order traversal
    method levelOrder (line 20) | function levelOrder($root) {
    method helper (line 27) | function helper($node, &$mainList, $level) {

FILE: Algorithms/Tree/level_traversing/level_traversing.py
  class TreeNode (line 12) | class TreeNode:
    method __init__ (line 13) | def __init__(self, val=0, left=None, right=None):
  function levelOrder (line 19) | def levelOrder(root: TreeNode) -> List[List[int]]:
  function recurse_input (line 49) | def recurse_input(i, node_lst):
  function run (line 59) | def run():

FILE: Collection/ArrayDeque/ArrayDeque.java
  class ArrayDequeDemo (line 11) | public class ArrayDequeDemo
    method main (line 13) | public static void main(String[] args)

FILE: Collection/ArrayList/ArrayList .java
  class Arraylist (line 5) | public class Arraylist {
    method main (line 7) | public static void main(String[] args) {

FILE: Collection/HashMap/HashMap.java
  class HashMapDemo (line 4) | class HashMapDemo {
    method main (line 17) | public static void main(String[] args) {

FILE: Collection/HashSet/HashSet.java
  class HashSetDemo (line 5) | class HashSetDemo {
    method main (line 22) | public static void main(String[] args) {

FILE: Collection/LinkedList/LinkedList.java
  class LinkedListDemo (line 8) | class LinkedListDemo{
    method main (line 9) | public static void main(String args[]){

FILE: Collection/Queue/Deque/Deque.java
  class DequeDemo (line 3) | class DequeDemo{
    method main (line 18) | public static void main(String[] args) {

FILE: Collection/Queue/PriorityQueue/PriorityQueue.java
  class PriorityQueueDemo (line 4) | class PriorityQueueDemo{
    method main (line 15) | public static void main(String[] args) {

FILE: Collection/Queue/Queue.java
  class Main (line 5) | public class Main {
    method main (line 6) | public static void main(String[] args) {

FILE: Collection/Stack/StackCollection.java
  class StackCollection (line 4) | public class StackCollection{
    method main (line 5) | public static void main(String[] args) {

FILE: Collection/Vector/Vector.java
  class Main (line 4) | class Main {
    method main (line 6) | public static void main(String[] args)

FILE: Data-Structures/Array/Array.c
  function main (line 4) | int main()

FILE: Data-Structures/Array/Array.cpp
  function main (line 4) | int main()

FILE: Data-Structures/Array/Array.go
  function main (line 5) | func main() {

FILE: Data-Structures/Array/Array.java
  class Array (line 5) | public class Array {
    method main (line 7) | public static void main(String[] args) {

FILE: Data-Structures/Array/Array.ts
  function readInput (line 9) | function readInput(prompt: string): Promise<string> {
  function main (line 28) | async function main() {

FILE: Data-Structures/Array/array_menudriven.cpp
  class Array (line 4) | class Array
    method Array (line 13) | Array()
    method Array (line 19) | Array(int sz)
  function Array (line 301) | Array* Array::Merge(Array arr2)
    method Array (line 13) | Array()
    method Array (line 19) | Array(int sz)
  function Array (line 330) | Array* Array::Union(Array arr2)
    method Array (line 13) | Array()
    method Array (line 19) | Array(int sz)
  function Array (line 366) | Array* Array::Inter(Array arr2)
    method Array (line 13) | Array()
    method Array (line 19) | Array(int sz)
  function Array (line 395) | Array* Array::Diff(Array arr2)
    method Array (line 13) | Array()
    method Array (line 19) | Array(int sz)
  function main (line 427) | int main()

FILE: Data-Structures/Graph/UsingList.cpp
  function displayAdjList (line 5) | void displayAdjList(list<int> adj_list[], int v) {
  function add_edge (line 15) | void add_edge(list<int> adj_list[], int u, int v) {    //add v into the ...
  function main (line 19) | main(int argc, char* argv[]) {

FILE: Data-Structures/Graph/UsingList.py
  class node (line 6) | class node():
    method __init__ (line 8) | def __init__(self, node_name):
    method add_neigbor (line 12) | def add_neigbor(self, neighbor): # neighbor is node name. not node obj...
    method list_edges_of (line 15) | def list_edges_of(self):
    method get_node_name (line 18) | def get_node_name(self):
    method __str__ (line 21) | def __str__(self):
  class graph (line 25) | class graph():
    method __init__ (line 27) | def __init__(self):
    method add_node (line 33) | def add_node(self, node_name):
    method get_node (line 41) | def get_node(self, node_name_to_search): # return node which its name ...
    method get_edges_of_node (line 48) | def get_edges_of_node(self, node_name_to_search):
    method update_adj_list (line 52) | def update_adj_list(self):
    method add_edge (line 62) | def add_edge(self, from_node, to_node): # in fact from and to notation...
    method get_all_node_objects_in_graph (line 91) | def get_all_node_objects_in_graph(self):
    method __iter__ (line 94) | def __iter__(self):
    method __contains__ (line 97) | def __contains__(self, node_name_to_search):
  function bfs (line 113) | def bfs(graph, entry_node):
  function dfs (line 136) | def dfs(graph, start):

FILE: Data-Structures/Graph/UsingMatrix.cpp
  function DFS (line 7) | void DFS(int matrix[5][5], int visit[],int visitTo=0){
  function BFS (line 15) | void BFS(int matrix[5][5], int visit[], int row=0){
  function main (line 32) | int main()

FILE: Data-Structures/Graph/graph_implementation_in_C_bfs_dfs.c
  type node (line 11) | struct node{
  type node (line 17) | struct node
  type node (line 18) | struct node
  type node (line 18) | struct node
  type Graph (line 24) | struct Graph{
  type Graph (line 31) | struct Graph
  type Graph (line 32) | struct Graph
  type Graph (line 32) | struct Graph
  type node (line 35) | struct node
  function addEdge (line 46) | void addEdge(struct Graph* graph, int src, int dest){
  type queue (line 58) | struct queue{
  type queue (line 65) | struct queue
  type queue (line 66) | struct queue
  type queue (line 66) | struct queue
  function enqueue (line 73) | void enqueue( struct queue* q, int value ){
  function isEmpty (line 85) | int isEmpty( struct queue* q ){
  function dequeue (line 93) | int dequeue( struct queue* q ){
  function printQueue (line 110) | void printQueue( struct queue* q ){
  function bfs (line 123) | void bfs( struct Graph* graph, int startVertex ){
  function DFS (line 149) | void DFS(struct Graph* graph, int vertex){
  function main (line 167) | int main(){

FILE: Data-Structures/HashSet/Hash-Set.c
  type hashpair (line 9) | typedef struct {
  type Hashset (line 21) | typedef struct {
  function Hashset (line 43) | Hashset make_hashset(int size, long (*hashfn)(void *)) {
  function rehash (line 64) | static void rehash(Hashset *hs) {
  function hs_add (line 104) | int hs_add(Hashset *hs, void *value) {
  function hs_contains (line 139) | int hs_contains(Hashset *hs, void *value) {
  function hs_delete (line 211) | void hs_delete(Hashset *hs, void (*delfn)(void *)) {
  function __hash__ (line 232) | static inline long __hash__(void *val) { return (long)val; }
  function __del__ (line 234) | static inline void __del__(
  function main (line 238) | void main() {

FILE: Data-Structures/LinkedList/Circular_Linked_List/CircularLinkedList.c
  type node (line 6) | struct node {
  type node (line 13) | struct node
  type node (line 14) | struct node
  function isEmpty (line 16) | bool isEmpty() {
  function length (line 20) | int length() {
  function insertFirst (line 39) | void insertFirst(int key, int data) {
  type node (line 59) | struct node
  type node (line 62) | struct node
  function printList (line 77) | void printList() {
  function main (line 94) | void main() {

FILE: Data-Structures/LinkedList/Circular_Linked_List/CircularLinkedList.java
  class CircularLinkedList (line 1) | public class CircularLinkedList {
    method CircularLinkedList (line 5) | public CircularLinkedList() {
    method isEmpty (line 9) | public boolean isEmpty() {
    method addToTail (line 13) | public void addToTail(int el) {
    method printAll (line 27) | public void printAll() {
  class Node (line 38) | class Node {
    method Node (line 43) | public Node(int el) {
    method Node (line 49) | public Node(int el, Node next, Node prev) {

FILE: Data-Structures/LinkedList/Circular_Linked_List/Circular_Link_List.cpp
  class Node (line 4) | class Node{
  function createNode (line 10) | void createNode(){
  function print (line 31) | void print(){
  function main (line 48) | int main(){

FILE: Data-Structures/LinkedList/Circular_Linked_List/circularLinkedList.js
  function circularLinkedList (line 1) | function circularLinkedList() {

FILE: Data-Structures/LinkedList/Circular_Linked_List/circularLinkedList.py
  class Node (line 1) | class Node:
    method __init__ (line 2) | def __init__(self, data):
  class CircularLinkedList (line 6) | class CircularLinkedList:
    method __init__ (line 7) | def __init__(self, key):
  function insert_after (line 12) | def insert_after(n, a):
  function insert_at_last (line 16) | def insert_at_last(l, n):
  function delete (line 21) | def delete(l, n):
  function traversal (line 36) | def traversal(l):

FILE: Data-Structures/LinkedList/Circular_Linked_List/csharp/CircularLinkedList.cs
  class Circularlist (line 9) | class Circularlist
    method Circularlist (line 13) | public Circularlist()
    method Circularlist (line 18) | public Circularlist(int value)
    method Insdata (line 23) | public Circularlist Insdata(int value)
    method Deldata (line 39) | public int Deldata()
    method Traverse (line 51) | public void Traverse()
    method Traverse (line 55) | public void Traverse(Circularlist node)
    method Gnodes (line 68) | public int Gnodes()
    method Gnodes (line 72) | public int Gnodes(Circularlist node)
    method Main (line 88) | static void Main(string[] args)

FILE: Data-Structures/LinkedList/Doubly_Linked_List/Double linked List circular with double headers C++/dllist.cpp
  function DLNode (line 30) | DLNode* DLList::insertData(DLNode *p, Agent&e) {
  function DLNode (line 91) | DLNode *DLList::getPrevPos(DLNode*p) {
  function DLNode (line 99) | DLNode *DLList::getNextPos(DLNode* p) {
  function DLNode (line 106) | DLNode *DLList::findData(Agent& e) {
  function DLNode (line 152) | DLNode* DLList::getFirstPos() {
  function DLNode (line 158) | DLNode* DLList::getLastPos() {
  function Agent (line 165) | Agent& DLList::retrieve(DLNode* p) {

FILE: Data-Structures/LinkedList/Doubly_Linked_List/Double linked List circular with double headers C++/dllist.h
  function class (line 8) | class DLList {

FILE: Data-Structures/LinkedList/Doubly_Linked_List/Double linked List circular with double headers C++/dlnode.cpp
  function Agent (line 19) | Agent* DLNode::getDataPtr() {
  function Agent (line 23) | Agent& DLNode::getData() {
  function DLNode (line 31) | DLNode* DLNode::getPrev() {
  function DLNode (line 35) | DLNode* DLNode::getNext() {

FILE: Data-Structures/LinkedList/Doubly_Linked_List/Double linked List circular with double headers C++/dlnode.h
  function class (line 5) | class DLNode {

FILE: Data-Structures/LinkedList/Doubly_Linked_List/Double linked List circular with double headers C++/listexception.h
  function class (line 6) | class ListException : public std::exception {

FILE: Data-Structures/LinkedList/Doubly_Linked_List/Double linked List circular with double headers C++/main.cpp
  function main (line 5) | int main() {

FILE: Data-Structures/LinkedList/Doubly_Linked_List/Double linked List circular with double headers C++/nodeexception.h
  function class (line 5) | class NodeException : public std::exception {

FILE: Data-Structures/LinkedList/Doubly_Linked_List/DoubleLinkedList.java
  class DoubleLinkedList (line 1) | class DoubleLinkedList<T>
    method LinkedList (line 7) | public LinkedList(LinkedList<T> prev, T value, LinkedList<T> next) {
    method LinkedList (line 13) | public LinkedList(T value) {
    method GetPrev (line 17) | public LinkedList<T> GetPrev() {
    method GetValue (line 21) | public T GetValue() {
    method GetNext (line 25) | public LinkedList<T> GetNext() {
    method SetPrev (line 29) | public void SetPrev(LinkedList<T> prev) {
    method SetValue (line 33) | public void SetValue(T value) {
    method SetNext (line 37) | public void SetNext(LinkedList<T> next) {

FILE: Data-Structures/LinkedList/Doubly_Linked_List/DoublyLinkedList.cs
  class DoublyLinkedListNode (line 9) | public class DoublyLinkedListNode<T>
    method DoublyLinkedListNode (line 12) | public DoublyLinkedListNode(T value)
  class DoublyLinkedList (line 29) | public class DoublyLinkedList<T>
    method Add (line 34) | public int Add(T item)
    method Insert (line 57) | public void Insert(int index, T item)
    method Remove (line 93) | public bool Remove(T item)
    method Check (line 150) | public bool Check(T item)
    method Search (line 169) | public T Search(T item)
    method isEmpty (line 193) | public bool isEmpty()
    method Size (line 202) | public int Size()
    method Index (line 212) | public int Index(T item)

FILE: Data-Structures/LinkedList/Doubly_Linked_List/DoublyLinkedList_C++_Template/DLL.h
  type Node (line 14) | struct Node {
  type Node (line 141) | struct Node {

FILE: Data-Structures/LinkedList/Doubly_Linked_List/DoublyLinkedList_C++_Template/DLLtest.cpp
  function main (line 6) | int main(void) {

FILE: Data-Structures/LinkedList/Doubly_Linked_List/Doubly_Linked_List.py
  class Node (line 2) | class Node:
    method __init__ (line 3) | def __init__(self, value):
  class DoublyLinkedList (line 9) | class DoublyLinkedList:
    method __init__ (line 10) | def __init__(self):
    method setHead (line 14) | def setHead(self, node):
    method setTail (line 22) | def setTail(self, node):
    method insertBefore (line 28) | def insertBefore(self, node, nodeToInsert):
    method insertAfter (line 42) | def insertAfter(self, node, nodeToInsert):
    method insertAtPosition (line 55) | def insertAtPosition(self, position, nodeToInsert):
    method removeNodesWithValue (line 70) | def removeNodesWithValue(self, value):
    method remove (line 79) | def remove(self, node):
    method removeNodeBindings (line 87) | def removeNodeBindings(self,node):
    method containsNodeWithValue (line 96) | def containsNodeWithValue(self, value):

FILE: Data-Structures/LinkedList/Doubly_Linked_List/double_linked_list.c
  type Node (line 3) | struct Node
  function create (line 9) | void create(int A[],int n)
  function Display (line 27) | void Display(struct Node *p)
  function Length (line 36) | int Length(struct Node *p)
  type Node (line 46) | struct Node
  type Node (line 48) | struct Node
  type Node (line 54) | struct Node
  type Node (line 54) | struct Node
  type Node (line 65) | struct Node
  type Node (line 65) | struct Node
  type Node (line 68) | struct Node
  function main (line 79) | int main()

FILE: Data-Structures/LinkedList/Doubly_Linked_List/doubly.c
  type node (line 4) | struct node{
  function insert (line 9) | void insert(struct node **LH,struct node **RH,int val){
  function Display (line 73) | void Display(struct node **LH,struct node ** RH){
  function delete_Link (line 83) | void delete_Link(struct node **LH,struct node **RH){
  function main (line 145) | int main(){

FILE: Data-Structures/LinkedList/Doubly_Linked_List/doubly_ll.py
  class Node (line 4) | class Node(object):
    method __init__ (line 6) | def __init__(self, data=None, next=None, prev=None):
  class doubly_linked_list (line 12) | class doubly_linked_list(object):
    method __init__ (line 13) | def __init__(self):
    method append_item (line 18) | def append_item(self, data):
    method iter (line 30) | def iter(self):
    method print_foward (line 38) | def print_foward(self):
    method reverse (line 42) | def reverse(self):

FILE: Data-Structures/LinkedList/Doubly_Linked_List/simple linked list circular without header/main.cpp
  function main (line 5) | int main()

FILE: Data-Structures/LinkedList/Doubly_Linked_List/simple linked list circular without header/sllist.cpp
  function SLNode (line 17) | SLNode* SLList::getPrevPos( SLNode*& p) {
  function SLNode (line 54) | SLNode* SLList::findData( Client& e) {
  function SLNode (line 162) | SLNode* SLList::getFirsPos() {
  function SLNode (line 166) | SLNode* SLList::getLastPos() {
  function SLNode (line 178) | SLNode* SLList::getNextPos( SLNode*& p) { //pendiente
  function Client (line 186) | Client& SLList::retrieve( SLNode* p) {

FILE: Data-Structures/LinkedList/Doubly_Linked_List/simple linked list circular without header/sllist.h
  function class (line 8) | class SLList {

FILE: Data-Structures/LinkedList/Doubly_Linked_List/simple linked list circular without header/slnode.cpp
  function Client (line 8) | Client& SLNode::getData() {
  function SLNode (line 11) | SLNode* SLNode::getNext() {

FILE: Data-Structures/LinkedList/Doubly_Linked_List/simple linked list circular without header/slnode.h
  function class (line 6) | class SLNode {

FILE: Data-Structures/LinkedList/Singly_Linked_List/Delete_Kth_Node_From_End/Delete_Kth_Node_From_End.cpp
  type node (line 3) | struct node
    type node (line 6) | struct node
  type node (line 8) | struct node
    type node (line 6) | struct node
  function nodeptr (line 9) | nodeptr getNode(long long int item)
  function nodeptr (line 16) | nodeptr insertAtTheBeginning(long long int item, nodeptr start)
  function nodeptr (line 28) | nodeptr insertAtTheEnd(long long int item, nodeptr start)
  function nodeptr (line 39) | nodeptr insertAtLocation(long long int item, nodeptr start, long long in...
  function nodeptr (line 55) | nodeptr deleteFirst(nodeptr start)
  function nodeptr (line 62) | nodeptr deleteGivenNode(long long int item, nodeptr start)
  function display (line 77) | void display(nodeptr start)
  function countNodes (line 87) | long long int countNodes(nodeptr start)
  function nodeptr (line 101) | nodeptr deleteNode(nodeptr start, long long int counter, long long int k)
  function main (line 119) | int main()

FILE: Data-Structures/LinkedList/Singly_Linked_List/Delete_Kth_Node_From_End/Delete_Kth_Node_From_End.java
  class Delete_Kth_Node_From_End (line 3) | class Delete_Kth_Node_From_End
    class Node (line 6) | static class Node
    method create (line 12) | static Node create(Node head, int x)
    method removeNthFromEnd (line 31) | static Node removeNthFromEnd(Node head, int B)
    method display (line 70) | static void display(Node head)
    method main (line 81) | public static void main(String[] args)

FILE: Data-Structures/LinkedList/Singly_Linked_List/Delete_Kth_Node_From_End/Delete_Kth_Node_From_End.py
  function fibMonaccianSearch (line 7) | def fibMonaccianSearch(arr, x, n):

FILE: Data-Structures/LinkedList/Singly_Linked_List/Delete_Kth_Node_From_End/Delete_Kth_Node_From_End.rb
  class Node (line 1) | class Node
    method initialize (line 4) | def initialize(value)
  class SinglyLinkedList (line 10) | class SinglyLinkedList
    method initialize (line 11) | def initialize
    method insert (line 16) | def insert(value)
    method delete_kth_from_end (line 30) | def delete_kth_from_end(k)
    method print_list (line 45) | def print_list

FILE: Data-Structures/LinkedList/Singly_Linked_List/Detect_Cycle/CycleDetection.c
  type LinkedListNode (line 8) | typedef struct LinkedListNode LinkedListNode;
  type LinkedListNode (line 11) | struct LinkedListNode {
  function LinkedListNode (line 16) | LinkedListNode* _insert_node_into_singlylinkedlist(LinkedListNode *head,...
  function hasCycle (line 34) | bool hasCycle(LinkedListNode* head) {
  function main (line 49) | int main()

FILE: Data-Structures/LinkedList/Singly_Linked_List/Detect_Cycle/CycleDetection.java
  class Node (line 4) | class Node {
    method Node (line 8) | Node(int value) {
  class Solution (line 14) | class Solution{
    method create_list (line 17) | public void create_list(Node head,int node_value){
    method hasCycle (line 31) | public boolean hasCycle(Node head) {
  class CycleDetection (line 47) | public class CycleDetection{
    method main (line 48) | public static void main(String[] args){

FILE: Data-Structures/LinkedList/Singly_Linked_List/Detect_Cycle/DetectCycle.cpp
  class Node (line 6) | class Node {
  function push (line 12) | void push(Node** head_ref, int new_data)
  function detectLoop (line 26) | int detectLoop(Node* list)
  function main (line 40) | int main()

FILE: Data-Structures/LinkedList/Singly_Linked_List/Detect_Cycle/DetectCycle.py
  class Node (line 2) | class Node:
    method __init__ (line 6) | def __init__(self, data):
  class LinkedList (line 10) | class LinkedList:
    method __init__ (line 13) | def __init__(self):
    method push (line 18) | def push(self, new_data):
    method printList (line 25) | def printList(self):
    method detectCycle (line 32) | def detectCycle(self):

FILE: Data-Structures/LinkedList/Singly_Linked_List/Detect_Cycle/DetectCycle.ts
  class ListNode (line 2) | class ListNode {
    method constructor (line 8) | constructor(data: any) {
  class LinkedList (line 14) | class LinkedList {
    method constructor (line 18) | constructor() {
    method append (line 24) | append(data: any) {
    method hasCycle (line 39) | hasCycle() {

FILE: Data-Structures/LinkedList/Singly_Linked_List/Detect_Cycle/Detect_Cycle.js
  class ListNode (line 1) | class ListNode {
    method constructor (line 2) | constructor(data) {
  class LinkedList (line 8) | class LinkedList {
    method constructor (line 9) | constructor(head = null) {
    method add (line 14) | add(element)
    method hasCycle (line 41) | hasCycle (head) {

FILE: Data-Structures/LinkedList/Singly_Linked_List/Detect_Cycle/detect_cycle.cs
  class Node (line 4) | public class Node
    method Node (line 8) | public Node(int val)
  class ClosedLoop (line 14) | class ClosedLoop
    method DetectLoop (line 16) | public static bool DetectLoop(Node _head)
    method Main (line 32) | static void Main(string[] args)

FILE: Data-Structures/LinkedList/Singly_Linked_List/Detect_Cycle/detect_cycle.go
  type Node (line 5) | type Node struct
  function NewNode (line 10) | func NewNode(value int) *Node {
  function DetectLoop (line 17) | func DetectLoop(head *Node) bool {
  function main (line 31) | func main()  {

FILE: Data-Structures/LinkedList/Singly_Linked_List/Java/PalindromeLinkedList.java
  class ListNode (line 3) | class ListNode {
    method ListNode (line 6) | ListNode() {}
    method ListNode (line 7) | ListNode(int val) { this.val = val; }
    method ListNode (line 8) | ListNode(int val, ListNode next) { this.val = val; this.next = next; }
  class LinkedList (line 11) | class LinkedList {
    method addToTheLast (line 13) | public void addToTheLast(ListNode node) {
    method isPalindrome (line 27) | public boolean isPalindrome(ListNode head) {
    method reverse (line 49) | public ListNode reverse(ListNode head) {
  class PalindromLinkedList (line 62) | class PalindromLinkedList{
    method main (line 63) | public static void main(String args[]){

FILE: Data-Structures/LinkedList/Singly_Linked_List/LinkedList.cs
  class LinkedList (line 1) | class LinkedList<T>
    method LinkedList (line 6) | public LinkedList(T value, LinkedList<T> next)
    method LinkedList (line 12) | public LinkedList(T value) : this(value, null) {}
    method GetValue (line 14) | public T GetValue()
    method GetNext (line 19) | public LinkedList<T> GetNext()
    method SetValue (line 24) | public void SetValue(T value)
    method SetNext (line 29) | public void SetNext(LinkedList<T> next)

FILE: Data-Structures/LinkedList/Singly_Linked_List/LinkedList.java
  class LinkedList (line 1) | class LinkedList<T>
    method LinkedList (line 6) | public LinkedList(T value, LinkedList<T> next) {
    method LinkedList (line 11) | public LinkedList(T value) {
    method GetValue (line 15) | public T GetValue() {
    method GetNext (line 19) | public LinkedList<T> GetNext() {
    method SetValue (line 23) | public void SetValue(T value) {
    method SetNext (line 27) | public void SetNext(LinkedList<T> next) {

FILE: Data-Structures/LinkedList/Singly_Linked_List/LinkedList.py
  class Node (line 1) | class Node:
    method __init__ (line 2) | def __init__(self, dataval=None):
  class SLinkedList (line 7) | class SLinkedList:
    method __init__ (line 8) | def __init__(self):

FILE: Data-Structures/LinkedList/Singly_Linked_List/LinkedListAndOperations.cpp
  type list (line 5) | struct list{
  function display_list (line 14) | void display_list(){
  function insert_at_first (line 29) | void insert_at_first(int z){
  function insert_at_last (line 42) | void insert_at_last(int n){
  function insert_at_mid (line 58) | void insert_at_mid(int a,int b){
  function delete_first (line 74) | void delete_first(){
  function delete_last (line 80) | void delete_last(){
  function delete_any (line 96) | void delete_any(int a){
  function count_list (line 115) | void count_list(){
  function get_max_from_list (line 131) | void get_max_from_list(){
  function reverse_list (line 148) | void reverse_list(){
  function main (line 161) | int main(){

FILE: Data-Structures/LinkedList/Singly_Linked_List/LoopDetection.cpp
  type Node (line 38) | struct Node {
    type Node (line 40) | struct Node
  function Node (line 42) | Node* newNode(int key)
    type Node (line 40) | struct Node
  function printList (line 49) | void printList(Node* head)
  function distance (line 57) | int distance(Node* first, Node* last)
  function detectLoop (line 68) | bool detectLoop(Node* head)
  function main (line 88) | int main()

FILE: Data-Structures/LinkedList/Singly_Linked_List/MiddleElementLL.cpp
  type Node (line 4) | struct Node{
    type Node (line 6) | struct Node
  function main (line 9) | int main() {

FILE: Data-Structures/LinkedList/Singly_Linked_List/MiddleElementLinkedList.java
  class Main (line 2) | public class Main
    class Node (line 5) | class Node{
      method Node (line 8) | Node(int data){
    method insert_At_beginning (line 13) | public void insert_At_beginning(int data) {
    method isEmpty (line 26) | public boolean isEmpty()
    method print (line 32) | public void print() {
    method insert_At_End (line 41) | public void insert_At_End(int data)
    method delete_From_Beginning (line 56) | public void delete_From_Beginning()
    method delete_From_End (line 62) | public void delete_From_End()
    method delete_At_Position (line 76) | public void delete_At_Position(int c)
    method insert_At_Position (line 92) | public void insert_At_Position(int c,int data)
    method count (line 113) | public void count()
    method main (line 123) | public static void main(String[] args) {

FILE: Data-Structures/LinkedList/Singly_Linked_List/Palindrome.ts
  class LinkedList (line 1) | class LinkedList {
    method constructor (line 3) | constructor(item: LinkedListItem) {
    method append (line 8) | append(val: number) {
    method prepend (line 27) | prepend(val: number) {
    method insert (line 36) | insert(val: number, previousItem: LinkedListItem) {
    method delete (line 56) | delete(val: number) {
    method showInArray (line 85) | showInArray() {
    method isPalindrome (line 102) | isPalindrome(head: any) {
  class LinkedListItem (line 118) | class LinkedListItem {
    method constructor (line 122) | constructor(val: number) {

FILE: Data-Structures/LinkedList/Singly_Linked_List/PalindromeLinkedList.cpp
  class Node (line 4) | class Node
    method Node (line 8) | Node(int d)
  function isPalin (line 15) | bool isPalin(Node *head)
  function main (line 48) | int main()

FILE: Data-Structures/LinkedList/Singly_Linked_List/PalindromeLinkedList.js
  class LinkedListNode (line 2) | class LinkedListNode {
    method constructor (line 3) | constructor(char, next) {
  class LinkedList (line 8) | class LinkedList {
    method constructor (line 9) | constructor(chars) {
    method isPalindrome (line 19) | isPalindrome() {

FILE: Data-Structures/LinkedList/Singly_Linked_List/Remove duplicates from linked_list.c
  type node (line 4) | struct node
  type node (line 10) | struct node
  type node (line 11) | struct node
  type node (line 12) | struct node
  type node (line 13) | struct node
  function main (line 15) | int main()
  function dup_delete (line 34) | void dup_delete(struct node **head)
  function create (line 65) | void create(struct node **head)
  function display (line 92) | void display(struct node *p)
  function release (line 102) | void release(struct node **head)

FILE: Data-Structures/LinkedList/Singly_Linked_List/Remove duplicates in a Linked List.cpp
  class Node (line 3) | class Node{
  function create (line 8) | void create(int size){
  function deleteNum (line 33) | void deleteNum(){
  function display (line 49) | void display(){
  function main (line 60) | int main()

FILE: Data-Structures/LinkedList/Singly_Linked_List/Remove_Duplicates_in_LL.py
  class Node (line 5) | class Node:
    method __init__ (line 9) | def __init__(self, data):
  class LinkedList (line 13) | class LinkedList:
    method __init__ (line 16) | def __init__(self):
    method push (line 21) | def push(self, new_data):
    method deleteNode (line 29) | def deleteNode(self, key):
    method printList (line 63) | def printList(self):
    method removeDuplicates (line 71) | def removeDuplicates(self):

FILE: Data-Structures/LinkedList/Singly_Linked_List/Reversed_Linked_List/ReversedLinkedList.js
  class LinkedListNode (line 1) | class LinkedListNode {
    method constructor (line 3) | constructor(value){
  class LinkedList (line 9) | class LinkedList {
    method constructor (line 11) | constructor(){
    method push (line 16) | push(value){
    method reverse (line 24) | reverse() {

FILE: Data-Structures/LinkedList/Singly_Linked_List/Reversed_Linked_List/reverseLinkedList.c
  type NODE (line 5) | typedef struct Node
  function NODE (line 12) | NODE *insert(NODE* head, int val)
  function NODE (line 21) | NODE *reverse(NODE *head)
  function print_ (line 37) | void print_(NODE *head)
  function main (line 48) | int main()

FILE: Data-Structures/LinkedList/Singly_Linked_List/Sublist_Search.rb
  class LinkedList (line 2) | class LinkedList
    class Node (line 5) | class Node
      method initialize (line 9) | def initialize(val, nextNode)
    method initialize (line 16) | def initialize(val)
    method insert (line 21) | def self.insert(node, val)
    method search (line 36) | def self.search(listToFind, listBeingSearched)
    method prettyPrint (line 85) | def self.prettyPrint(node)

FILE: Data-Structures/LinkedList/Singly_Linked_List/linked list.c
  type node (line 8) | struct node{
  type node (line 12) | struct node
  function main (line 18) | int main()
  function create (line 44) | void create()
  function display (line 66) | void display()
  function insert_beg (line 74) | void insert_beg()
  function insert_end (line 85) | void insert_end()
  function insert_at_loc (line 100) | void insert_at_loc()
  function count_node (line 117) | void count_node()
  function delete (line 128) | void delete()

FILE: Data-Structures/LinkedList/Singly_Linked_List/linked.cpp
  type Node (line 6) | struct Node
  function main (line 18) | int main()
  function Node (line 64) | Node*Create_New_Node(int n)
  function Insert_End (line 71) | void Insert_End(Node*np)
  function Display (line 82) | void Display(Node*np)
  function DelNode (line 92) | void DelNode()
  function Search (line 106) | void Search(Node*np)

FILE: Data-Structures/LinkedList/Singly_Linked_List/linkedlist.cpp
  type node (line 15) | struct node
    type node (line 21) | struct node
  class single_llist (line 33) | class single_llist
    method single_llist (line 59) | single_llist()
  function main (line 77) | main()
  function node (line 239) | node *single_llist::create_node(int value)
    type node (line 21) | struct node
  type node (line 289) | struct node
    type node (line 21) | struct node
  type node (line 337) | struct node
    type node (line 21) | struct node
  type node (line 377) | struct node
    type node (line 21) | struct node
  type node (line 471) | struct node
    type node (line 21) | struct node
  type node (line 543) | struct node
    type node (line 21) | struct node
  type node (line 637) | struct node
    type node (line 21) | struct node
  type node (line 709) | struct node
    type node (line 21) | struct node
  type node (line 751) | struct node
    type node (line 21) | struct node
  type node (line 811) | struct node
    type node (line 21) | struct node

FILE: Data-Structures/LinkedList/Singly_Linked_List/merge2sortedlinkedlists.cpp
  type node (line 5) | struct node {
    type node (line 7) | struct node
  function node (line 9) | node *createList(int *arr, int n){
    type node (line 7) | struct node
  function displayList (line 22) | void displayList(node *head){
  function node (line 29) | node *mergeSortedLists(node *head1, node *head2){
    type node (line 7) | struct node
  function main (line 46) | int main(){

FILE: Data-Structures/LinkedList/Singly_Linked_List/middle.ts
  function main (line 1) | function main() {
  class NodeCell (line 11) | class NodeCell {
    method constructor (line 19) | constructor(val: string){
  class SinglyLinkedList (line 25) | class SinglyLinkedList {
    method constructor (line 32) | constructor(){
    method push (line 41) | push(...values: string[]){
    method findMiddle (line 58) | findMiddle(): NodeCell{

FILE: Data-Structures/LinkedList/detect_cycle.rb
  class ListNode (line 2) | class ListNode
    method initialize (line 4) | def initialize(val)
  function detect_cycle (line 13) | def detect_cycle(head)

FILE: Data-Structures/LinkedList/sparce matrix/sparce addition.cpp
  type node (line 3) | struct node
    type node (line 6) | struct node
  function create (line 8) | void create(struct node **h)
  function display1 (line 26) | void display1(struct node *h)
  function display2 (line 35) | void display2(struct node *h)
  function add (line 61) | void add(struct node *h1,struct node *h2,struct node **h3)
  function main (line 109) | int main()

FILE: Data-Structures/Queue/Circular-Queue/circular_queue.c
  type queue (line 5) | struct queue
  function main (line 16) | void main(){
  function enqueue (line 38) | void enqueue(int x)
  function dequeue (line 53) | void dequeue()
  function display (line 77) | void display()

FILE: Data-Structures/Queue/Circular-Queue/circular_queue.cs
  class CircularQueue (line 9) | public class CircularQueue
    method CircularQueue (line 16) | public CircularQueue(int MaxSize)
    method ResetQueue (line 26) | public void ResetQueue()
    method Enqueue (line 47) | public bool Enqueue(object obj)
    method Dequeue (line 64) | public object Dequeue()
    method IsQueueFull (line 79) | private bool IsQueueFull()

FILE: Data-Structures/Queue/Circular-Queue/circular_queue_LL.c
  type node (line 4) | struct node{
  type queue (line 8) | struct queue{
  function enqueue (line 13) | void enqueue(struct queue *q){
  function dequeue (line 26) | void dequeue(struct queue *q){
  function display (line 43) | void display(struct queue *q){
  function main (line 52) | int main(){

FILE: Data-Structures/Queue/Circular-Queue/circular_queue_array_implementation.c
  function isFull (line 4) | int isFull(int size){
  function isEmpty (line 9) | int isEmpty(){
  function display (line 15) | void display(int queue[],int size){
  function enqueue (line 32) | void enqueue(int queue[],int element,int size){
  function dequeue (line 49) | void dequeue(int queue[]){
  function main (line 65) | int main(){

FILE: Data-Structures/Queue/Circular-Queue/cirqueue.cpp
  function main (line 14) | int main()
  function enqueue (line 49) | void enqueue(int temp)
  function dequeue (line 72) | void dequeue()
  function display_CQ (line 91) | void display_CQ()

FILE: Data-Structures/Queue/Deque/Deque.cpp
  type node (line 5) | struct node
    method node (line 11) | node(int x, node * pr, node * nx){
  type myDeque (line 18) | struct myDeque
    method push (line 25) | void push(int x) {
    method myDeque (line 33) | myDeque()
    method push_back (line 40) | void push_back(int x) {
    method push_front (line 53) | void push_front(int x) {
    method pop_back (line 66) | void pop_back() {
    method pop_front (line 79) | void pop_front() {
    method front (line 91) | void front() {
    method back (line 98) | void back() {
    method size (line 105) | int size() {
    method clear (line 108) | void clear() {
    method empty (line 113) | bool empty() {
  function main (line 119) | int main()

FILE: Data-Structures/Queue/Deque/Deque.java
  class Deque (line 4) | public class Deque{
    method insertFront (line 8) | public void insertFront(int item){
    method insertRear (line 15) | public void insertRear(int item){
    method removeFront (line 22) | public void removeFront(){
    method removeRear (line 33) | public void removeRear(){
    method peakFront (line 44) | public int peakFront(){
    method peakRear (line 51) | public int peakRear(){
    method main (line 57) | public static void main(String a[]){

FILE: Data-Structures/Queue/Deque/Deque.js
  class Deque (line 1) | class Deque {
    method constructor (line 2) | constructor() {
    method addFront (line 6) | addFront(value) {
    method removeFront (line 11) | removeFront() {
    method peekFront (line 18) | peekFront() {
    method addBack (line 22) | addBack(value) {
    method removeBack (line 27) | removeBack() {
    method peekBack (line 34) | peekBack() {

FILE: Data-Structures/Queue/Deque/Deque.py
  class Deque (line 2) | class Deque():
    method __init__ (line 5) | def __init__(self, data=None):
    method append (line 11) | def append(self, item):
    method appendleft (line 15) | def appendleft(self, item):
    method pop (line 19) | def pop(self):
    method popleft (line 23) | def popleft(self):
    method index (line 27) | def index(self, item, start, stop):
    method insert (line 33) | def insert(self,idx,item):
    method remove (line 37) | def remove(self, item):
    method count (line 41) | def count(self, item):
    method extend (line 49) | def extend(self, list_2):
    method extendleft (line 54) | def extendleft(self, list_2):
    method rotate (line 59) | def rotate(self,idx):
    method clear (line 63) | def clear(self):
    method copy (line 67) | def copy(self):
    method __str__ (line 71) | def __str__(self):
    method __iter__ (line 75) | def __iter__(self):

FILE: Data-Structures/Queue/Deque/Deque.ts
  class DequeNode (line 2) | class DequeNode {
    method constructor (line 9) | constructor(data: any) {
  class Deque (line 17) | class Deque {
    method constructor (line 22) | constructor() {
    method print (line 28) | print() {
    method peekFront (line 39) | peekFront() {
    method appendFront (line 46) | appendFront(data: any) {
    method removeFront (line 59) | removeFront() {
    method peekBack (line 74) | peekBack() {
    method appendBack (line 80) | appendBack(data: any) {
    method removeBack (line 93) | removeBack() {

FILE: Data-Structures/Queue/Priority-Queue/Priority-Queue.cpp
  type node (line 5) | struct node
    type node (line 9) | struct node
  class Priority_Queue (line 12) | class Priority_Queue
    method Priority_Queue (line 17) | Priority_Queue()
    method insert (line 22) | void insert(int item, int priority)
    method del (line 44) | void del()
    method display (line 59) | void display()
  function main (line 78) | int main()

FILE: Data-Structures/Queue/Priority-Queue/PriorityQueue.php
  class priorityQueue (line 5) | class priorityQueue extends SplPriorityQueue {
    method compare (line 9) | public function compare($p1, $p2) {

FILE: Data-Structures/Queue/Priority-Queue/priorityQueue.js
  class PriorityQueue (line 1) | class PriorityQueue {
    method constructor (line 2) | constructor() {
    method enqueue (line 7) | enqueue(element, priority) {
    method dequeue (line 26) | dequeue() {
    method peek (line 31) | peek() {
    method isEmpty (line 36) | isEmpty() {
    method size (line 41) | size() {
    method print (line 46) | print() {

FILE: Data-Structures/Queue/QueueUsingArray.c
  function main (line 9) | void main()
  function enqueue (line 23) | void enqueue(int Queue[],int temp)
  function dequeue (line 41) | void dequeue(int Queue[])
  function display_Queue (line 57) | void display_Queue(int Queue[])

FILE: Data-Structures/Queue/QueueUsingArray.cpp
  type node (line 3) | struct node {
    type node (line 5) | struct node
  type node (line 7) | struct node
    type node (line 5) | struct node
  type node (line 8) | struct node
    type node (line 5) | struct node
  type node (line 9) | struct node
    type node (line 5) | struct node
  function Insert (line 10) | void Insert() {
  function Delete (line 27) | void Delete() {
  function Display (line 46) | void Display() {
  function main (line 59) | int main() {

FILE: Data-Structures/Queue/QueueUsingArray.go
  function enqueue (line 9) | func enqueue(queue []int, ele int) []int {
  function dequeue (line 14) | func dequeue() int {
  function main (line 22) | func main() {

FILE: Data-Structures/Queue/QueueUsingArray.java
  class QueueUsingArray (line 2) | public class QueueUsingArray {
    method main (line 3) | public static void main(String[] args) {
  class Queue (line 21) | class Queue{
    method Queue (line 24) | Queue(int c){
    method queueEnque (line 30) | static void queueEnque(int data){
    method queueDeque (line 42) | static void queueDeque(){
    method queueDisplay (line 57) | static void queueDisplay(){
    method queuefront (line 68) | static void queuefront(){

FILE: Data-Structures/Queue/QueueUsingArray.js
  class Queue (line 1) | class Queue {
    method constructor (line 3) | constructor(initial=[]) {
    method put (line 9) | put(element) {
    method get (line 13) | get() {
    method print (line 17) | print() {

FILE: Data-Structures/Queue/QueueUsingArray.py
  class FifoList (line 1) | class FifoList:
    method __init__ (line 2) | def __init__(self):
    method append (line 6) | def append(self, data):
    method pop (line 9) | def pop(self):
    method display (line 14) | def display(self):

FILE: Data-Structures/Queue/QueueUsingArray.rb
  class Queue (line 1) | class Queue
    method initialize (line 6) | def initialize(items = [])
    method enqueue (line 14) | def enqueue(element)
    method dequeue (line 26) | def dequeue
    method front (line 40) | def front
    method back (line 44) | def back
    method empty? (line 48) | def empty?
    method clear (line 52) | def clear
    method each (line 58) | def each

FILE: Data-Structures/Queue/QueueUsingLL.c
  type qlist (line 3) | struct qlist
  type qlist (line 7) | struct qlist
  type qlist (line 8) | struct qlist
  type qlist (line 8) | struct qlist
  type qlist (
Condensed preview — 1380 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (2,228K chars).
[
  {
    "path": ".github/ISSUE_TEMPLATE/Documentation.yml",
    "chars": 1350,
    "preview": "name: Documentation\ndescription: Select this to document the repo\ntitle: \"Directory You Purpose to Document\"\nlabels: [\"H"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/New-Submission.yml",
    "chars": 1560,
    "preview": "name: New Submission\ndescription: Select this to submit new Algorithm/Data-Structure/STL/...\ntitle: \"Title of the Submis"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/config.yml",
    "chars": 27,
    "preview": "blank_issues_enabled: false"
  },
  {
    "path": ".github/pull_request_template.md",
    "chars": 549,
    "preview": "## Assigned Issue Number ?\n#Issue_Number\n\n## Location of the file(s) ?\nFolder => Sub-Folder => ... => File.extension\n\n##"
  },
  {
    "path": ".github/workflows/contributors.yml",
    "chars": 540,
    "preview": "name: Add contributors\non:\n  schedule:\n    - cron: '0 0 * * *'\n\njobs:\n  add-contributors:\n    runs-on: ubuntu-latest\n   "
  },
  {
    "path": ".github/workflows/welcome.yml",
    "chars": 794,
    "preview": "name: Welcome\non:\n  pull_request:\n    types: [opened, closed]\n  issues:\n    types: [opened]\njobs:\n  run:\n    runs-on: ub"
  },
  {
    "path": "404.md",
    "chars": 184,
    "preview": "---\ntitle: 404!\npermalink: /404.html\n---\n<center>\n<img src='https://user-images.githubusercontent.com/54521023/105541932"
  },
  {
    "path": "Algorithms/Array/Arr4 right shift.c",
    "chars": 815,
    "preview": "\r\n\r\n#include<stdio.h>\r\n\r\n#define MAX 5 \r\n\r\nvoid AcceptArray(int *Arr1 , int n)\r\n{\r\n\tint cnt ;\r\n\tint x ;\r\n\tint *ptr = Arr"
  },
  {
    "path": "Algorithms/Array/InsertArray.c",
    "chars": 804,
    "preview": "#include <stdio.h>\n#define max 10\n\nint main()\n{\n    int array[max], pos, i, n, value;\n    printf(\"Enter number of elemen"
  },
  {
    "path": "Algorithms/Array/LinearSearch.java",
    "chars": 1246,
    "preview": "\npublic class Main {\n{\n   public static void main(String[] args)\n   {\n      // Validate command line arguments count.\n\n "
  },
  {
    "path": "Algorithms/Array/Merge-Sorted-Array.c",
    "chars": 1343,
    "preview": "#include<stdio.h>\n#include<stdlib.h>\nint cmpfunc (const void * a, const void * b) {\n   return ( *(int*)a - *(int*)b );\n}"
  },
  {
    "path": "Algorithms/Array/Merge-Sorted-Array.cpp",
    "chars": 672,
    "preview": "#include<bits/stdc++.h> \r\nusing namespace std; \r\n#define n 4 \r\n\r\n\r\nvoid printArray(int arr[], int size) \r\n{ \r\nfor (int i"
  },
  {
    "path": "Algorithms/Array/Merge-Sorted-Array.js",
    "chars": 980,
    "preview": "// Merge_sorted_array\n\nfunction mergeSorted(a, b) {\n    var answer = new Array(a.length + b.length), i = 0, j = 0, k = 0"
  },
  {
    "path": "Algorithms/Array/Merge-Sorted-Array.py",
    "chars": 301,
    "preview": "\nfrom heapq import merge \ndef mergeK(arr, k):     \n    l = arr[0] \n    for i in range(k-1): \n        l = list(merge(l, a"
  },
  {
    "path": "Algorithms/Array/Merge_Sorted_Arrays.rb",
    "chars": 860,
    "preview": "def merge_sorted_arrays(arrays)\n    return [] if arrays.length == 0\n    return arrays[0] if arrays.length == 1\n  \n    # "
  },
  {
    "path": "Algorithms/Array/Rearrange-High-Low.js",
    "chars": 958,
    "preview": "function swap(arr, i, j)\n{\n    var temp = arr[i];\n    arr[i] = arr[j];\n    arr[j] = temp;\n}\n \n// Function to rearrange t"
  },
  {
    "path": "Algorithms/Array/Rearrange-High-Low.kt",
    "chars": 594,
    "preview": "// main function\nfun main(args: Array<String>) {\n  \n  // pre defined array\n    val arr=arrayOf(3, 6, 5, 10, 7, 20)\n    \n"
  },
  {
    "path": "Algorithms/Array/Remove-Dublicate.js",
    "chars": 213,
    "preview": "// RemoveDuplicateItem\n\nfunction RemoveDuplicateItem(arr) {\n    let newAr = [];\n\n\n    arr.forEach((item) => {\n        if"
  },
  {
    "path": "Algorithms/Array/Remove-Duplicates-from-Sorted-Array.c",
    "chars": 1197,
    "preview": "\n/*\nGiven a sorted array nums, remove the duplicates in-place such that each element appears only once and returns the n"
  },
  {
    "path": "Algorithms/Array/Remove-Duplicates-from-Sorted-Array.cpp",
    "chars": 793,
    "preview": "/*\nGiven a sorted array nums, remove the duplicates in-place such that each element appears only once and returns the ne"
  },
  {
    "path": "Algorithms/Array/Shuffle.c",
    "chars": 1042,
    "preview": "/*\nYou are given an array consisting of n integers a1, a2, ..., an. Initially ax=1, all other elements are equal to 0.\nY"
  },
  {
    "path": "Algorithms/Array/Two-Arrays-And-Swaps.c",
    "chars": 1319,
    "preview": "/*\nYou are given two arrays a and b both consisting of n positive (greater than zero) integers. You are also given an in"
  },
  {
    "path": "Algorithms/Array/check_two_equal_array.cpp",
    "chars": 533,
    "preview": "#include <bits/stdc++.h>\nusing namespace std;\n#define  LL long long\n#define F first\n#define S second\n#define fast_io ios"
  },
  {
    "path": "Algorithms/Array/copyarray.c",
    "chars": 603,
    "preview": "#include<stdio.h>\r\nint main()\r\n{\r\n    int arr1[40],n,i,arr2[40];\r\n\r\n    printf(\"How many number :\");\r\n    scanf(\"%d\",&n)"
  },
  {
    "path": "Algorithms/Array/counting_frequency_of_char_in_string.c",
    "chars": 384,
    "preview": "#include <stdio.h>\nint main() {\n    char str[1000], ch;\n    int i,count = 0;\n    printf(\"Enter a string: \");\n    fgets(s"
  },
  {
    "path": "Algorithms/Array/findpos.py",
    "chars": 491,
    "preview": "def findposition(arr, x) :\n    flag = True\n    for i in range(0, len(arr)) :\n        if (x != arr[i]) :\n            cont"
  },
  {
    "path": "Algorithms/Array/high-low-rearrangement.c",
    "chars": 798,
    "preview": "#include <stdio.h>\n//swap of elements\nvoid swap(int arr[], int i, int j)\n{\n    int temp = arr[i];\n    arr[i] = arr[j];\n "
  },
  {
    "path": "Algorithms/Array/high-low-rearrangement.c++",
    "chars": 808,
    "preview": "#include <bits/stdc++.h>\nusing namespace std;\n//swap of elements\nvoid swap(int arr[], int i, int j)\n{\n    int temp = arr"
  },
  {
    "path": "Algorithms/Array/high-low-rearrangement.py",
    "chars": 491,
    "preview": "# Swap functions\ndef swap(A, i, j):\n    temp = A[i]\n    A[i] = A[j]\n    A[j] = temp \n# reaggrange array\ndef rearrangeArr"
  },
  {
    "path": "Algorithms/Array/largest-smallest-number-and-sum-of-all-elements-in-array.java",
    "chars": 843,
    "preview": "import java.io.*;\nclass t17question7\n{\n    public static void main(String args[])throws IOException\n    {\n        InputS"
  },
  {
    "path": "Algorithms/Array/merge-sorted-arrays-algo-only.py",
    "chars": 968,
    "preview": "# O(nk) time | O(n+k) space - where n is the total number of array elements and k is the nunber of arrays\n\ndef mergeSort"
  },
  {
    "path": "Algorithms/Array/merge_without_extraspace.cpp",
    "chars": 1854,
    "preview": "#include <bits/stdc++.h>\nusing namespace std;\n\n/*\n    Author : codewithmini\n*/\n\n/* Problem Statement\nWe are given two so"
  },
  {
    "path": "Algorithms/Array/merging_2_arrays.c",
    "chars": 964,
    "preview": "#include<stdio.h>\nint main()\n{\n \tint n1, n2, n3, i, j;\n \tprintf(\"\\n Enter the number of elements for  First Array  :  \")"
  },
  {
    "path": "Algorithms/Array/rearrange-high-low.java",
    "chars": 971,
    "preview": "import java.util.Scanner;\nclass Main\n{\n    // swap\n    private static void swap(int[] A, int i, int j)\n    {\n        int"
  },
  {
    "path": "Algorithms/Array/revering_array.c",
    "chars": 683,
    "preview": "#include<stdio.h>\n#include<stdlib.h>\nstruct Array\n{\nint A[10];\nint size;\nint length;\n};\nvoid Display(struct Array arr)\n{"
  },
  {
    "path": "Algorithms/Array/rotate_matrix_90degree.cpp",
    "chars": 3035,
    "preview": "#include <bits/stdc++.h>\nusing namespace std;\n\n/*\n    Author : codewithrathi\n*/\n\n/*\nProblem Statement :\nRotate a matrix "
  },
  {
    "path": "Algorithms/Array/rotated_sorted_array_search.cpp",
    "chars": 901,
    "preview": "#include<bits/stdc++.h> \nusing namespace std;\n\nint rotatedSearch(vector<int> &A, int B) {\n\n    //low and high are the in"
  },
  {
    "path": "Algorithms/Array/twoSum.cpp",
    "chars": 2696,
    "preview": "#include<bits/stdc++.h>\nusing namespace std;\n\n/*Naive Approach: Check for all pairs if they adds up to the target or not"
  },
  {
    "path": "Algorithms/Array/twoSum.kt",
    "chars": 2482,
    "preview": "import java.util.*\n\n/*Naive Approach: Check for all pairs if they adds up to the target or not\nTC: O(n*n) SC: O(1)\n*/\nfu"
  },
  {
    "path": "Algorithms/Array/wave_form_array",
    "chars": 884,
    "preview": "//Print a 2d array in wave form i.e. \\/\\/\\/\\/\n#include <iostream>\nusing namespace std;\nint main()\n{\n    int a[1000][1000"
  },
  {
    "path": "Algorithms/Backtracking/Crossword/Crossword.cpp",
    "chars": 3506,
    "preview": "/*\n  Problem description:\n  A 10 x 10 Crossword grid is provided,along with \n  a set of words (or names of places) which"
  },
  {
    "path": "Algorithms/Backtracking/Nqueen/N_Queen.java",
    "chars": 1126,
    "preview": "import java.util.*;\r\npublic class N_Queen {\r\n\tfinal int N=4;\r\n\tpublic boolean solveNQUtil(int board[][],int col) {\r\n\t\tif"
  },
  {
    "path": "Algorithms/Backtracking/Nqueen/Nqueens.c",
    "chars": 1102,
    "preview": "#include<stdio.h>\n#include<math.h>\n \nchar a[10][10];\nint n;\n \nvoid printmatrix() {\n   int i, j;\n   printf(\"\\n\");\n \n   fo"
  },
  {
    "path": "Algorithms/Backtracking/Nqueen/Nqueens.cpp",
    "chars": 1421,
    "preview": "#include<bits/stdc++.h>\n#define ll long long\n#define mod 1000000007;\nusing namespace std;\nbool isvalid(int board[][10],i"
  },
  {
    "path": "Algorithms/Backtracking/Nqueen/Nqueens_optimized.cpp",
    "chars": 678,
    "preview": "#include<bits/stdc++.h>\n#define ll long long\n#define mod 1000000007;\nusing namespace std;\nint c=0;\nint column[100]={0},d"
  },
  {
    "path": "Algorithms/Backtracking/Nqueen/nqueen.cpp",
    "chars": 1616,
    "preview": "//N-queen program using Backtracking in C++ by Apurva\n#include<iostream>\nusing namespace std;\nint grid[10][10];\n//print "
  },
  {
    "path": "Algorithms/Backtracking/Nqueen/nqueens.py",
    "chars": 1139,
    "preview": "global N \nN = 4\n\ndef printSolution(board): \n\tfor i in range(N): \n\t\tfor j in range(N): \n\t\t\tprint(board[i][j],end=\",\")\n\t\tp"
  },
  {
    "path": "Algorithms/Backtracking/Permutation/Permutations.c",
    "chars": 660,
    "preview": "#include<stdio.h>\r\n#include<stdlib.h>\r\n#include<conio.h>\r\n\r\nvoid swap(int *ar, int i, int j)\r\n{\r\n  int temp = ar[i];\r\n  "
  },
  {
    "path": "Algorithms/Backtracking/Permutation/permutation.py",
    "chars": 316,
    "preview": "def permutation(arr):\n    if(len(arr) == 1):\n        return [arr]\n    \n    result = []\n\n    for i in arr:\n        #Array"
  },
  {
    "path": "Algorithms/Backtracking/Permutation/permutations.cpp",
    "chars": 1069,
    "preview": "#include<iostream>\nusing namespace std;\nvoid solve(vector<int>& nums, vector<int>& curr, vector<vector<int>> &res, int i"
  },
  {
    "path": "Algorithms/Backtracking/Permutation/permutations.js",
    "chars": 747,
    "preview": "//Heap's Algorithm\n\n//Print Function\nfunction print(list,length){\n  empty_list = []\n  for(var i=0;i<length;i++){\n    emp"
  },
  {
    "path": "Algorithms/Backtracking/README.md",
    "chars": 24,
    "preview": "# This folder is empty.\n"
  },
  {
    "path": "Algorithms/Backtracking/Rat-In-A-Maze/Rat-In-A-Maze.cpp",
    "chars": 2465,
    "preview": "//https://practice.geeksforgeeks.org/problems/rat-in-a-maze-problem/1 - Link to problem statement\r\n\r\n#include <bits/stdc"
  },
  {
    "path": "Algorithms/Cryptography/AES_Cipher/AES_Cipher.py",
    "chars": 2390,
    "preview": "import sys, base64, json, math\ntry:\n   from Crypto.Cipher import AES\nexcept ImportError:\n   print (\"Error!! Module AES i"
  },
  {
    "path": "Algorithms/Cryptography/AES_Cipher/README.md",
    "chars": 181,
    "preview": "## AES\nThe Advanced Encryption Standard (AES), also known by its original name Rijndael is a specification for the encry"
  },
  {
    "path": "Algorithms/Cryptography/Affine_Cipher/Affine_Cipher.cpp",
    "chars": 3786,
    "preview": "// In the affine cipher the letters of an alphabet of size m are first mapped to the integers in the range 0 … m − 1. \n/"
  },
  {
    "path": "Algorithms/Cryptography/Affine_Cipher/Affine_Cipher.py",
    "chars": 3149,
    "preview": "'''\nIn the affine cipher the letters of an alphabet of size m are first mapped to the integers in the range 0 … m − 1. \n"
  },
  {
    "path": "Algorithms/Cryptography/Affine_Cipher/README.md",
    "chars": 25,
    "preview": "## This folder is empty.\n"
  },
  {
    "path": "Algorithms/Cryptography/Affine_Cipher/affine_cipher.c",
    "chars": 1678,
    "preview": "#include<stdio.h>\r\n#include<stdlib.h>\r\n#include<string.h>\r\n#include<ctype.h>\r\n#include<stdlib.h>\r\n#define MAX 100000\r\n\r\n"
  },
  {
    "path": "Algorithms/Cryptography/Bifid_Cipher/Bifid_Cipher.py",
    "chars": 4283,
    "preview": " \n\"\"\"\n@author: Abhinav Tiwari\n\n@github: abhinav-idle\n\"\"\"\n\n\"\"\"\nBifid Cipher was invented in 1901 by Felix Delastelle.\n\nBi"
  },
  {
    "path": "Algorithms/Cryptography/Bifid_Cipher/README.md",
    "chars": 25,
    "preview": "## This folder is empty.\n"
  },
  {
    "path": "Algorithms/Cryptography/CIA_Triad_Ciper/README.md",
    "chars": 25,
    "preview": "## This folder is empty.\n"
  },
  {
    "path": "Algorithms/Cryptography/Caesar_Cipher/Caesar Cypher.cpp",
    "chars": 1636,
    "preview": "#include<iostream>\n#include<string.h>\nusing namespace std;\nint main() {\n   cout<<\"Enter the message:\\n\";\n   char msg[100"
  },
  {
    "path": "Algorithms/Cryptography/Caesar_Cipher/Caesar Cypher.py",
    "chars": 542,
    "preview": "def encrypt(text,s):\nresult = \"\"\n   # transverse the plain text\n   for i in range(len(text)):\n      char = text[i]\n     "
  },
  {
    "path": "Algorithms/Cryptography/Caesar_Cipher/CaesarCipher.java",
    "chars": 1523,
    "preview": "import java.util.Scanner;\n\npublic class CaesarCipher {\n    public static final int SHIFT_MAX = 26;\n\n    public static in"
  },
  {
    "path": "Algorithms/Cryptography/Caesar_Cipher/Caesar_Cipher.c",
    "chars": 745,
    "preview": "#include<stdio.h>\n\nint main() {\n    char message[100], ch;\n    int i, key;\n\n    printf(\"Message to encrypt: \");\n    gets"
  },
  {
    "path": "Algorithms/Cryptography/Caesar_Cipher/Caesar_Cipher.cs",
    "chars": 2743,
    "preview": "using System;\n\nclass Program\n{\n    /// <summary>\n    /// Shifts every character of a given string by a specified amount\n"
  },
  {
    "path": "Algorithms/Cryptography/Caesar_Cipher/Caesar_Cipher.js",
    "chars": 603,
    "preview": "var caesarEncypt = function(str, key) {\n\n    if (key < 0) {\n        return caesarEncypt(str, key + 26);\n    }\n\n    var e"
  },
  {
    "path": "Algorithms/Cryptography/Caesar_Cipher/Caesar_Cipher.php",
    "chars": 579,
    "preview": "<?php\nfunction cipher(string $str, int $key)\n{   \n    $k = $key % 26;\n\n    $input = array_map(function($char){\n        r"
  },
  {
    "path": "Algorithms/Cryptography/Caesar_Cipher/Caesar_Cypher.rb",
    "chars": 1105,
    "preview": "class CaesarCipher\n  ORDER_ALPHABET = (\"a\"..\"z\").to_a # Array of valid letter rotation (Only english alphabet letters)\n "
  },
  {
    "path": "Algorithms/Cryptography/Caesar_Cipher/README.md",
    "chars": 25,
    "preview": "## This folder is empty.\n"
  },
  {
    "path": "Algorithms/Cryptography/README.md",
    "chars": 24,
    "preview": "# This folder is empty.\n"
  },
  {
    "path": "Algorithms/Cryptography/RSA_Cipher/README.md",
    "chars": 25,
    "preview": "## This folder is empty.\n"
  },
  {
    "path": "Algorithms/Cryptography/RSA_Cipher/RSA_Cipher.py",
    "chars": 849,
    "preview": "# -*- coding: utf-8 -*-\nimport random\nfrom math import gcd\n\nplaintext = (input('Enter the value of text = '))\n\npt = \"\"\ni"
  },
  {
    "path": "Algorithms/Cryptography/RSA_Cipher/RSA_cipher.cpp",
    "chars": 2921,
    "preview": "#include <iostream>\n#include <ctime>\n#include <cstdlib>\n#include <cstring>\n#include <cstdio>\n#include <iomanip>\nusing na"
  },
  {
    "path": "Algorithms/Cryptography/RSA_Cipher/RSA_cipher.java",
    "chars": 3236,
    "preview": "/*\r\n * RSA algorithm is asymmetric cryptography algorithm. \r\n * Asymmetric actually means that it works on two different"
  },
  {
    "path": "Algorithms/Cryptography/Shamir_Cipher/Shamir_Cipher.c",
    "chars": 4865,
    "preview": "#include <stdlib.h>\n#include <stdio.h>\n#include <time.h>\n#include <string.h>\n#include <math.h>\n#include <unistd.h>\n\ncons"
  },
  {
    "path": "Algorithms/Cryptography/Shamir_Cipher/Shamir_Cipher.cpp",
    "chars": 2240,
    "preview": "#include <bits/stdc++.h>\nusing namespace std;\n\nint calculate_Y(int x, vector<int> &poly)\n{\n    int y = 0;\n    int temp ="
  },
  {
    "path": "Algorithms/Cryptography/Vernam_Cipher/README.md",
    "chars": 25,
    "preview": "## This folder is empty.\n"
  },
  {
    "path": "Algorithms/Cryptography/Vernam_Cipher/Vernam_Cipher.cpp",
    "chars": 2819,
    "preview": "#include <cstring>\n#include <random>\n\n/**\n * Encrypts/decrypts data using vernam cipher\n * @param[in/out] data data to w"
  },
  {
    "path": "Algorithms/Cryptography/Vernam_Cipher/Vernam_Cipher.js",
    "chars": 790,
    "preview": "xin = \"Shubham\";\n\ntreshold = 150;\n\nc = {\n\t0: [], // input encoded\n\t1: [], // key encoded\n\t2: [], // cipher encoded\n\t3: ["
  },
  {
    "path": "Algorithms/Cryptography/Vernam_Cipher/Vernam_Cipher.py",
    "chars": 1876,
    "preview": "#!/usr/bin/env python\nimport random\nimport string\nfrom operator import xor\ndef vernam_enc(msg):\n    #Generate Random Key"
  },
  {
    "path": "Algorithms/Cryptography/Vigenere_Cipher/README.md",
    "chars": 25,
    "preview": "## This folder is empty.\n"
  },
  {
    "path": "Algorithms/Cryptography/Vigenere_Cipher/Vigenere_Cipher.cpp",
    "chars": 2977,
    "preview": "#include <algorithm>\n#include <cctype>\n#include <string>\n\n/**\n * Returns the mathematical (unsigned) modulus\n * @param x"
  },
  {
    "path": "Algorithms/Cryptography/Vigenere_Cipher/Vigenere_Cipher.py",
    "chars": 2009,
    "preview": "import sys\n\ndef create_key(msg, key):\n    key = list(key)\n    if len(msg) == len(key):\n        return key\n    elif len(k"
  },
  {
    "path": "Algorithms/Cryptography/Vigenere_Cipher/Vignere_Cipher.cs",
    "chars": 2526,
    "preview": "using System;\nusing System.Linq;\nusing System.Collections.Generic;\n\npublic class Program\n{\n    static List<char> charact"
  },
  {
    "path": "Algorithms/Cryptography/Vigenere_Cipher/vigenereCipher.py",
    "chars": 960,
    "preview": "def vignereCipher(plain_text, key):\n    plain_text_length = len(plain_text)\n    key_length = len(key)\n    j = 0\n    ciph"
  },
  {
    "path": "Algorithms/DP/0-1_Knapsack_Problem/0-1 Knapsack Problem.java",
    "chars": 1563,
    "preview": "/*0-1 Knapsack problem */\r\nimport java.util.*;\r\npublic class Knapsack {\r\n\r\n    //function to return max. of two integers"
  },
  {
    "path": "Algorithms/DP/0-1_Knapsack_Problem/Branch_And_Bound/0-1_knapsack.cpp",
    "chars": 4336,
    "preview": "// C++ program to solve knapsack problem using \n// branch and bound \n#include <bits/stdc++.h> \nusing namespace std; \n  \n"
  },
  {
    "path": "Algorithms/DP/0-1_Knapsack_Problem/knapsackProblem.java",
    "chars": 1518,
    "preview": "/*0-1 Knapsack problem */\nimport java.util.*;\npublic class knapsackProblem {\n\n    //function to return max. of two integ"
  },
  {
    "path": "Algorithms/DP/0-1_Knapsack_Problem/knapsack_problem_0_1.cpp",
    "chars": 919,
    "preview": "#include <iostream>\nusing namespace std;\nint max(int x, int y)\n{\n    return (x > y) ? x : y;\n}\nint knapSack(int W, int w"
  },
  {
    "path": "Algorithms/DP/0-1_Knapsack_Problem/knapsack_problem_0_1.py",
    "chars": 621,
    "preview": "#0/1 Knapsack problem\n\n\ndef knapsack(val, wt, N, C):\n    \n    table = [[ 0 for _ in range(0, C+1)] for _ in range(0, N+1"
  },
  {
    "path": "Algorithms/DP/AdjacentBitCounts.cpp",
    "chars": 2643,
    "preview": "/*\nProblem description:\nFor a string of n bits x1,x2,x3,...,Xn the adjacent bit count of the string (AdjBC(x)) is given "
  },
  {
    "path": "Algorithms/DP/AdjacentBitCounts.js",
    "chars": 845,
    "preview": "const readline = require('readline')\nconst reader = readline.createInterface(process.stdin, process.stdout)\n\nfunction co"
  },
  {
    "path": "Algorithms/DP/Bitmask DP/TravellingSalesman.cpp",
    "chars": 739,
    "preview": "#include <bits/stdc++.h>\n#define int long long int\nusing namespace std;\n\nint dis[21][21];\nint dp[21][(1 << 21)];\n\nint so"
  },
  {
    "path": "Algorithms/DP/Branch_And_Bound/0_1_KnapSack.py",
    "chars": 561,
    "preview": "# a dynamic approach\n# Returns the maximum value that can be stored by the bag\ndef knapSack(W, wt, val, n):\n   K = [[0 f"
  },
  {
    "path": "Algorithms/DP/Branch_And_Bound/Knapsack_Branch_and_Bound.java",
    "chars": 3811,
    "preview": "import java.io.*;\nimport java.util.*;\n\npublic class Knapsack_Branch_and_Bound {\n\t\n\tstatic boolean sol_found = false;\n\tst"
  },
  {
    "path": "Algorithms/DP/Count_Square_Matrices.cpp",
    "chars": 1009,
    "preview": "#include <bits/stdc++.h>\r\nusing namespace std;\r\n\r\nint main()\r\n{\r\n\t//input n: rows and m: columns\r\n\tint n, m;\r\n\tcin >> n "
  },
  {
    "path": "Algorithms/DP/Count_Square_Matrices.py",
    "chars": 801,
    "preview": "def countSquareMatrices(a, N, M):\n\n    count = 0\n\n    for i in range(1, N):\n        for j in range(1, M):\n            if"
  },
  {
    "path": "Algorithms/DP/Edit_Distance/Edit_Distance.js",
    "chars": 713,
    "preview": "var string1 = prompt(\"Enter String 1 -> \");\r\nvar string2 = prompt(\"Enter String 2 -> \");\r\nvar length1 = string1.length,l"
  },
  {
    "path": "Algorithms/DP/Edit_Distance/Edit_distance.cpp",
    "chars": 1001,
    "preview": "/*\nauthor-yogesh kansal\nproblem :- The edit distance between two strings is the minimum number of operations (insertions"
  },
  {
    "path": "Algorithms/DP/Edit_Distance/README.md",
    "chars": 25,
    "preview": "## This folder is empty.\n"
  },
  {
    "path": "Algorithms/DP/Edit_Distance/edit_distance.py",
    "chars": 1487,
    "preview": "\"\"\"\nauthor- Ose Oaiya (esoiya)\nproblem :- The edit distance between two strings is the minimum number of operations (ins"
  },
  {
    "path": "Algorithms/DP/Egg_Drop/Egg_Drop.cpp",
    "chars": 2276,
    "preview": "#include <bits/stdc++.h> \nusing namespace std;\n// Function for returning maximum of 2 numbers\nint max(int a, int b) \n{ \n"
  },
  {
    "path": "Algorithms/DP/Egg_Drop/Egg_Drop.cs",
    "chars": 2095,
    "preview": "using System;\n\nnamespace ConsoleApp1\n{\n    static class Program\n    {\n        private static void Main(string[] args)\n "
  },
  {
    "path": "Algorithms/DP/Egg_Drop/egg drop.java",
    "chars": 1417,
    "preview": "public class EggDroppDP {\n\n    public int getDrops(int eggs, int floors){\n\n        int [][] eggDrops = new int [eggs+1]["
  },
  {
    "path": "Algorithms/DP/Egg_Drop/egg_drop.py",
    "chars": 501,
    "preview": "INT_MAX=32767\n\ndef egg_drop(n,k):\n    m=[[0 for x in range(k+1)]for x in range(n+1)]\n    for i in range(1,n+1):\n        "
  },
  {
    "path": "Algorithms/DP/Egg_Drop/egg_drop.ts",
    "chars": 1203,
    "preview": "const eggDrop = (n: number, k: number) => {\n  let eggFloor: number[][] = [];\n\n  // A 2d array where entry eggFloor[i][j]"
  },
  {
    "path": "Algorithms/DP/Fibonacci_Series/Fibonacci.c",
    "chars": 420,
    "preview": "#include<stdio.h>\nint main()\n{\nint first=0, second=1, i, n, sum=0;\nprintf(\"Enter the number of terms: \");\nscanf(\"%d\",&n)"
  },
  {
    "path": "Algorithms/DP/Fibonacci_Series/Fibonacci.php",
    "chars": 606,
    "preview": "<?php\n/**\n * Iterative solution for Fibonacci Numbers\n * Execute this file whith: php -f Fibonacci.php\n * @author juanma"
  },
  {
    "path": "Algorithms/DP/Fibonacci_Series/fibonacci.go",
    "chars": 288,
    "preview": "package main\n\nimport \"fmt\"\n\nfunc Fibonacci(n uint) uint64 {\n  if n <= 1 {\n    return uint64(n)\n  }\n\n  var n2, n1 uint64 "
  },
  {
    "path": "Algorithms/DP/Fibonacci_Series/fibonacci.js",
    "chars": 309,
    "preview": "/*\nThis function returns the nth fibonacci number, given \n*/\nfunction fibonacci(n, memoizer) {\n    memoizer = memoizer |"
  },
  {
    "path": "Algorithms/DP/Fibonacci_Series/fibonacci.py",
    "chars": 362,
    "preview": "def fibonacci(n): \n\tFibArray = [0, 1] \n\t\n\twhile len(FibArray) < n + 1: \n\t\tFibArray.append(0) \n\t\n\tif n <= 1: \n\t\treturn n "
  },
  {
    "path": "Algorithms/DP/Gauss_Easter_Date/CalculateEasterDate.java",
    "chars": 3065,
    "preview": "import java.util.HashMap;\nimport java.util.Map;\n\n/**\n * @author Alessandro Arosio - 04/10/2020 08:39\n */\n\npublic class C"
  },
  {
    "path": "Algorithms/DP/Gauss_Easter_Date/Gauss_Easter_Date.cpp",
    "chars": 1171,
    "preview": "#include <iostream>\nusing namespace std;\n\nvoid gaussAlgorithm(int year, int *month, int *day);\n\nint main()\n{\n\tint year, "
  },
  {
    "path": "Algorithms/DP/Gauss_Easter_Date/Gauss_Easter_Date.php",
    "chars": 547,
    "preview": "<?php\nfunction Gauss_Easter($year){\n\t$a = fmod($year,19);\n\t$b = fmod($year,4);\n\t$c = fmod($year,7);\n\t$p = floor($year/10"
  },
  {
    "path": "Algorithms/DP/Gauss_Easter_Date/Gauss_Easter_Date.py",
    "chars": 801,
    "preview": "import math\n\ndef Easter(Year):\n    # Gauss Easter Algorithm\n    a = Year % 19\n    b = Year % 4\n    c = Year % 7\n    k = "
  },
  {
    "path": "Algorithms/DP/Gauss_Easter_Date/Gauss_Easter_Date.rb",
    "chars": 893,
    "preview": "def gauss_easter(y)\r\n    a = y % 19\r\n    b = y % 4\r\n    c = y % 7\r\n    \r\n    p = (y / 100).floor\r\n    q = ((13 + 8 * p) "
  },
  {
    "path": "Algorithms/DP/Gauss_Easter_Date/easterDate.cpp",
    "chars": 448,
    "preview": "#include <iostream>\n#include <string>\n\nusing namespace std;\n\nint main()\n{\n  unsigned short year, a, b;\n\n  cout << \"\\nFor"
  },
  {
    "path": "Algorithms/DP/Gauss_Easter_Date/easterDate.go",
    "chars": 365,
    "preview": "package main\n\nimport \"fmt\"\n\nfunc getEasterDate(_year int) {\n\ta := (19 * (_year % 19) + 15) % 30\n\tb := (2 * (_year % 4) +"
  },
  {
    "path": "Algorithms/DP/Gauss_Easter_Date/easterDate.java",
    "chars": 1736,
    "preview": "import java.util.Date;\nimport java.util.Scanner;\n \n// Function calculates and prints\n// easter date for given year Y\n cl"
  },
  {
    "path": "Algorithms/DP/Gauss_Easter_Date/easterDate.js",
    "chars": 465,
    "preview": "const readline = require('readline')\n\nconst rl = readline.createInterface({\n  input: process.stdin,\n  output: process.st"
  },
  {
    "path": "Algorithms/DP/Generate_ATM_Codes.py",
    "chars": 2310,
    "preview": "print('Welcome to Northen Frock Bank ATM')\n\nrestart=('Y')\n\nchances = 3\n\nbalance = 67.14\n\nwhile chances >= 0:\n\n    pin = "
  },
  {
    "path": "Algorithms/DP/Gold_Mine_Problem/goldmine.java",
    "chars": 1873,
    "preview": "// Java program to solve Gold Mine problem \nimport java.util.Arrays; \n\nclass goldmine { \n\t\n\t\n\t\n\t// Returns maximum amoun"
  },
  {
    "path": "Algorithms/DP/Gold_Mine_Problem/goldmine.py",
    "chars": 933,
    "preview": "MAX = 100\n\n\ndef getMaxGold(gold, m, n):\n\n    goldTable = [[0 for i in range(n)]\n                 for j in range(m)]\n\n   "
  },
  {
    "path": "Algorithms/DP/Golomb_Sequence/Golomb Sequence.cpp",
    "chars": 382,
    "preview": "#include <bits/stdc++.h> \nusing namespace std; \n  \nvoid printGolomb(int n) \n{ \n    int dp[n + 1]; \n    dp[1] = 1; \n    c"
  },
  {
    "path": "Algorithms/DP/Golomb_Sequence/Golomb.cpp",
    "chars": 507,
    "preview": "// C++ Program to find first \n// n terms of Golomb sequence. \n#include <bits/stdc++.h> \nusing namespace std; \n\n// Print "
  },
  {
    "path": "Algorithms/DP/Golomb_Sequence/Golomb.java",
    "chars": 530,
    "preview": "import java.util.*; \n  \nclass Golomb  \n{ \n      \n    public static void printGolomb(int n) \n    { \n        int dp[] = ne"
  },
  {
    "path": "Algorithms/DP/Golomb_Sequence/golomb.py",
    "chars": 235,
    "preview": "# Golomb sequence \ndef findGolomb(n): \n\n\tif (n == 1): \n\t\treturn 1\n\n\treturn 1 + findGolomb(n - findGolomb(findGolomb(n - "
  },
  {
    "path": "Algorithms/DP/Knight_Probability/Knight_Probability_in_a_ChessBoard.cpp",
    "chars": 1320,
    "preview": "#include <bits/stdc++.h>\nusing namespace std;\n\ndouble knightProbability(int N, int K, int sr, int sc) \n    {\n        vec"
  },
  {
    "path": "Algorithms/DP/Knight_Probability/Problem_Statement.md",
    "chars": 735,
    "preview": "On an NxN chessboard, a knight starts at the r-th row and c-th column and attempts to make exactly K moves. \nThe rows an"
  },
  {
    "path": "Algorithms/DP/LCS/LCS_of_three_strings.py",
    "chars": 635,
    "preview": "def three_LCS(A,B,C):\n    m=len(A)\n    n=len(B)\n    o=len(C)\n    L=[[[0 for i in range(o+1)]for j in range(n+1)]for k in"
  },
  {
    "path": "Algorithms/DP/LCS/LongestCommonSubsequence.cpp",
    "chars": 781,
    "preview": "#include <bits/stdc++.h>\n\nusing namespace std;\nint LCS(string s1, string s2){//function to get the longest common subseq"
  },
  {
    "path": "Algorithms/DP/LCS/LongestCommonSubsequenceLength.java",
    "chars": 2221,
    "preview": "import java.util.Scanner;\nclass LongestCommonSubsequenceLength{\n  public static void main(String[]args){\n    //initializ"
  },
  {
    "path": "Algorithms/DP/LCS/Longest_Common_Subsequence_of_Three_String.java",
    "chars": 1278,
    "preview": "import java.io.*;\nimport java.util.*;\nclass LCS3Strings { \n    public static int lcsOf3(String X, String Y, String Z, in"
  },
  {
    "path": "Algorithms/DP/LCS/Longest_Common_Subsequence_of_Two_Sequences.c",
    "chars": 1071,
    "preview": "/*\n\tAuthor-yogesh kansal\n\nproblem statement:\n\t\tGiven two sequences ?? = (a1, a2, . . . , am) and ?? = (b1, b2, . . . , b"
  },
  {
    "path": "Algorithms/DP/LCS/Longest_Common_Subsequence_of_Two_Sequences.cpp",
    "chars": 1071,
    "preview": "/*\n\tAuthor-yogesh kansal\n\nproblem statement:\n\t\tGiven two sequences ?? = (a1, a2, . . . , am) and ?? = (b1, b2, . . . , b"
  },
  {
    "path": "Algorithms/DP/LCS/lcs.py",
    "chars": 343,
    "preview": "#Longest Common Subsequence\ntext1=input()\ntext2=input()\nm=len(text1)\nn=len(text2)\ndp=[[0 for j in range(n+1)]for i in ra"
  },
  {
    "path": "Algorithms/DP/LCS/lcs_of_3_strings.cpp",
    "chars": 2151,
    "preview": "#include<bits/stdc++.h> \nusing namespace std;\n \n#define ull unsigned long long\n#define int long long\n#define ld long dou"
  },
  {
    "path": "Algorithms/DP/LIS/LIS.c",
    "chars": 801,
    "preview": "/* Dynamic Programming C implementation of LIS problem */\n#include<stdio.h>  \n\t\n/* lis() returns the length of the longe"
  },
  {
    "path": "Algorithms/DP/LIS/LIS.cpp",
    "chars": 2091,
    "preview": "#include <bits/stdc++.h>\nusing namespace std;\n\n/*\nInput Format: length of the array and contents of the array\nOutput For"
  },
  {
    "path": "Algorithms/DP/LIS/LIS.go",
    "chars": 914,
    "preview": "package main\n\nimport \"fmt\"\n\nfunc binarySearch(array []int, l int, r int, key int) int {\n\tfor r-l > 1 {\n\t\tcenter := l + ("
  },
  {
    "path": "Algorithms/DP/LIS/LIS.java",
    "chars": 1913,
    "preview": "/*\nInput Format: length of the array and contents of the array\nOutput Format: length of LIS and contents of the LIS\nSamp"
  },
  {
    "path": "Algorithms/DP/LIS/LongestIncreaseSubSequence.cpp",
    "chars": 674,
    "preview": "#include <iostream>\nusing namespace std;\n\nint lis(int* input, int n) {\n\tint* output = new int[n];\n\toutput[0] = 1;\n\tfor ("
  },
  {
    "path": "Algorithms/DP/LIS/README.md",
    "chars": 701,
    "preview": "## LIS (Longest Increasing Subsequence)\n\n- [LIS C++](LIS.cpp)\n- [LIS Java](LIS.java)\n- [LIS Python3](lis.py)\n- [LIS Go]("
  },
  {
    "path": "Algorithms/DP/LIS/lis.py",
    "chars": 340,
    "preview": "def lis(arr): \n\tn = len(arr) \n\tlis = [1]*n\n\tfor i in range (1, n): \n\t\tfor j in range(0, i): \n\t\t\tif arr[i] > arr[j] and l"
  },
  {
    "path": "Algorithms/DP/LSCS/LSCS.c",
    "chars": 582,
    "preview": "#include <stdio.h>\n#include <limits.h>\n\nint largest_subarray_sum(int *arr, int size)\n{\n\tif (size <= 0) {\n\t\tprintf(\"Size "
  },
  {
    "path": "Algorithms/DP/LSCS/LSCS.cpp",
    "chars": 713,
    "preview": "using namespace std; \n#include<iostream> \n#include<climits> \n\nint maxSubArraySum(int a[], int size) \n{ \n    int max_so_f"
  },
  {
    "path": "Algorithms/DP/LSCS/lscs.go",
    "chars": 679,
    "preview": "package main\n\nimport \"fmt\"\n\nfunc max(x, y int) int {\n\tif x < y {\n\t\treturn y\n\t}\n\treturn x\n}\n\nfunc sol(s1 string, s2 strin"
  },
  {
    "path": "Algorithms/DP/LSCS/lscs.py",
    "chars": 859,
    "preview": "def find_max_subarray(alist, start, end):\n    max_ending_at_i = max_seen_so_far = alist[start]\n    max_left_at_i = max_l"
  },
  {
    "path": "Algorithms/DP/LSCS/shortest_common_supersequence.c",
    "chars": 712,
    "preview": "#include<stdio.h>\nint max(int a,int b)\n{\n    return a>b?a:b;\n}\nint sol(char* s1,char* s2,int n,int m)\n{\n    int dp[n+1]["
  },
  {
    "path": "Algorithms/DP/Largest Divisible Subset.cpp",
    "chars": 1366,
    "preview": "#include <bits/stdc++.h>\n\nusing namespace std;\n\n/* \nGiven an array of distinct posotive integers,find the largest subset"
  },
  {
    "path": "Algorithms/DP/Largest divisible subset in array/file.py",
    "chars": 1255,
    "preview": "# Python 3 program to find largest divisible subset in a given array \n  \n# Prints largest divisible subset \ndef findLarg"
  },
  {
    "path": "Algorithms/DP/Largest_Divisible_Subset.js",
    "chars": 807,
    "preview": "var largestDivisibleSubset = function(nums) {\n  if(nums.length < 2) return nums;\n  let n = nums.length;\n  nums.sort((a,b"
  },
  {
    "path": "Algorithms/DP/Largest_Divisible_Subsets.java",
    "chars": 1327,
    "preview": "import java.util.*; \n  \npublic class DivSubset { \n  \n    public static int[][] dp; \n  \n    static void findLargest(int[]"
  },
  {
    "path": "Algorithms/DP/Largest_Divisible_Subsets.py",
    "chars": 424,
    "preview": "def largestDivisibleSubset(nums):\n    S = {-1: set()}\n    for x in sorted(nums):\n        S[x] = max((S[d] for d in S if "
  },
  {
    "path": "Algorithms/DP/Largest_Sum_Contiguous_Subarray/.vscode/c_cpp_properties.json",
    "chars": 347,
    "preview": "{\n    \"configurations\": [\n        {\n            \"name\": \"Win32\",\n            \"includePath\": [\n                \"${workspa"
  },
  {
    "path": "Algorithms/DP/Largest_Sum_Contiguous_Subarray/.vscode/launch.json",
    "chars": 1600,
    "preview": "{\n    // Use IntelliSense to learn about possible attributes.\n    // Hover to view descriptions of existing attributes.\n"
  },
  {
    "path": "Algorithms/DP/Largest_Sum_Contiguous_Subarray/.vscode/tasks.json",
    "chars": 674,
    "preview": "{\n    // See https://go.microsoft.com/fwlink/?LinkId=733558\n    // for the documentation about the tasks.json format\n   "
  },
  {
    "path": "Algorithms/DP/Largest_Sum_Contiguous_Subarray/C++_Implementation/makefile",
    "chars": 261,
    "preview": "all: Kadane.o\n\nKadane.o: obj/main.o obj/functions.o\n\tg++ obj/main.o obj/functions.o -o Kadane\n\nobj/main.o: src/main.cpp\n"
  },
  {
    "path": "Algorithms/DP/Largest_Sum_Contiguous_Subarray/C++_Implementation/src/functions.cpp",
    "chars": 358,
    "preview": "#include<iostream>\n#include\"include/functions.h\"\n\nint Kadane(int arr[], int size)\n{\n  int max_so_far=0;\n  int max_ending"
  },
  {
    "path": "Algorithms/DP/Largest_Sum_Contiguous_Subarray/C++_Implementation/src/include/functions.h",
    "chars": 72,
    "preview": "int Kadane(int arr[], int size); \n//return largest sum contigious array\n"
  },
  {
    "path": "Algorithms/DP/Largest_Sum_Contiguous_Subarray/C++_Implementation/src/main.cpp",
    "chars": 402,
    "preview": "#include<iostream>\n#include \"include/functions.h\"\nusing namespace std;\n\nint main()\n{\n  int size;\n  cout<<\"Enter the size"
  },
  {
    "path": "Algorithms/DP/Largest_Sum_Contiguous_Subarray/Kadane's Algorithm.cpp",
    "chars": 535,
    "preview": "#include<iostream>\n#include<vector>\n#include<bits/stdc++.h>\nusing namespace std;\n\nint main() {\n\t//code\n\tint T;\n\tcin>>T;\n"
  },
  {
    "path": "Algorithms/DP/Largest_Sum_Contiguous_Subarray/LSCS.cpp",
    "chars": 328,
    "preview": "#include<iostream>\n\nint Kadane(int arr[], int size)\n{\n  int max_so_far=0;\n  int max_ending_here=0;\n\n  for(int i=0; i<siz"
  },
  {
    "path": "Algorithms/DP/Largest_Sum_Contiguous_Subarray/LSCS.js",
    "chars": 538,
    "preview": "  let allPositives = arr => arr.every(n => n > 0)\n  let allNegatives = arr => arr.every(n => n < 0)\n  let sum = arr => a"
  },
  {
    "path": "Algorithms/DP/Largest_Sum_Contiguous_Subarray/LSCS.swift",
    "chars": 375,
    "preview": "func maxSubArray(_ array: [Int]) -> Int {\n    var currentSum = 0\n    var result = Int.min\n    for i in 0 ..< array.count"
  },
  {
    "path": "Algorithms/DP/Largest_Sum_Contiguous_Subarray/lscs.c",
    "chars": 765,
    "preview": "#include <stdio.h>\n\nint max(int a,int b)\n{\n    if(a>b)\n    {\n        return a;\n    }\n    return b;\n}\n\nint maxSubArray(in"
  },
  {
    "path": "Algorithms/DP/MOS_Algorithm.cpp",
    "chars": 2677,
    "preview": "#include <bits/stdc++.h>\nusing std::vector;\nusing std::tuple;\n\n/*\n * Take out adding\\removing logic into separate class."
  },
  {
    "path": "Algorithms/DP/Max_Product_Subarray/max_product_subarray.py",
    "chars": 421,
    "preview": "def max_product(nums):\n    n = len(nums)\n\n    ans = nums[0]\n    maxy = mini = ans\n    for i in range(1, n):\n\n        if "
  },
  {
    "path": "Algorithms/DP/Maximum_Achievable_Coins/Maximum_Achievable_Coins.php",
    "chars": 726,
    "preview": "<?php\nfunction maxAchieveable($num)\n{\n    $row = range(1, $num);\n    shuffle($row);\n    define(\"ROW\", $row);\n\n    $matri"
  },
  {
    "path": "Algorithms/DP/Maximum_Achievable_Coins/Maximum_Achievable_coins.c",
    "chars": 806,
    "preview": "#include <stdio.h>\n\nvoid swap(int *xp, int *yp) \n{ \n    int temp = *xp; \n    *xp = *yp; \n    *yp = temp; \n} \n  \n// A fun"
  },
  {
    "path": "Algorithms/DP/Maximum_Achievable_Coins/Maximum_Achievable_coins.java",
    "chars": 1474,
    "preview": "\r\nclass MaximumAchievablecoins { \r\n\r\nstatic int Maximum_Achievable_coins( \r\n        int arr[], int n) \r\n    { \r\n      \r\n"
  },
  {
    "path": "Algorithms/DP/Maximum_Achievable_Coins/Maximum_Achievable_coins.py",
    "chars": 830,
    "preview": "def Maximum_Achievable_coins(arr, n):\n    matrix = [[0 for x in range(n)] for y in range(n)]\n\n    for diagonal in range("
  },
  {
    "path": "Algorithms/DP/Maximum_Achievable_Coins/maximum_achievable_coins.cpp",
    "chars": 713,
    "preview": "\n#include <bits/stdc++.h> \nusing namespace std; \n\n\nint optimalStrategyOfGame( \n\tint* arr, int n) \n{ \n\t\n\tint table[n][n];"
  },
  {
    "path": "Algorithms/DP/Minimum_Sum_Descent/min-sum.c",
    "chars": 1875,
    "preview": "/*\n* Contributor: Jean Choi\n* Minimum-Sum Descent\n*\n* Some positive integers are arranged in an equilateral triangle\n* w"
  },
  {
    "path": "Algorithms/DP/Minimum_Sum_Descent/minsum.cs",
    "chars": 1112,
    "preview": "using System;\nusing System.Collections.Generic;\n\n// C# program of min sum path in a triangle\nnamespace Minimum_sum_desce"
  },
  {
    "path": "Algorithms/DP/Minimum_Sum_Descent/minsum.go",
    "chars": 1179,
    "preview": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\t//get number of levels in pyramid\n\tvar levels int\n\tfmt.Println(\"Enter nu"
  },
  {
    "path": "Algorithms/DP/Minimum_Sum_Descent/minsum.ts",
    "chars": 623,
    "preview": "/* Implementation of Dynamic programming\nof Minimum sum descent in TypeScript\n*/\n\nconst minSum = (triangle: number[][]) "
  },
  {
    "path": "Algorithms/DP/Partition_Sum/DP_PartitionSum.java",
    "chars": 1694,
    "preview": "//Code contributed by Aditya Prakash(@PrakashAditya17)\nimport java.io.*;\nimport java.util.*;\npublic class DP_PartitionSu"
  },
  {
    "path": "Algorithms/DP/Partition_Sum/partition_sum.c",
    "chars": 1182,
    "preview": "// A Dynamic Programming based C program to partition problem \n#include <stdio.h> \n\n// Returns true if arr[] can be part"
  },
  {
    "path": "Algorithms/DP/Partition_Sum/partition_sum.cpp",
    "chars": 1200,
    "preview": "// A Dynamic Programming based C++ program to partition problem \n#include <bits/stdc++.h> \nusing namespace std; \n\n// Ret"
  },
  {
    "path": "Algorithms/DP/Partition_Sum/partition_sum.cs",
    "chars": 1811,
    "preview": "// A recursive C# solution for partition problem\nusing System;\n \nclass GFG {\n     \n    // A utility function that return"
  },
  {
    "path": "Algorithms/DP/Partition_Sum/partition_sum.php",
    "chars": 1798,
    "preview": "<?php\ndeclare(strict_types=1);\n\nfunction partitionSum(array $input): array\n{\n    $total = array_sum($input);\n    if ($to"
  },
  {
    "path": "Algorithms/DP/README.md",
    "chars": 24,
    "preview": "# This folder is empty.\n"
  },
  {
    "path": "Algorithms/DP/Recaman's Sequence.c",
    "chars": 704,
    "preview": "#include<graphics.h>\n\nint main()\n{\n\tint i,j,a[101],gd,gm;\n\tfloat s=6.0;\n\tchar text[80];\n\tdetectgraph(&gd,&gm);\n\tinitgrap"
  },
  {
    "path": "Algorithms/DP/Scramble Strings/ScrambleString.cpp",
    "chars": 1221,
    "preview": "\n#include<bits/stdc++.h>\nusing namespace std;\nunordered_map<string,int>mp;\n    bool scramble(string s1,string s2)\n    {\n"
  },
  {
    "path": "Algorithms/DP/Shortest_Common_Supersequence/shortest_common_sequence.java",
    "chars": 1510,
    "preview": "class Solution {\n\n    public String shortestCommonSupersequence(String str1, String str2) {\n        int m = str1.length("
  },
  {
    "path": "Algorithms/DP/Shortest_Common_Supersequence/shortest_common_supersequence.cpp",
    "chars": 995,
    "preview": "#include<bits/stdc++.h> \nusing namespace std;\n\nint max(int a, int b) \n{ \n    return (a > b)? a : b; \n} \n\nint lcs(string "
  },
  {
    "path": "Algorithms/DP/Shortest_Common_Supersequence/shortest_common_supersequence.cs",
    "chars": 1687,
    "preview": "using System; \n\nclass SCS\n{ \n\n\n\tstatic String printShortestSuperSeq(String X, String Y) \n\t{ \n\t\tint m = X.Length; \n\t\tint "
  },
  {
    "path": "Algorithms/DP/Shortest_Common_Supersequence/shortest_common_supersequence.js",
    "chars": 902,
    "preview": "const readline = require('readline')\nconst reader = readline.createInterface(process.stdin, process.stdout); \n\nfunction "
  },
  {
    "path": "Algorithms/DP/Shortest_Common_Supersequence/shortest_common_supersequence.py",
    "chars": 952,
    "preview": "# This algorithm finds the shortest common supersequence of 2 strings - \n# the shortest string that has both str1 and st"
  },
  {
    "path": "Algorithms/DP/Sudoku_Solver/README.md",
    "chars": 25,
    "preview": "## This folder is empty.\n"
  },
  {
    "path": "Algorithms/DP/Sudoku_Solver/SudokuSolver.java",
    "chars": 2421,
    "preview": "import java.util.*;\nimport java.io.*;\nclass SudokuSolver {\n    static class FastReader{\n        BufferedReader br;\n     "
  },
  {
    "path": "Algorithms/DP/Sudoku_Solver/SudokuSolver.py",
    "chars": 1581,
    "preview": "\ndef print_grid(arr): \n\tfor i in range(9): \n\t\tfor j in range(9): \n\t\t\tprint arr[i][j], \n\t\tprint ('n') \n\n\t\t\ndef find_empty"
  },
  {
    "path": "Algorithms/DP/Sudoku_Solver/Sudoku_Solver.cpp",
    "chars": 2874,
    "preview": "#include <bits/stdc++.h> \nusing namespace std; \n  \n#define UNASSIGNED 0 \n  \n\n#define N 9 \n  \n\nbool FindUnassignedLocatio"
  },
  {
    "path": "Algorithms/DP/Sudoku_Solver/Sudoku_Solver.cs",
    "chars": 2209,
    "preview": "using System; \n\nclass GFG { \n\n\tpublic static bool isSafe(int[, ] board, \n\t\t\t\t\t\t\tint row, int col, \n\t\t\t\t\t\t\tint num) \n\t{ \n"
  },
  {
    "path": "Algorithms/DP/Sudoku_Solver/Sudoku_Solver.js",
    "chars": 1335,
    "preview": " // I solved this question with backtracking algorithm:\n\n const _board = [\n    ['.', '9', '.', '.', '4', '2', '1', '3', "
  },
  {
    "path": "Algorithms/DP/Target_Sum/Target_Sum.c",
    "chars": 883,
    "preview": "#include <stdio.h>\n#include <stdlib.h> \n\nint CntSum(int arr[], int N, int required_sum) \n{ \n    int t[N+1][required_sum+"
  },
  {
    "path": "Algorithms/DP/Target_Sum/Target_Sum.cpp",
    "chars": 907,
    "preview": "\n#include <iostream>\nusing namespace std;\n\nint SubsetSum(int arr[],int n, int sum)\n{\n    int t[n+1][sum+1];\n    for(int "
  }
]

// ... and 1180 more files (download for full content)

About this extraction

This page contains the full source code of the ahampriyanshu/algo_ds_101 GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 1380 files (1.9 MB), approximately 574.1k tokens, and a symbol index with 4063 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!