_BinaryTreeNode class documentation

Authors

Generated by rh

Software documentation for the _BinaryTreeNode class

_BinaryTreeNode : NSObject

Declared in:
BinaryTreeNode.h
Binary Tree Node class. This class is private to BinaryTree and should only be used by that class or its subclasses!

Instance Variables

Method summary

treeWithEnumerator: count: 

+ (id) treeWithEnumerator: (NSEnumerator*)e count: (int)n;
convenience method to create a perfectly balanced binary tree from any collection, passing the enumerator of the collection and the count of elements to be put in the tree.

count 

- (unsigned) count;
recursively count the size of the subtree starting at the current node

dealloc 

- (void) dealloc;
return all memory

leftChild 

- (id) leftChild;
return left child

object 

- (id) object;
return object (content)

parentNode 

- (id) parentNode;
return parent node

rightChild 

- (id) rightChild;
return left child

setLeftChild: 

- (id) setLeftChild: (_BinaryTreeNode*)newLeft;
set new left child node

setObject: 

- (id) setObject: (id)newObj;
set new content

setParentNode: 

- (id) setParentNode: (_BinaryTreeNode*)newParent;
set parent node

setRightChild: 

- (id) setRightChild: (_BinaryTreeNode*)newRight;
set new right child node



Instance Variables for _BinaryTreeNode Class

left

@protected _BinaryTreeNode* left;
left child (nil if none)

object

@protected id object;
contained object

parent

@protected _BinaryTreeNode* parent;
parent node (nil if root)

right

@protected _BinaryTreeNode* right;
right child (nil if none)