COMP 2140 Lecture Notes - Lecture 18: Boolean Algebra

4 views5 pages
23 Dec 2018
Course
Professor

Document Summary

** code written for oneclass class twothreetree { class twothreenode { public twothreenode parent; // a pointer to this node"s parent public int numindexvalues; // the number of index values stored in this node. // an interior node has numindexvalues+1 children. public int[] key; // the data value in a leaf, or the index values(s) Twothreenode left, twothreenode right ) { key = new int[2]; key[0] = indexvalue; numindexvalues = 1; child = new twothreenode[3]; child[0] = left; child[1] = right; child[2] = null; parent = p; This is only a node for an intermediate step when inserting into the tree and is quickly replaced accordingly. * parameters: int valleft, valmid, valright (the 3 values inside the node) * twothreenode parent (a reference to the parent of this new node) * purpose: to make a node the child of this at position key and to make this the parent of node(if at all it exists)

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents