Domanda di colloquio di Amazon

Encode and decode a BST into a string (write a function to store it in string format, then a function to read it into a BST)

Risposta di colloquio

Anonimo

5 nov 2022

You can use a preorder traversal with keeping track of the root to encode and decode the BST.