generalized A* search to work for any search, and used polymorphism to allow SearchNode class to be the base search class