I have to print a directory tree (like tree command), example:
. +---A | +---IMAGES | +---BACKUP +---ADOKS | +---ROZDZIAL_2 | +---ROZDZIAL
Think of it like this -
procedure printOutput(file, depth): print "| " depth times; print "+---" + file name; print new line if(file is a directory): for(each file inside file, say innerFile): call printOutput(innerFile, depth + 1);
Hope that helps.