Fill in the blanks:
Files.walk()
performs a ___ traversal, while Files.find()
performs a ___ traversal.
D.
A breadth-first traversal is when all elements of the same level, or distance from the starting path, are visited before moving on to the next level.
A depth- first traversal is when each element's entire path, from start to finish, is visited before moving onto another path on the same level.
Both walk()
and find()
use depth-first traversals, so Option D is the correct answer.