Store all nodes of same line together as a vector
try : NEW_LINE INDENT diagonalPrintMap [ d ] . append ( root . data ) NEW_LINE DEDENT except KeyError : NEW_LINE INDENT diagonalPrintMap [ d ] = [ root . data ] NEW_LINE DEDENT