zoukankan      html  css  js  c++  java
  • link them together by means of pointers

    Computer Science An Overview _J. Glenn Brookshear _11th Edition

    An alternative to storing a heterogeneous array in a block of contiguous memory cells is to store each component in a separate location and then link them together by means of pointers. More precisely, if the array contains three components, then we find a place in memory to store three pointers, each of which points to one of the components (Figure 8.7b). If these pointers are stored in a block starting at address x, then the first component can be found by following the pointer stored at location x, the second component can be found by following the pointer at location x  1, and so forth.

    This arrangement is especially useful in those cases in which the size of the array’s components is dynamic. For instance, by using the pointer system the size of the first component can be increased merely by finding an area in memory to hold the larger component and then adjusting the appropriate pointer to point to the new location. But if the array were stored in a contiguous block, the entire array would have to be altered.

    Implementing Data Structures  数据结构的实现 

    Storing Arrays Heterogeneous Arrays  异构数组的存储

  • 相关阅读:
    final、static关键字
    this关键字与super关键字区别
    JAVA常见报错
    Java抽象类和多态
    Java 类和接口的继承
    JAVA封装
    库存管理案例
    Map的遍历
    LinkedList vector集合,Set接口
    Collection,迭代器iterator,list接口
  • 原文地址:https://www.cnblogs.com/rsapaper/p/6061426.html
Copyright © 2011-2022 走看看