We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
If you sort the array, you only have to compare the first and last elements, thereby acheiving n*log(n) performance (Java Arrays.sort) instead of quadratic (comparing every pair).
Day 14: Scope
You are viewing a single comment's thread. Return to all comments →
If you sort the array, you only have to compare the first and last elements, thereby acheiving n*log(n) performance (Java Arrays.sort) instead of quadratic (comparing every pair).