No, I use for loop.But I use vector to store linked list.So that I can easily find the path after I add the last point to the node Vector.
may be you can
whenever you want to put a complete path into the vector, check the vector, and decide whether to discard the "path" in the vector(when it is longer than new path) or not put the new path(when it is longer than the path in the vector) into the vector.
Keep the vector as "clean&&tidy" as you can.
Keep the vector as "clean&&tidy" as you can.