OBST

4 views
Skip to first unread message

Varun Shinde

unread,
Feb 11, 2010, 2:10:28 PM2/11/10
to VANI_GATE_CS_2010
Hey guys plz help me how to solve binary search tree creation and it's
cost findings..
I m posting a question bout it

Consider the following instance of the Optimal Binary Search Tree
problem being solved by dynamic programming technique:

n=4
(a1,a2,a3,a4)=(do,if,read,while)
p(1:4)=(3,3,1,1)
q(0:4)=(2,3,1,1,1)

Q1. What is the cost of the OBST?
a)34
b)32
c)30
d)40

Q2. The root of the tree is
a)do
b)if
c)read
d)while

is the BST which we draw to solve it ..so that we can get the depth of
the internal and dummy nodes...
so plz show that tree also....does it something like ..the tree which
we draw should be balanced in height......

Reply all
Reply to author
Forward
0 new messages