[UPDATE] added the DFS and BFS according to algorithms analysis of TC