Click here to Skip to main content
15,868,292 members
Articles / Programming Languages / C#

Apply "yield return" recursively - iterating tree data structures

Rate me:
Please Sign up or sign in to vote.
4.29/5 (16 votes)
21 Feb 2008CPOL2 min read 52.6K   179   27  
A generic function that enables "deep-iterating" the leafs of arbitrary tree data structures simply using foreach.

Alternatives

Members may post updates or alternatives to this current article in order to show different approaches or add new features.

No alternatives have been posted.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Germany Germany
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions