fixed dfs errors
Merge branch 'master' of https://github.com/nwotero/cs2223
Case 4 works except for edge case