Depth first search: example and properties