



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




11/14/2003 1
11/14/2003 2
11/14/2003 3
11/14/2003 4
11/14/2003 7
11/14/2003 8
11/14/2003 9
11/14/2003 10
class BinaryTree { private Node root; // root node private int size; //number of nodes in the tree static class Node { private Node left; // left child private Node right; // right child } public boolean repOk() { //class invariant } }
public static Finitization finBinaryTree(int NUM_Node) { Finitization f = new Finitization(BinaryTree.class); ObjSet nodes = f.createObjects("Node", NUM_Node); // #Node = NUM_Node nodes.add(null); f.set("root", nodes); // root in null + Node f.set("size", NUM_Node); // size = NUM_Node f.set("Node.left", nodes); // Node.left in null + Node f.set("Node.right", nodes); // Node.right in null+ Node return f; }
11/14/2003 19
public static Finitization finBinaryTree(int NUM_Node, int MIN_size, int MAX_size) { Finitization f = new Finitization(BinaryTree.class); ObjSet nodes = f.createObjects("Node", NUM_Node); nodes.add(null); f.set("root", nodes); f.set("size", new IntSet(MIN_size, MAX_size)); f.set("Node.left", nodes); f.set("Node.right", nodes); return f; }
11/14/2003 20
11/14/2003 21
11/14/2003 22
11/14/2003 25
11/14/2003 26
11/14/2003 27
11/14/2003 28
11/14/2003 37
11/14/2003 38
11/14/2003 39
11/14/2003 40
11/14/2003 41