have been writing business class code, as long as the separation of clarity can be, in fact, very simple. This year wrote a B-tree, B + tree, including now is writing a double index for Big data range query, there are too many details to consider, although theoretically understand, but because there are too many points to pay attention to, light by brain or article narrative, it is difficult to write code in the process of keeping a clear mind, The emergence of chaos often means that the overall look at people dizzy, and then continue to comb, modify, then comb, and then modify.
A experience, after reading the theory, on the paper to draw down all kinds of situations, this may be many in the view of the theory when there is no clear details can be found, and then painted into a tree-like chart, a variety of situations clearly listed. This will take a lot of time to design, but it is much less than the process of writing code to solve the chaotic waste of time!
(Maybe it will be more diligent later, come on!) )
Tips for writing algorithms and data structure programs