f1(node)
{
# depth first
list_of_children = node->children
{
# depth first
list_of_children = node->children
for child in list_of_children {
f1(child)
}
}
f2(node)
{
# breadth first
list_of_children = node->children
???
}
f3(node)
{
# depth first
if(node->child) {
f3(node->child)
}
if(node->sibling) {
f3(node->sibling)
}
}
f4(node)
{
# breadth first
if(node->sibling) {
f4(node->sibling)
}
if(node->child) {
f4(node->child)
}
}
< Ask Husi | BBC White season: 'Rivers of Blood' > |