Union Find From wiki: In computer science, a disjoint-set data structure, also called a union–find data structure or merge–find set, is a data structure that keeps track of a set of elements...
A bad system design can lead to much hard work. In order to increase the unit tests coverage, I recently started to work on writing unit tests for some classes. One of the case is I want to test a...
Since we recently start using docker for product release, I'm dealing with a lot of problems related with docker. One of the headache is sometimes, the running application performs different in...
Spend a whole night working on updating Hexo. It is much more complicated than I expected. For anyone's convenience, I record some key points when migrate from Hexo 2.x to 3.0 besides the official...
Single Number XOR features: a ^ b = c a ^ c = b b ^ c = a a ^ 0 = a a ^ a = 0 (a ^ b) ^ c = a ^ (b ^ c) - I: all the numbers appear twice except one XOR all the numbers, and the result is the one -...
Data Structure is a way to organize data. It provides some methods to handle data stream, e.g. insert, delete, etc. Linear Data Structure Queue & Stack Min Stack Use two stacks, one is storing the...
1. Dynamic Programming A method for solving a complex problem by breaking it down into a collection of simpler sub-problems. 1.1 When to use 1. One of the following three: - Maximum/Minimum Problem -...
1. Introduce Dummy Node When the head of the target list we want to return may be different from the original given list, we can use a dummy node linked to the result so that we can get what we want...