Added depth-first algorithms