作者:
bombom (蹦蹦)
2011-11-15 23:11:24請問在刪除最後一個slot的時候
要不要對整個slot進行Compact
也就是 insert 0~9
delete 0,3,9
那接下來的slotCnt 應該是 9 還是 7??
會有這樣的疑問是在投影片中對於deleteRecord有這樣敘述
The slot array can be compacted only if the record corresponding to the
last slot is being deleted.
可是sample_output 貌似沒有這樣的機制
(因為在nextRecord的output中還有看到length=-1的情形)
請問一下是要做哪一種@@
作者:
rohan21 (rohan21)
2011-11-15 23:14:00insert 0~9 slotCnt=10... delete 0,3,9之後 slotCnt=9我猜應該是這樣...我的問題倒是0,3這兩個slot的空間要被加回去freeSpace嗎