- Python Data Structures and Algorithms
- Benjamin Baka
- 192字
- 2021-07-09 19:45:10
Pointer structures
Contrary to arrays, pointer structures are lists of items that can be spread out in memory. This is because each item contains one or more links to other items in the structure. What type of links these are dependent on the type of structure we have. If we are dealing with linked lists, then we will have links to the next (and possibly previous) items in the structure. In the case of a tree, we have parent-child links as well as sibling links. In a tile-based game where the game map is built up of hexes, each node will have links to up to six adjacent map cells.
There are several benefits with pointer structures. First of all, they don't require sequential storage space. Second, they can start small and grow arbitrarily as you add more nodes to the structure.
As noted in Chapter 2, Python Data Types and Structures, however, this comes at a cost. If you have a list of integers, each node is going to take up the space of an integer, as well as an additional integer for storing the pointer to the next node.
- R語言經典實例(原書第2版)
- Redis Applied Design Patterns
- UI智能化與前端智能化:工程技術、實現方法與編程思想
- 編譯系統透視:圖解編譯原理
- 可解釋機器學習:模型、方法與實踐
- VMware虛擬化技術
- 零基礎輕松學C++:青少年趣味編程(全彩版)
- Mastering JavaScript
- Flink核心技術:源碼剖析與特性開發
- DevOps 精要:業務視角
- Google Adsense優化實戰
- 虛擬現實建模與編程(SketchUp+OSG開發技術)
- Building Scalable Apps with Redis and Node.js
- HTML5 and CSS3:Building Responsive Websites
- 熱處理常見缺陷分析與解決方案