Presentation is loading. Please wait.

Presentation is loading. Please wait.

Algorithms Animation Workshop by Roman Gubarenko supervised by Prof. A. Mirzaian Dynamic Programming: Optimal Static Binary Search Tree Roman Gubarenko,

Similar presentations


Presentation on theme: "Algorithms Animation Workshop by Roman Gubarenko supervised by Prof. A. Mirzaian Dynamic Programming: Optimal Static Binary Search Tree Roman Gubarenko,"— Presentation transcript:

1 Algorithms Animation Workshop by Roman Gubarenko supervised by Prof. A. Mirzaian Dynamic Programming: Optimal Static Binary Search Tree Roman Gubarenko, York University

2 BST Algorithm Problem: For n keys (K1, …, Kn) with given search probability distribution (p1, …, pn) minimize the expected search time. Typical DP problem! 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. 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: To build the BST we actually need to accomplish 2 steps: 1.Main part: using DP approach we build the matrix of expected costs (for all possible subtrees). 2.Using trivial recursion construct the BST according to the matrix built on step 1. Roman Gubarenko, York University

3 Algorithm Animation Goals are obvious: 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)? 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

4 Finally, Animation URL: 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? 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 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 Have to be able to work under minimal supervision Greater personal responsibility Greater personal responsibility Have to be a real quick learner and be able to do the research 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


Download ppt "Algorithms Animation Workshop by Roman Gubarenko supervised by Prof. A. Mirzaian Dynamic Programming: Optimal Static Binary Search Tree Roman Gubarenko,"

Similar presentations


Ads by Google