Skip to content

Garden-of-Avalon/alp-cpp

Repository files navigation

LeetCode-cpp

Personal LeetCode C++ answer repository.

My LeetCode profile:

https://leetcode.com/ysmiles/

If you'd like to discuss, please join QQ group: Libra

Other languages

Priorities rank from high to low.

https://github.com/ysmiles/leetcode-python

https://github.com/ysmiles/leetcode-java

One sentence summary of questions

https://github.com/ysmiles/leetcode-cpp/blob/master/One_sentence_summary.md

Naming rules

number-this_is_title-difficulty (e-easy, m-medium, h-hard)

"NEED O" and "TODO" mean that "need further work/optimization".

TaoLu: general algorithms and frequent question summaries plan

General

Priority queue - 252, 253, 218

Backtracking

- subsets: 78
- permutation
- combination sum: 39, 40, 216
- palindrome partitioning
- regex
- sudoku solver: 37

Sorting

- merge sort
- quick sort
- insertion sort
- selection sort
- counting sort

Bit manipulation

- find the only element which exists once/twice...
- counting 1s
- digital design, counter of 3 - 137

Math related

Dynamic programming - 115, 123, 312, 518

Finite Automata -- good to know -- regular expression implementation - 309

- DFA - Deterministic Finite Automaton
- NFA - Nondeterministic Finite Automaton

String

KMP (Knuth–Morris–Pratt) algorithm - taolu, 214

Manacher’s algorithm - 647, 214

String parsing - 636

Substring at least k repeating chars - 395

Regular expression usage - 468

Parse string to vector of int/string - taolu

Tree

DFS and BFS - taolu

Morris in-order traversal, O(n) time and O(1) space - 99

Trie - 208

Serialize and Deserialize Binary Tree - 297

Print out a tree - taolu

Binary search tree - self-balanced BST -- AVL tree and red-black tree -- not likely to test

Graph

399, 785, 886