Unformatted text preview: (a) (10 points) Use the in-order traversal and any graphic programming library like FLTK for binary tree drawing. See the textbook, page 301 for the algorithm. (b) (10 points) Implement a balanced binary search tree using one of the balancing technique like AVL, Red-Black or 2-4 tree. Report (30 points) Write a brief report that includes the following: 1. A description of the assignment objective, how to compile and run your programs, and an explanation of your program structure (i.e. a description of the classes you use, the relationship between the classes, and the functions or classes in addition to those in the lecture notes). 2. A brief description of the data structure you create (i.e., a theoretical definition of the data structure and the actual data arrangement in the classes). 3. A description of how you implement the calculation of individual search cost and average search cost. Is the implementation associated with the operations find, insert, remove? Analyze the time complexity of updating the search cost of an individual node and summing up the search costs over all the nodes. 4. Give individual search cost in terms of n using big-O notation. Analyze and give the average search costs of a perfect binary tree and a linear binary tree using big-O notation, assuming that the following formulas are true ( n denotes the total number of integers). ∑ log 2 ( n +1)- 1 d =0 2 d ( d + 1) ≃ ( n + 1) · log 2 ( n + 1) − n and ∑ n d =1 d ≃ n ( n + 1) / 2 5. Include a table and a plot of average search costs you obtain. In your discussions of the experimental results, compare the curves of search costs with your theoretical analysis results in item 4. 3...
View Full Document
- Winter '09
- search cost, average search cost