Solved

Perform EulerTour for a given directory

Posted on 2007-03-26
2
355 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:
Mayank S earned 500 total points
ID: 18797944
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:Mayank S
ID: 18812782
You don't need to accept this comment - pls get the question deleted
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Update (December 2011): Since this article was published, the things have changed for good for Android native developers. The Sequoyah Project (http://www.eclipse.org/sequoyah/) automates most of the tasks discussed in this article. You can even fin…
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: …
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.

920 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

16 Experts available now in Live!

Get 1:1 Help Now