AStar with sorted array.