callajd / comp7960

Assignments for COMP 7960
0 stars 0 forks source link

HtmlWebNodeVisitor processes children when visiting nodes that are at maximum depth #1

Open callajd opened 7 years ago

callajd commented 7 years ago

HtmlWebNodeVisitor could be smarter about its visitation - the search algorithm specifically doesn't add children to the stack if the current node is at the maximum depth. However, the visitor doesn't have any insight into the depth of the node it's visiting.

Could pass the depth to the visitor as a parameter or augment the Node object with a depth field...

callajd commented 7 years ago

https://github.com/callajd/comp7960/blob/ac961565cd7f85c1adf069ac61f5f050985d0df0/assignment1/src/main/java/edu/auburn/search/HtmlWebNodeVisitor.java#L54

callajd commented 7 years ago

Making SearchNode a public class, and passing that to Visitor instead of Node would be an easy fix.