1.
Code hosted on my github: Https://github.com/DanielJyc/SwordOffer
2.
"Jian refers to offer" This book is very good, moderate difficulty, clear thinking, and talked about the details of the problem, the interview software development should be carefully read.
I decided to rewrite the book by using Java in the original book.
3.
I probably set a requirement for myself to implement it in Java according to the following ideas:
The first step: Use natural language to reflect their own ideas;
The second step, the computer program affinity type pseudo code;
The third step: the implementation of their own ideas with the program.
The first two steps are mostly done on top of the book, and the third step is hosted on GitHub.
4.
Of course, the boundary conditions and special circumstances should also be noted.
A linked list: the first, the tail, or the empty.
String: null, non-conforming requirement.
Divisor: 0.
Number: Negative, 0, positive.
Number: null, only the root node.
5.
The main purpose of writing this code is to: first of all, your own ideas clearer, master more deeply, and then, let yourself use Java more proficient.
Of course, because of the haste, the writing may not be very normative, the efficiency is not very good.
http://danieljyc.github.io/2014/09/04/%E3%80%8A%E5%89%91%E6%8C%87offer%E3%80%8Bjava%E5%AE%9E%E7%8E%B0/
The Java implementation of "sword Point offer"