[ class tree: Structures_LinkedList_Single ] [ index: Structures_LinkedList_Single ] [ all elements ]

File: Single.php

Source Location: /Structures_LinkedList-0.2.2/Structures/LinkedList/Single.php


The Structures_LinkedList_Single class represents a linked list structure composed of Structures_LinkedList_SingleNode objects.
The Structures_LinkedList_SingleNode class represents a node in a Structures_LinkedList_Single linked list structure.

Page Details:

Linked list structure

This package implements a singly linked list structure. Each node (Structures_LinkedList_SingleNode object) in the list (Structures_LinkedList_Single) knows the the next node in the list. Unlike an array, you can insert or delete nodes at arbitrary points in the list.

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 implements the Iterator interface so control structures like foreach($list as $node) and while($list->next()) work as expected.

To use this package, derive a child class from Structures_LinkedList_SingleNode and add data to the object. Then use the Structures_LinkedList_Single class to access the nodes.

PHP version 5

LICENSE: Copyright 2006 Dan Scott

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.


require_once('PEAR/Exception.php') [line 58]

Documentation generated on Mon, 11 Mar 2019 15:38:21 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.