Google Coding Interview Question: Serialize & Deserialize A Binary Tree (Java Solution)
Not employed by dailycodingproblem.com, just a fan.
You can (and should) sign up to receive an email with a coding problem everyday here: https://www.dailycodingproblem.com
You can subscribe to my channel here: / @dailycodingproblem8346
Daily Coding Problem: Problem #3 [Medium]
Good morning! Here's your coding interview problem for today.
This problem was asked by Google.
Given the root to a binary tree, implement serialize(root), which serializes the tree into a string, and deserialize(s), which deserializes the string back into the tree.
For example, given the following Node class
class Node:
def __init__(self, val, left=None, right=None):
self.val = val
self.left = left
self.right = right
The following test should pass:
node = Node('root', Node('left', Node('left.left')), Node('right'))
assert deserialize(serialize(node)).left.left.val == 'left.left'
Solution involves recursion and pre-order traversal of a tree
Nesta página do site você pode assistir ao vídeo on-line Google Coding Interview Question: Serialize & Deserialize A Binary Tree (Java Solution) duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário Daily Coding Problem 07 Junho 2020, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 398 vezes e gostou 4 espectadores. Boa visualização!