本系列博客習(xí)題來自《算法(第四版)》,算是本人的讀書筆記,如果有人在讀這本書的,歡迎大家多多交流。為了方便討論,本人新建了一個微信群(算法交流),想要加入的,請?zhí)砑游业奈⑿盘枺簔hujinhui207407 謝謝。另外,本人的個人博客 http://www.kyson.cn 也在不停的更新中,歡迎一起討論

算法(第4版)
知識點(diǎn)
- 下壓棧的空間成本
題目
1.4.36 下壓棧的空間成本。解釋下表中的數(shù)據(jù),它顯示了各種下壓棧實(shí)現(xiàn)的一般空間成本,其中鏈表的結(jié)點(diǎn)為一個靜態(tài)的嵌套類,從而避免非靜態(tài)嵌套類的開銷。
1.4.36 Space usage for pushdown stacks. Justify the entries in the table below, which shows typical space usage for various pushdown stack implementations. Use a static nested class for linked-list nodes to avoid the non-static nested class overhead.

分析
明顯可以看出使用基本類型比使用“裝箱”類型占用更少的空間