BinaryTree documentation

Authors

Generated by rh

Contents -

  1. Software documentation for the BinaryTree class
  2. Software documentation for the BinaryTreeBreadthFirstEnumerator class
  3. Software documentation for the BinaryTreeEnumerator class
  4. Software documentation for the BinaryTreeInorderEnumerator class
  5. Software documentation for the BinaryTreePostorderEnumerator class
  6. Software documentation for the BinaryTreePreorderEnumerator class

Software documentation for the BinaryTree class

BinaryTree : SimpleTree

Declared in:
BinaryTree.h
A simple binary tree class

Instance Variables

Method summary

breadthFirstEnumerator 

- (BinaryTreeBreadthFirstEnumerator*) breadthFirstEnumerator;
returns an autoreleased instance of a breadth-first tree enumerator

initWithArray: 

- (id) initWithArray: (NSArray*)array;
Initialises a newly allocated binary tree from an array, creating a perfectly balanced tree.

initWithEnumerator: count: 

- (id) initWithEnumerator: (NSEnumerator*)e count: (int)n;
Initialises a newly allocated binary tree from any collection using an enumerator and a counter of the number of objects to put in the tree. This creates a perfectly balanced tree.

initWithObjects: ,...

- (id) initWithObjects: (id)obj,...;
Initialises a newly allocated binary tree by creating a perfectly balanced tree from the objects in the argument list.

inorderEnumerator 

- (BinaryTreeInorderEnumerator*) inorderEnumerator;
returns an autoreleased instance of an in-order tree enumerator

objectEnumerator 

- (NSEnumerator*) objectEnumerator;
returns an autoreleased instance of the default binary tree object enumerator

postorderEnumerator 

- (BinaryTreePostorderEnumerator*) postorderEnumerator;
returns an autoreleased instance of a post-order tree enumerator

preorderEnumerator 

- (BinaryTreePreorderEnumerator*) preorderEnumerator;
returns an autoreleased instance of a pre-order tree enumerator



Instance Variables for BinaryTree Class

defaultEnumerator

@protected Class defaultEnumerator;
default enumerator class




Software documentation for the BinaryTreeBreadthFirstEnumerator class

BinaryTreeBreadthFirstEnumerator : BinaryTreeEnumerator

Declared in:
BinaryTree.h
A breadth-first binary tree object enumerator
Method summary

advance 

- (id) advance;
breadth-first traversal to next node

init 

- (id) init;
default initialiser

Software documentation for the BinaryTreeEnumerator class

BinaryTreeEnumerator : TreeEnumerator

Declared in:
BinaryTree.h
An abstract object enumerator for the binary tree class

Instance Variables

Method summary

dealloc 

- (void) dealloc;
release references and deallocate memory

setFirstChild: 

- (id) setFirstChild: (id)object;
set the first child for the enumerator

setLastChild: 

- (id) setLastChild: (id)object;
set the last child for the enumerator

setLeftChild: 

- (id) setLeftChild: (id)object;
set the first child for the enumerator

setRightChild: 

- (id) setRightChild: (id)object;
set the first child for the enumerator



Instance Variables for BinaryTreeEnumerator Class

coll

@protected id coll;
stack/queue for tree recursion




Software documentation for the BinaryTreeInorderEnumerator class

BinaryTreeInorderEnumerator : BinaryTreeEnumerator

Declared in:
BinaryTree.h
A in-order binary tree object enumerator
Method summary

advance 

- (id) advance;
in-order traversal to next node

init 

- (id) init;
default initialiser

Software documentation for the BinaryTreePostorderEnumerator class

BinaryTreePostorderEnumerator : BinaryTreeEnumerator

Declared in:
BinaryTree.h
A post-order binary tree object enumerator
Method summary

advance 

- (id) advance;
post-order traversal to next node

init 

- (id) init;
default initialiser

Software documentation for the BinaryTreePreorderEnumerator class

BinaryTreePreorderEnumerator : BinaryTreeEnumerator

Declared in:
BinaryTree.h
A pre-order binary tree object enumerator
Method summary

advance 

- (id) advance;
pre-order traversal to next node

init 

- (id) init;
default initialiser