depth and breath first search