What is satellite information in data structures?

前端 未结 1 455
旧巷少年郎
旧巷少年郎 2021-02-04 07:02

Taken from Introduction to Algorithms by Thomas Cormen:

\"To keep things simple, we assume, as we have for binary search trees and red-black trees, that any “satelli

相关标签:
1条回答
  • 2021-02-04 07:38

    Satellite data refers to any "payload" data which you want to store in your data structure and which is not part of the structure of the data structure. It can be anything you want. It can be a single value, a large collection of values, or a pointer to some other location that holds the value.

    For example, here's a list node for a singly linked list whose satellite data is a single integer:

    struct node
    {
        node * next;
        int satellite;
    };
    

    In other words, the whole value of any given data structure lies in the data which it contains, which is the satellite data in your book's terminology. The data structure will additionally consume structural data (like the next pointer in the example) to perform the algorithms which define it, but those are essentially "overhead" from the user's perspective.

    For associative containers, the "key" value performs a dual role: On the one hand it is user data, but on the other hand it is also part of the structure of the container. However, a tree can be equipped with additional satellite data, in which case it becomes a "map" from key data to satellite data.

    At one extreme you have a fixed-size array which has no overhead and only payload data, and on the other extreme you have complicated structures like multiindexes, tries, Judy arrays, or lockfree containers which maintain a comparably large amount of structural data.

    0 讨论(0)
提交回复
热议问题