Get the pre-order and in-order of these two trees, and check whether they are equal.
Construct a new Tree with rotating the original tree with Y-axis, and then check whether they are same.
simple BFS the tree, and record the depth.
use APIs
use a string to store the numbers.
check left and right sub-tree with recursion.
BFS the tree
recursion
APIs, to_string, stoi API in C++11
APIs, find_first_not_of
simple iterate the two lists.
APIs, find_last_not_of, find_last_of
sort strs, and choose the smallest one to check longest common prefix.
a step of merge sort
use another stack to store the minimum number
classical problem
use string::reserve, iterator, etc..
classical problem
BFS the tree
high-precision addition
algorithm unique()
iterate the array, and move the numbers to beginning, which is not equal to N.
two potins, keep them N distance, and then iterate the array.
string::reserve
simple simulate the roman number rule.
heap sort, any sort algorithm...
use director vars to simulate.
dichotomy
KMB algorithm
APIs
stack handle parentheses
dynamic programming
simple simulate