/Coding

Recording coding questions, solutions, explanations, testcases and soon

Coding

This Folder includes some programming contest questions. I am trying to summarize the questions, solutions, and my thinking.

From: LeetCode, Codility, HackerRank, LintCode

Languages: C++, Java, Python, C#, Scala

Table of Contents

1. Mathematics

1.1 Discrete Mathematics

1.1.1 Graph Theory

1.1.1.1 Graph Traversal (BFS, DFS)

1.1.1.2 Minimum Spanning Tree (Prim, Kruskal)

1.1.1.3 Shortest Path (Dijkstra, Floyd)

1.1.1.4 Longest Path

1.1.1.5 Transitive Closure

1.1.1.6 Articulation Point - undiGraph

1.1.1.7 Topological Sort-AOV-Network

1.1.1.7.1 Depth First Search (DFS)
1.1.1.7.2 Breadth First Search (BFS)

1.1.1.8 Critical Path-AOV-Netword

1.1.1.9 Euler Path, Hamilton Tour

1.1.1.10 Difference Constraints (Bellman-Ford)

1.1.1.11 Bipartite Matching

1.1.1.12 Network Flow

1.1.2 Combinatorics

1.1.3 Permutation

1.2 Number Theory

1.2.1 Prime

1.2.2 Bit

1.2.3 Greatest Common Divisor (GCD)

1.2.4 Least Common Demominator (LCD)

1.2.5 Modulo

1.2.6 Factorial

1.2.7 Fibonacci

1.2.8 Power

1.2.9 Base

1.2.10 Sqrt

1.2.11 Odd and Even

1.2.12 Max and Min

1.2.12 Median

1.2.13 Sum

1.3 Computational Geometry

1.3.1 Linear Algebra

1.3.1.1 Matrix

1.3.1.2 Linear Equations

1.3.2 Probability Theory

1.3.2.1 Random

1.3.3 Analytic Geometry

1.3.4 Advanced Mathematics

1.3.4.1 Dot Product

1.3.4.2 Cross Product

1.3.4.3 Integral

1.3.4.4 Differential

1.4 Foundation

2. Data Structure

2.1 Linear Structure

2.1.1 Linear List

2.1.2 Stack

2.1.3 Queue

2.1.3.1 Queue

2.1.3.2 Priority Queue

2.1.4 Array

2.1.4.1 Rotation

2.1.4.2 Duplicate

2.1.4.3 Permutations

2.1.4.4

2.1.4.5 SubArray

2.1.4.5.1 Continous
2.1.4.5.2 Uncontinous

2.1.4.6 Move elements

2.1.4.7 Traversal

2.1.4.8 Prefix Sums

2.1.4.9 Count

2.1.4.10 Window Slice

2.1.4.11 Interval

2.1.4.12 Multiple Array

2.1.4.13 Partition

2.1.4.14 Operation

2.1.4.15 Shuffle

2.1.4.16 Two Pointers

2.1.5 String

2.1.5.1 Path

2.1.5.2 Anagrams

2.1.5.3 Duplicate

2.1.5.4 Matching

2.1.5.5 Counting Letters

2.1.5.7 Palindrome

2.1.5.8 Parentheses

2.1.5.9 Reverse

2.1.5.10 SubString

2.1.5.11 IP

2.1.5.12 Operation

2.1.5.13 Conversion

2.1.5.14 Format

2.1.6 General List

2.2 Non-Linear Structure

2.2.1 Tree

2.2.1.1 Binary Tree

2.2.1.2 Binary Search Tree (BST)

2.2.1.3 Balanced Binary Tree

2.2.1.4 Complete Tree

2.2.1.5 Traversal

2.2.1.6 Top to Down

2.2.1.7 Down to Top

2.2.1.8 Normal Tree

2.2.2 Heap

2.2.3 Graph

2.2.3.1 Undirected Graph

2.2.3.2 Directed Graph

2.2.4 Set

2.2.5 Map

2.2.5.1 HashMap

2.2.5.2 TreeMap

2.2.6 Trie

3. Algorithm

3.1 Simulated Algorithm

3.2 Divide and Conquer

3.3 Recursion

3.3.1 Back Tracking

3.4 Greedy Algorithm

3.5 Sort

3.5.1 Insert Sort

3.5.1.1 Directly Insert

3.5.1.2 Binary Insert

3.5.1.3 Shell Sort

3.5.2 Exchange Sort

3.5.3 Select Sort

3.5.4 Merge Sort

3.5.5 Radix Sort

3.5.6 Bucket Sort

3.5.7 Counting Sort

3.5.7 Bubble Sort

3.5.8 Quick Sort

3.6 Search

3.6.1 Binary Search

3.6.2 Tree Search

3.6.2.1 Binary Tree

3.6.2.2 BST

3.6.2.3 Self-balancing BST (AVL BST)

3.6.2.4 Union-Find Set

3.6.2.5 Trie

3.6.3 Enumeration

3.6.4 DFS

3.6.5 BFS

3.6.6 Heuristic Search

3.6.7 Hashing

3.7 Simulation

3.8 Dynamic Programming (DP)

3.8.1 Stock Buy and Sell

3.9 Map Reduce

4. Others

Iterator

Reverse Thinking

Rule From Result

5. Conclude

5.1 Two Pointers

5.1.1 Front Pointers

5.1.1.1 Window

5.2 Kth

5.3.3 Backpack

5.3.3.1 Finite Number

5.3.4 Search Optimum in Window

5.3.5 Game

5.3.6 For Loop