Skip to content

Instantly share code, notes, and snippets.

View atcherkasov's full-sized avatar

Andrey Cherkasov atcherkasov

  • Moscow
View GitHub Profile
@ShvedAction
ShvedAction / BinaryTreeFromBracketsString.py
Last active May 17, 2020 11:43
Биекция правильной скобочной последовательности и бинарного дерева.
class BinaryNode(object):
def __init__(self):
self.right_node = False
self.left_node = False
def to_brackets_string(self):
result = "("
if self.left_node is not False:
result += self.left_node.to_brackets_string()
result += ")"