The first time I get to know red black tree is quite a few years ago when I was reading CLRS' famous Introduction to Algorithms. But at that time their explaination of red black tree was very tedious and couter-intuitive. Perhaps that's because the original red black tree is not very neat by itself. But anyway, Sedgewick later discovered the …
Great algorithms are poetry of computation Francis Sullivan
Poetry always give us an enjoyable exprience if not a meaningful enlightenment to the true nature of life. But 10 years ago when I first read about KMP on CLRS' classic Introduction to Algorithms, what I went through was only confusion. Though the code was succinct like a …
I came across a paper called A Few Useful Things to Know about Machine Learning which summarized some black arts in machine learning.
LeetCode 137 is to find the number which apprears exactly once in an array assuming other numbers always appear exactly three times. It's very easy to come up with a linear runtime algorithm by using hash table which takes O(n) space. A better approach is to modulo count the number of occurrences of 1 at every bit and compose …