Codeless question: Given a set of n numbers, how do you find the pair of numbers that have the smallest difference between them? — Sort them: Once the numbers are sorted, the closest pair of numbers must lie next to each other somewhere in sorted order. Thus, a linear-time scan through them completes the job, for a total of O(n log n) time including the sorting.

G
picture loading error handler
1227 thought(s)1.2K

Google Interview

This flashcard deck made by jwasham contains knowledge about google interview. For more details, please follow https://github.com/jwasham/google-interview-university
interview
computer science
development

Explore more quotes

ahmed kamel taha
ahmed kamel taha
ahmed kamel taha
ahmed kamel taha
ahmed kamel taha
ahmed kamel taha
ahmed kamel taha
ahmed kamel taha
ahmed kamel taha
ahmed kamel taha
ahmed kamel taha
ahmed kamel taha
ahmed kamel taha
ahmed kamel taha
ahmed kamel taha
ahmed kamel taha
ahmed kamel taha
ahmed kamel taha
ahmed kamel taha
ahmed kamel taha
ahmed kamel taha
ahmed kamel taha
ahmed kamel taha
ahmed kamel taha
ahmed kamel taha
ahmed kamel taha
ahmed kamel taha
ahmed kamel taha
ahmed kamel taha
ahmed kamel taha
ahmed kamel taha
ahmed kamel taha