According your code, I re-implement the algorithm with c++.
Because the code of end node equals 0, so, when there is a separate end node, the begin always equals 1(because the code of others word starting at 1, (begin + code) > 1 ), so the base[0 + 1]=-1, it's obviously wrong.
What's wrong?
According your code, I re-implement the algorithm with c++. Because the code of end node equals 0, so, when there is a separate end node, the begin always equals 1(because the code of others word starting at 1, (begin + code) > 1 ), so the base[0 + 1]=-1, it's obviously wrong. What's wrong?