Interval DP over search frequencies: every root tried per key range, expected lookup cost minimized — and the best root isn't always the hottest key.
Tip: use samples, upload, copy, download, and send-to actions inside the workspace where available.
Optimal BST Visualizer is a free, browser-based tool that helps you turn raw numbers into clear charts. Interval DP over search frequencies: every root tried per key range, expected lookup cost minimized — and the best root isn't always the hottest key. It's built for speed and privacy: Everything runs locally in your browser — your data is never uploaded to a server. No sign-up, no installs, and no daily limits.
Visualize the dataset after it has been cleaned enough for reliable labels and numeric values.
Review the preview, copy or download the result, and keep everything local in your browser.
Binary Search Tree Visualizer: Insert, delete, search, and traverse a BST, AVL tree (animated rotations with balance factors), or min-heap — every comparison narrated, every pointer move animated.
Open toolMatrix Chain Multiplication Visualizer: Interval DP animated: every split point k tried for every chain window, the cost table fills diagonal by diagonal, and the optimal parenthesization emerges.
Open toolAlgorithm Academy: 35+ classic algorithms animated step by step — searching, counting/radix/bucket sort, dynamic programming tables, greedy, backtracking, KMP, graph algorithms, max flow, and convex hull — with auto-play, next/prev stepping, adjustable interval, and pseudocode that highlights the running line.
Open tool| A | B | C | D | |
|---|---|---|---|---|
| A | 4 | 0 | 0 | 0 |
| B | 0 | 2 | 0 | 0 |
| C | 0 | 0 | 6 | 0 |
| D | 0 | 0 | 0 | 3 |
1Optimal BST for keys A, B, C, D with search frequencies [4, 2, 6, 3]: cost[i][j] = cheapest expected search cost for keys i..j. Every level deeper costs one more visit per lookup.
cost[i][i] = freq[i]for windows of growing length:try every key r as root:left + right + Σfreq(window)keep the cheapest rootanswer = cost over all keys
Given search frequencies, choose tree roots so expected lookup cost is minimal — every root choice adds one level to everything below.