Module ClassDef bases body FunctionDef arguments args NameParam NameParam defaults body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body If CompareIs NameLoad NameLoad body Return Str orelse Return Call AttributeLoad Str attr AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr decorator_list decorator_list ClassDef bases body FunctionDef arguments args NameParam NameParam defaults body Assign NameStore NameLoad While NameLoad body Assign TupleStore NameStore NameStore NameStore TupleLoad NameLoad NameLoad NameLoad While NameLoad body If CompareIs NameLoad NameLoad body If AttributeLoad NameLoad attr body Assign NameStore AttributeLoad NameLoad attr orelse If AttributeLoad NameLoad attr body Assign NameStore AttributeLoad NameLoad attr If AttributeLoad NameLoad attr body If NameLoad body Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Assign NameStore AttributeLoad NameLoad attr If AttributeLoad NameLoad attr body If NameLoad body Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Assign NameStore AttributeLoad NameLoad attr Assign NameStore AttributeLoad NameLoad attr Assign NameStore NameLoad decorator_list decorator_list If CompareEq NameLoad Str body Assign TupleStore NameStore AttributeStore NameLoad attr AttributeStore NameLoad attr TupleLoad Call NameLoad Num Call NameLoad Num Call NameLoad Num Assign TupleStore AttributeStore AttributeLoad NameLoad attr attr AttributeStore AttributeLoad NameLoad attr attr AttributeStore AttributeLoad NameLoad attr attr TupleLoad Call NameLoad Num Call NameLoad Num Call NameLoad Num Expr Call AttributeLoad Call NameLoad attr NameLoad Print NameLoad Print AttributeLoad NameLoad attr Print AttributeLoad AttributeLoad NameLoad attr attr
N/A TreeNode N/A N/A __init__ N/A N/A self x N/A N/A N/A N/A self val x N/A N/A self left None N/A N/A self right None N/A N/A self next None N/A __repr__ N/A N/A self N/A N/A N/A N/A self None N/A N/A Nil N/A N/A N/A N/A {} -> {} format N/A self val N/A repr N/A self next N/A N/A Solution N/A N/A connect N/A N/A self root N/A N/A N/A head root N/A head N/A N/A N/A prev cur next_head N/A None head None N/A cur N/A N/A N/A next_head None N/A N/A N/A cur left N/A N/A next_head N/A cur left N/A N/A N/A cur right N/A N/A next_head N/A cur right N/A N/A cur left N/A N/A prev N/A N/A N/A prev next N/A cur left N/A prev N/A cur left N/A N/A cur right N/A N/A prev N/A N/A N/A prev next N/A cur right N/A prev N/A cur right N/A cur N/A cur next N/A head next_head N/A N/A N/A N/A __name__ __main__ N/A N/A N/A root N/A root left N/A root right N/A N/A TreeNode 1 N/A TreeNode 2 N/A TreeNode 3 N/A N/A N/A N/A root left left N/A N/A root left right N/A N/A root right right N/A N/A TreeNode 4 N/A TreeNode 5 N/A TreeNode 7 N/A N/A N/A N/A Solution connect root N/A root N/A N/A root left N/A N/A N/A root left left