Serialize and Deserialize BST | Leet code 449 | Theory explained + Python code

preview_player
Показать описание
This video is a solution to Leet code 449, Serialize and Deserialize BST. I explain the question, go over how the logic / theory behind solving the question and finally solve it using Python code.

Comment below if you have a better solution to this problem!

Let me know if you have any feedback and don't forget to subscribe for more videos!

More leetcode questions solved:

Gear used:
Рекомендации по теме
Комментарии
Автор

Great explanation! As build function is a recursive function don't miss the base case which is:

if not preorder or not inorder:
return None

abhijeetthakurdesai
Автор

you dont need the inorder traversal in order to construct a Binary "search" tree. The preorder suffice for BST. However you need both inorder and preorder traversal for the Binary tree construction.

haniehh
Автор

You can construct tree from using only preorder traversal only by marking the null nodes as "#'

vibeStationPS
join shbcf.ru