Google interview question

Graph traversal and quick select.