Reply to Re: Code snippet for recursive file reading?

Your name:

Reply:


Posted by Curtis on 12/15/05 06:42

ZeldorBlat <zeldorblat@gmail.com> wrote in message
news:1134537220.700264.55270@g44g2000cwa.googlegroups.com...
>
> Curtis wrote:
>
> > The only way I can presently see to solve the problem is
> > with linked lists, and backwalk the link paths when,
say, E
> > calls B. But I've never worked on this issue before, so
> > maybe there's a simpler algorithm that hasn't occurred
to
> > me?
> >
>
> Well, you basically just described the best algorithm out
there. By
> doing a depth first search of the tree you can detect
cycles pretty
> easily.

That may turn out to be simple. Keep track of the path we're
following, like:

FileA -> FileB --> FileC --> FileD --> File?

If the call to File? is anywhere on that particular path,
that would be a circular call.

I recall working through something not unlike this on a
TreeView component I was writing in Object Pascal some time
back... maybe I can find the code somewhere.


--

Curtis

Visit We the Thinking
www.wethethinking.com
An online magazine/forum
devoted to philosophical
thought.

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация