Authors
- Generated by rh
-
- Declared in:
- BinaryTree.h
A simple binary tree class
Instance Variables
Method summary
- (id)
initWithArray: (NSArray*)array;
Initialises a newly allocated binary tree from an array, creating a perfectly balanced tree.
- (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.
- (id)
initWithObjects: (id)obj
,...;
Initialises a newly allocated binary tree by creating a perfectly balanced tree from the objects in the argument list.
- (NSEnumerator*)
objectEnumerator;
returns an autoreleased instance of the default binary tree object enumerator
Instance Variables for BinaryTree Class
@protected Class defaultEnumerator;
default enumerator class
- Declared in:
- BinaryTree.h
A breadth-first binary tree object enumerator
Method summary
- (id)
advance;
breadth-first traversal to next node
- (id)
init;
default initialiser
- Declared in:
- BinaryTree.h
An abstract object enumerator for the binary tree class
Instance Variables
Method summary
- (void)
dealloc;
release references and deallocate memory
- (id)
setFirstChild: (id)object;
set the first child for the enumerator
- (id)
setLastChild: (id)object;
set the last child for the enumerator
- (id)
setLeftChild: (id)object;
set the first child for the enumerator
- (id)
setRightChild: (id)object;
set the first child for the enumerator
Instance Variables for BinaryTreeEnumerator Class
@protected id coll;
stack/queue for tree recursion
- Declared in:
- BinaryTree.h
A in-order binary tree object enumerator
Method summary
- (id)
advance;
in-order traversal to next node
- (id)
init;
default initialiser
- Declared in:
- BinaryTree.h
A post-order binary tree object enumerator
Method summary
- (id)
advance;
post-order traversal to next node
- (id)
init;
default initialiser
- Declared in:
- BinaryTree.h
A pre-order binary tree object enumerator
Method summary
- (id)
advance;
pre-order traversal to next node
- (id)
init;
default initialiser