ServiceNow interview question

BFS, Sorting in infinite sorted array.