use double link list to implenment memory allocation. There won t appear maloc, new, delete, in my code. All is using freelist to find a suitable memory space.
給定n 個整數a ,a , ,an 1 2 組成的序列, a n i | |£ ,1 £ i £ n。如果對于i £ j ,有
0 = å
=
j
k i
k a ,則稱序列區間i i j a , a , , a +1 為一個零和區間,相應的區間長度為j-i+1。