zoukankan      html  css  js  c++  java
  • 10.3 Implementing pointers and objects and 10.4 Representing rooted trees

    Algorithms 

     

    10.3 Implementing pointers and  objects  and 10.4 Representing rooted trees 

     

    Allocating and freeing objects 

    分配和释放对象

    it is useful to manage the storage of objects not currently used in the linked -list representation so that one can be allocated  . 

    In some systems, a garbage collec- tor is responsible for determining which objects are unused.

    一些系统中,垃圾回收机制负责决定哪个对象没有被用到。

     

    we keep the free objects in a singly linked list ,which we call the free list .

     

    Note that each object in the representation is either in list L or in the  free list ,but not in both .

    The free list initially contains all n unallocated objects . Once the free list has been exhausted ,running the allocate-object procedure signals an error .

     

     

     

     

     

    10.4 Representing rooted trees 

     

    homogeneous  同类的

     we first look at binary trees ,and then we present a method for rooted trees in which nodes can have an arbitrary number of children .

    二分树,根数:有任意数量的孩子

     

    Binary trees 

     

    Rooted trees with unbounded branching 

    1. x.left-child points to the leftmost child of node x , and 

    2. x.right-sibling points to  the sibling of x immediately to its right .

     

  • 相关阅读:
    WPF Layout & Image异步加载
    WPF Binding Validation 数据验证
    推荐一个.NET 命令行参数Parser 库
    Windows 下 命令行增强工具
    Windbg 离线调试.Net 程序入门
    拼写检查算法 Golang 版
    新Blog
    WPF 实现Loading效果
    struct结构体的变长特性
    第2章 构造函数语意学
  • 原文地址:https://www.cnblogs.com/ljlkfx/p/4469231.html
Copyright © 2011-2022 走看看