



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
A worksheet for Trees in the Algorithms and Data Structures course. It includes exercises related to binary trees, minmax trees, strictly binary trees, ADTs, red-black trees, and B-trees. examples and asks questions to test the student's understanding of the topic.
Typology: Study notes
1 / 5
This page cannot be seen from the preview
Don't miss anything!




Public void Ex11(){ BinaryTree
BinaryTree
t1.attachRightSubtree(t2);
BinaryTree
BinaryTree
If the root is a min node, the value of the tree is equal to the minimum of a. The integer stored in the root b. The value of the left subtree, but only if it is nonempty c. The value of the right subtree, but only if it is nonempty
If the root is a max node, the value of the tree is equal to the maximum of the above three values.
An example of the minmax tree (square node: max node, circle node: min node)
Compute the value of the minmax tree in below tree. Each node is labeled with its initial value. (square: max node, circle: min node)
A binary search tree A 2-3 tree A 2-3-4 tree A red-black tree An AVL tree
And show the underlying tree after each operation.
t.treeInsert(17) t.treeInsert(78) t.treeInsert(20) t.treeInsert(57) t.treeInsert(51) t.treeDelete(17) t.treeInsert(60) t.treeInsert(70)