Some of the following statements are True; others, woefully, are False. Your job is to circle T or F as appropriate. You will receive two points for each correct action. For an additional point on false items, briefly explain why the statement is false.
Unless otherwise stated, assume that refers to the number of keys present in the structure.
True-it's the definition direct from the glossary.
True-in fact all the nodes in a search tree contain keys.
False: Every node in a k-ary tree has space reserved for k
children or k child pointers. However, an extended k-ary tree is
created by replacing the empty child pointers in the k-ary tree with
pointers (or references) to another type of node-called an
extender-which is terminal. That is, the leaves of an extended k-ary
tree do not have children.
Often a lightweight pattern is used, wherein the extenders
refer to a singleton nil ( empty) object.
So, extenders either correspond to an empty node, an
existing object; or, a new object, all terminal. The point here is
to make some kind of notation which indicated that the leaf nodes have
a different role than the internal nodes.
True: All nodes in a 5-ary tree have space for exactly 5
children.
True: Storage is given by which is in
False: we don't actually use the word tree without a modifier
in front of it in this class.
However, even if you assumed that we really meant k ary tree, it is still false. Why?
A k-ary tree with all the leaves at the same level will not be complete if the tree is not full as well. A good counter example is a left-complete binary tree where the rightmost leaf is missing (or treated as having a null value in there). It has the same number of internal nodes as the complete tree of the same height (which is full!!), and all leaves at the last (deepest) level, but one fewer leaf node than a complete k-ary tree.
True: Linked list elements need not be sorted, but the location of the
link in the list imposes an ordering on the keys: first, second,
third, etc.
False: A k-ary tree with nodes has exactly
empty child
pointers by the corollary to the full k-ary tree theorem. So, if
, we must have
empty
child pointers present for
nodes. If
is 9, then the number of
empty child pointers is
. Note that it is still false if
the term
full is deleted.
Why? Because full k-ary trees with n nodes are in the set of all
k-ary trees.
False: Because each three dimensional key requires exactly one leaf
node, and it can be shown that the maximum number of gray nodes grows
linearly with the number of keys, giving,
storage for the PR octree in .
False: The keys in a max heap are removed in descending key order,
but need not be maintained that way. The keys in the left and right
children of the root of any subtree cannot be larger than the keys in
the root.
The order of keys in
the array that implements the heap is not sorted
order, either.
True: By construction, the maximum number of levels in a PR octree
is in because the level of the deepest key is labeled
, where
, and the find_key operation must
check at most
levels. We get the
from the change of base formula in Ch2 of Shaffer.
False: The number of levels in a PR quadtree with a grid of
one by one blocks has at most
levels.
False: If the time taken by an algorithm is dominated by the time it
takes to access a node, then the statement is False because it should
say
nodes, not at least and not at most. If
the time taken by the algorithm is not dominated by node access time,
then the computation time (comparisons and arithmetic operations)
determine the run time, and no valid inferences about the number of
nodes can be made.
False: Asymptotic complexity is about bounding the behavior of
whatever term dominates an expression for time or space as the size of
the problem grows. So, there can be all kinds of terms in which do not
grow as quickly as
. That is,
where
, which means that
is in
but
not in
. Thus, equivalently, we might say that the function
is
only trivially in
when there exists a constant
such
that
.
True: A k-d tree of order 6 is a binary tree based on the binary search tree
property cycling through the coordinate positions of a g-dimensional key.
No excuse if you left this blank.