» Metadata | » Status |
---|---|
|
|
» Description | |
example.orgThis package implements both a singly-linked list (Structures_LinkedList_Single) and doubly-linked list (Structures_LinkedList_Double) structure. A linked list offers the following advantages over a standard array() structure:
If your application normally traverses the linked list in a forward-only direction, use the singly-linked list implemented by Structures_LinkedList_Single. If, however, your application needs to traverse the list backwards, or insert nodes into the list before other nodes in the list, use the double-linked list implemented by Structures_LinkedList_Double to give your application better performance at the cost of a slightly larger memory footprint. Structures_LinkedList_Single and Structures_LinkedList_Double implement the Iterator interface so control structures like foreach($list as $node) and while($list->next()) work as expected. You can override the key() method to enable your lists to have meaningful $key=>$value relationships in the iterator. To use this package, derive a child class from Structures_LinkedList_DoubleNode or Structures_LinkedList_SingleNode and add data to the object. Then use the corresponding Structures_LinkedList_Double or Structures_LinkedList_Single class to access the nodes. A good linked list implementation is critical for a proper implementation of File_MARC package, so I developed Structures_LinkedList to meet those needs. However, I believe Structures_LinkedList would be a useful addition to PEAR in general. |
|
» Dependencies | » Links |
|
|
» Timeline | » Changelog |
|
|