40 likes | 132 Views
Algorithms Animation Workshop. Dynamic Programming: Optimal Static Binary Search Tree. by Roman Gubarenko supervised by Prof. A. Mirzaian. Roman Gubarenko, York University. BST Algorithm.
E N D
Algorithms Animation Workshop Dynamic Programming: Optimal Static Binary Search Tree by Roman Gubarenko supervised by Prof. A. Mirzaian Roman Gubarenko, York University
BST Algorithm • Problem: For n keys (K1, …, Kn) with given search probability distribution (p1, …, pn) minimize the expected search time. Typical DP problem! • Extended version considers also unsuccessful searches i.e. in addition to prob. pi (i=1..n) for successful searches we have another set of prob. qi (i=0..n) on input for unsuccessful searches. • To build the BST we actually need to accomplish 2 steps: • Main part: using DP approach we build the matrix of expected costs (for all possible subtrees). • Using trivial recursion construct the BST according to the matrix built on step 1. Roman Gubarenko, York University
Algorithm Animation • Goals are obvious: • visualize the operation of the algorithm on each step as more as possible • easy-to-use, intuitive control • flexible interface, convenient navigation and control • How did I reach these goals (show the applet)? • data input step: demo inputs, user input rescaling, flexible controls • matrix construction step: flexible algorithm flow control, source code animation control, watch window, debug mode imitation, animated matrixes • BST construction step: flow control, flexible and convenient subtree (subset) selection control, full animation of tree construction process, smart tree builder (no branch intersections, scrollable surface) Roman Gubarenko, York University
Finally, • Animation URL: http://www.cs.yorku.ca/~aaw/Gubarenko/BSTAnimation.html • What did 4080 give to me and why would I recommend it to other students? • Applied my Java knowledge on practice (did not have this opportunity before) • Get some experience developing the real application • Close to real work conditions • ! Have to be creative – not just a technical work … Particularly, for AAW I had to apply all my skills obtained in the university: software design, implementation, math, … • Have to be able to work under minimal supervision • Greater personal responsibility • Have to be a real quick learner and be able to do the research • Very important: great opportunity for doing independent research – not like any regular course, more like postgraduate study … Roman Gubarenko, York University