In a tree, nodes are arranged in levels that indicate the nodes' hierarchy.
True
False
In a tree, the root is the only node that has no parent.
True
False
The path between a tree's root and any other node is not unique.
True
False
The height of a tree equals the number of nodes along the longest path between the root and a leaf.
True
False
Nodes that are children of the same parent node are called _____.
A) roots
B) ancestors
C) descendants
D) siblings
A node with no children is called a(n) _____.
A) leaf
B) parent
C) both a & b
D) none of the above
A tree in which each node may have at most two children is called a(n) _____ tree.
A) general
B) binary
C) bi-lingual
D) n-ary
The most common implementation of a tree uses a linked structure.
True
False
A node in a binary tree is an object that references a data object and
A) two child nodes in a tree
B) a linked list containing the child nodes
C) a vector containing the list of child nodes
D) none of the above
In a binary tree, if both the left and right child of a node are null
A) the node contains the key-value pair being searched for
B) the node is invalid
C) the node is a leaf
D) the node is the root of the tree
The data in a node's _____ subtree are less than the data in a node's _____ subtree.
A) left, right
B) right, left
C) left, middle
D) middle, right
When adding an entry to a binary search tree, when does the search ends?
A) when the item is found
B) at a leaf if the entry is not already in the tree
C) both a & b
D) none of the above
The smallest entry in a node N's left subtree is
A) the subtree's leftmost node
B) the subtree's rightmost node
C) the left child of N
D) the right child of N
The largest entry in a node N's right subtree is
A) the subtree's leftmost node
B) the subtree's rightmost node
C) the left child of N
D) the right child of N
Every addition to a binary search tree adds a new
A) parent
B) ancenstor
C) root
D) leaf
In the interface SearchTreeInterface, the method getEntry returns an object in the tree that matches the given entry according to the entry's _____ method.
A) compareTo
B) equalTo
C) equals
D) same
In the interface SearchTreeInterface, what does the method remove return if the object being sought doesn't exist?
A) throws an exception
B) 0
C) false
D) null
In the interface SearchTreeInterface, what does the method getEntry return if the object being sought doesn't exist?
A) null
B) false
C) 0
D) throws an exception
You can create different binary search trees from the same data.
True
False
When adding an entry to a binary search tree, the search ends at a leaf if the entry is not already in the tree.
True
False
A heap is a complete binary tree.
True
False
In a maxheap, the object in each node is greater than or equal to the objects in the node's
A) descendants
B) ancestors
C) siblings
D) parents
A complete tree is full to its next-to-last level, and its leaves on the last level are filled in from
A) right to left
B) left to right
C) parent to child
D) bottom to top
It is more efficient to create a heap using
A) the add method
B) the sinkdown method
C) the reheap method
D) none of the above
In the class MaxHeap method removeMax, the heap's root is replaced with its
A) smallest child node
B) largest child node
C) first leaf
D) last leaf
Every node in a balanced binary tree has subtrees whose heights differ by no more than 1.
True
False
A 2-3 tree is completely balanced.
True
False
A node that is the root of a balanced tree is called a _____ node.
A) balanced
B) search
C) master
D) AVL
In a 2-3 tree, a 2-node contains
A) two data items and one child
B) 2 data items and three children
C) one data items and two children
D) 3 data items and two children
In a red-black tree, adding an entry to a red-black tree results in
A) a rotation
B) a node split
C) a new black leaf
D) a new red leaf
{"name":"In a tree, nodes are arranged in levels that indicate the nodes' hierarchy.", "url":"https://www.quiz-maker.com/QPREVIEW","txt":"In a tree, nodes are arranged in levels that indicate the nodes' hierarchy., In a tree, the root is the only node that has no parent., The path between a tree's root and any other node is not unique.","img":"https://www.quiz-maker.com/3012/images/ogquiz.png"}
Powered by: Quiz Maker