Ngày tải lên :
13/02/2014, 13:20
...
when the keys are inserted one-by-one in the order given into an initially empty tree:
a) 1, 2, 3, 4, 5, 6, 7.
b) 4, 2, 1, 3, 6, 5, 7.
c) 1, 6, 7, 2, 4, 3, 5.
Question 9.
For each of the ... generate a BST from the input list
Pre
Post the BST is built by inserting elements in the list into an initial empty tree
one-by-one from the beginning of the list.
Return the BST
end generateBSTfromList ... (compute(a,n)>compute(a,n-1))?compute(a,n):compute(a,n-1)
32 33
6,5,4
4,5,6
Faculty of Computer Science and Engineering
Department of Computer Science
1/4
DATA STRUCTURES & ALGORITHMS
Tutorial 3 Questions
Recursion...