Article View: borland.public.jbuilder.java.language
Article #15309Re: floodfill ?
From: Claude Glauser
Date: Thu, 24 Jun 1999 00:00
Date: Thu, 24 Jun 1999 00:00
17 lines
1230 bytes
1230 bytes
Every recursive function can be transformed to an iterative
algorithm (with a while statement) with the help of a stack and vice
versa.
There is a mathematical proof for that.
A stack with a huge capacity can be implemented with the help of a liked
list. Each element of the list contains a value like a image and
a pointer or reference to the next element. The last element points
to Null and is the end of the list.
Example of a Item-Class of a linked list:
class Node {
int Value;
Node nextNode;
}
Good luck, Claude
Technical Details
Message-ID:
<37716695.8116989F@smile.ch>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<7jtt81$dbb6@forums.borland.com> <37627F5D.64252A56@smile.ch> <7ju1la$dct11@forums.borland.com> <37640CDB.A2048D91@smile.ch> <7ke6tk$sa33@forums.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,2d69d13a2dca9a50 X-Google-Attributes: gidf74b3,public From: Claude Glauser <claude.glauser@smile.ch> Subject: Re: floodfill ? Date: 1999/06/24 Message-ID: <37716695.8116989F@smile.ch> X-Deja-AN: 493132587 Content-Transfer-Encoding: 7bit References: <7jtt81$dbb6@forums.borland.com> <37627F5D.64252A56@smile.ch> <7ju1la$dct11@forums.borland.com> <37640CDB.A2048D91@smile.ch> <7ke6tk$sa33@forums.borland.com> Content-Type: text/plain; charset=us-ascii Organization: Another Netscape Collabra Server User Mime-Version: 1.0 Reply-To: claude.glauser@smile.ch Newsgroups: borland.public.jbuilder.java.language