Posts

About Posts

Posts are more formal than WiKi, in which I will do some research and try to dive deeper. I will also present the references at the end of posts.

All Posts

Most recent posts in chronological order:

The this post, we introduced how to get all prime numbers from 1 to n in o(nloglogn) time. Base on ...
Read More
/ / Algorithm, Math
Prime Numbers in [1, n] The naive method takes O(n^1.5)) time. // O(sqrt(a)) bool IsPrime(a) { if (a < 2) ...
Read More
/ / Algorithm, Math
The Sliding Window technique is usually used to find the shortest or longest qualified subarray. For example, find the shortest ...
Read More
/ / Algorithm, Sliding Window
Summary A spanning tree of some graph G is a subgraph that is a tree which includes all of the ...
Read More
/ / Algorithm, Graph
Summary An Eulerian path is a path in a finite graph that visits every edge exactly once (allowing for revisiting ...
Read More
/ / Algorithm, Graph
Summary No one is supposed to invent the Boyer–Moore voting algorithm during the interview. The point is how to write ...
Read More
/ / Uncategorized
Summary Pimpl is used to hide implementation details for library consumers. It hides headers, data members, as well as private ...
Read More
/ / OOD, Software Engineering
Summary Lowest Common Ancestor (LCA) is a typical rooted tree related problem. A simple solution is use dfs to traverse ...
Read More
/ / Algorithm, Graph
Summary Given a modular MOD, if we want to calculate the division of two integers, we could use the technique ...
Read More
/ / Uncategorized
Summary Quick Select is typical technique to select the top k elements (the rest of array is not sorted) from ...
Read More
/ / Algorithm, Sort