Generic framework for UCT and Best First Bandit