Algorithm · Uber · Medium
Problem: Serialize and Deserialize a Binary Tree, then Extend to an N-ary Tree Create logic that can encode a tree as text and rebuild that tree from the encoded text. Part 1: Binary Tree For a binary tree, provide operations that can: turn a tree rooted at root into a string with serialize(root); rebuild the original binary tree from a string with deserialize(data). A tree that is decoded after being encoded must preserve every node value and every parent-child…
Checking your access…