Solved

Perform EulerTour for a given directory

Posted on 2007-03-26
2
354 Views
Last Modified: 2013-12-14
I need writer a class DirectoryTour to persorm an Euler Tour of a given File (i.e. a root of a directory) and i also write a main program to test it, it will call the methods beforeFirst, afterLast and inBetween. the method beforeFirst should be called the first time the node is vistited, the method afterLast should be called the last time the node is vistited, the method inBetween should be called in between each pair of children.  Finally, the default definiation of these methods should be print out the method name,

the a root of a directory like this:
c:\test0                        ------folder
c:\test0\one                -------folder
c:\test0\one\one-a      -------file
c:\test0\one\one-b      -------file
c:\test0\three               -------folder
c:\test0\two             -------folder
c:\test0\two\two-a      -------file
c:\test0\two\two-b      -------file


for example, out output should be like:
       beforeFirst: test0
       beforefirst: one
       beforefirst: one-a
       afterLast: one-a
       inBetween: one
       beforefirst: one-b
       afterLast: one-b
       afterLast: one
       inBetween: test0
0
Comment
Question by:ericylr
  • 2
2 Comments
 
LVL 30

Accepted Solution

by:
mayankeagle earned 500 total points
Comment Utility
Duplicate of http://www.experts-exchange.com/Programming/Languages/Java/New_to_Java/Q_22474002.html? Pls ask the Q only once and wait till an expert posts
0
 
LVL 30

Expert Comment

by:mayankeagle
Comment Utility
You don't need to accept this comment - pls get the question deleted
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Programmer's Notepad is, one of the best free text editing tools available, simply because the developers appear to have second-guessed every weird problem or issue a programmer is likely to run into. One of these problems is selecting and deleti…
Here is a helpful source code for C++ Builder programmers that allows you to manage and manipulate HTML content from C++ code, while also handling HTML events like onclick, onmouseover, ... Some objects defined and used in this source include: …
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now