binary trees listing continued stack localstack new stack()isrowempty truefor(int = <nblanksj++system out print(')while(globalstack isempty()==falsenode temp (node)globalstack pop()if(temp !nullsystem out print(temp idata)localstack push(temp leftchild)localstack push(temp rightchild)if(temp leftchild !null |temp rightchild !nullisrowempty falseelse system out print("--")localstack push(null)localstack push(null)for(int = <nblanks* - ++system out print(')/end while globalstack not empty system out println()nblanks / while(localstack isempty()==falseglobalstack pushlocalstack pop()/end while isrowempty is false system out println")/end displaytree(//end class tree ///////////////////////////////////////////////////////////////class treeapp