AMX Linked List Manager
K
A
DAK
141
Figure 12.2-1 illustrates three doubly linked lists of apples and oranges. All apples and
oranges reside on a fruit list. Fresh apples or oranges reside on a fresh list. Rotten apples
or oranges reside on a rotten list.
The list objects are assumed to be data structures describing apples and oranges. Each
object contains two list nodes: one for use with the fresh list or rotten list, the other for
use with the fruit list.
Note that a single list node can be used for the fresh and rotten lists since these lists are
mutually exclusive. All fruit list nodes reside at the same node offset in apple or orange
objects. All fresh and rotten list nodes reside at the same node offset in apple and orange
objects. The Linked List Manager lets you mix objects of different types on the same list
as long as each object has a link node in it at the correct node offset for the particular list.
Fresh
List Header Rotten
List Header
Fruit
List Header
good good good bad bad
bad
Apple Apple AppleOrange Orange Orange
Figure 12.2-1 Doubly Linked Lists