Problem 449 · Medium

Serialize and Deserialize BST

Convert a binary search tree into a compact string and rebuild the same tree from that string. The visual writes node values in preorder, then rebuilds by placing each value within the bounds set by its ancestors.

Open the interactive visualisation