Question: 5 . ( 1 0 % ) Given a sequence K = ( k 1 , k 2 , . . . , k 6
Given a sequence
K
k
k
k
of distinct keys in sorted order with probabilities
Some searches may be for values not in
K
and so we also have dummy keys,
d
d
d
with probabilities
Because we have probabilities of searches for each key and each dummy key, we can determine the expected cost a search in a given binary search tree
T
Suppose the expected cost of a search in
T
is
E
search cost in
T
n
i
d
e
p
t
h
T
d
i
q
i
where
d
e
p
t
h
T
denotes a nodes depth in the tree
T
Determine the cost of an optimal binary search tree.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
