GreedySearch Algorithm