Close
Register
Close Window

Show Source |    | About   «  30.21. Graphs   ::   Contents   ::   30.23. Union/FIND  »

30.22. General Trees

30.22.1. General Trees

30.22.1.1. General Trees

30.22.1.2. General Tree ADT

// General tree node ADT
interface GTNode {
  Object value();
  boolean isLeaf();
  GTNode parent();
  GTNode leftmostChild();
  GTNode rightSibling();
  void setValue(Object value);
  void setParent(GTNode par);
  void insertFirst(GTNode n);
  void insertNext(GTNode n);
  void removeFirst();
  void removeNext();
}

// General tree ADT
interface GenTree {
  void clear();      // Clear the tree
  GTNode root();     // Return the root
  // Make the tree have a new root, give first child and sib
  void newroot(Object value, GTNode first, GTNode sib);
  void newleftchild(E value); // Add left child
}

30.22.1.3. General Tree Traversal

Settings

Proficient Saving... Error Saving
Server Error
Resubmit

30.22.1.4. Rep: Lists of Children

The "list of children" implementation for general trees.

30.22.1.5. Rep: Dynamic Node (Array)

A dynamic general tree with fixed-size arrays

30.22.1.6. Rep: Dynamic Node (linked list)

A dynamic general tree with linked lists of child pointers

30.22.1.7. Rep: Lift-Child/Right-Sibling

Converting from a forest of general trees to a binary tree

30.22.1.8. Serialization

Serialization is the process of storing an object as a series of bytes.

A sequential tree serialization typically stores the node values as they would be enumerated by a preorder traversal, along with sufficient information to describe the tree's shape.

30.22.1.9. Binary tree serialization

Settings

Proficient Saving... Error Saving
Server Error
Resubmit

30.22.1.10. Alternate serialization

Settings

Proficient Saving... Error Saving
Server Error
Resubmit

30.22.1.11. Bit Vector Serialization

Settings

Proficient Saving... Error Saving
Server Error
Resubmit

30.22.1.12. General Tree Serialization

Settings

Proficient Saving... Error Saving
Server Error
Resubmit

   «  30.21. Graphs   ::   Contents   ::   30.23. Union/FIND  »

nsf
Close Window