fix what() method of exception class
remove unused variables
fix checks whether tree node order is dfs