An almost complete binary tree is a tree in which each node
that has a right child also has a left child. Having a left
child does not require a node to have a right child. Stated
alternately, an almost complete binary tree is a tree where
for a right child, there is always a left child, but for a
left child there may not be a right child.
The number of nodes in a binary tree can be found using this
formula: n = 2^h Where n is the amount of nodes in the tree,
and h is the height of the tree.
complete binary tree is tree in which all the nodes except
leaf nodes has two childes and all the leaf nodes are at
the same height.atmost complete binary tree is tree in
which all nodes has atmost two childs.
The element being searched for is not found in an array of
100 elements. What is the average number of comparisons
needed in a sequential search to determine that the element
is not there, if the elements are completely unordered?
I am given a sequential algorithm that does a routine search
on an unordered list. N = 20.
The probability that the value x does NOT appear in the list
is exactly 60%, and the probability that x DOES appear is 40%.
The 3 questions that I could not get were:
A) What is the avg number of element comparisons performed
when n = 20 and x does NOT appear in the List.
(my answer was 20, is this correct?)
B) What is the avg number of element comparisons peformed
when n = 20 and x DOES appear in the list?
C) What is the avg number of element comparisons performed
when n = 20. This should be a single number answer they said.