Implicit Evaluation with PHP

Implicit Evaluation with PHP Archives: Recursion

·

1 January 2007

Recursive Data Structures in PHP

Welcome to the Jungle
Today, I was helping a friend implement a recursive category model. There is a top level category and each category contains items and sub-categories.
It’s easy to illustrate on the web:

Top Level Category

Item 1.1
Item 1.2
Subcategory 1.3

Item 3.1
Item 3.2

Subcategory 1.4

Subcategory 4.1

Subcategory 4.1.1

Item 4.1.1.1
Item 4.1.1.2

Item 4.1.2

Somehow, your web browser can take a piece of text […]

continue reading... » 0 Comments

27 September 2006

Tail Recursion in PHP

There are two types of recursion in the world: tail recursive and non-tail recursive. Non-tail recursive is the more obvious of the two and is used frequently. For instance, when dealing with any kind of hierarchical data (that which is expressed in a tree data structure) a recursive call is likely used to construct the […]

continue reading... » One Comment

·