added depth-first-search-order algorithm