Problem
1. Describe an O(n log(n)) algorithm for checking whether an array has duplicates.
2. What is the big-Oh running time of the following algorithm to find an element in an n × n array?
for (int i = 0; i < n; i++)
{
for (int j = 0; j < n; j++)
{
if (a[i][j] == value) {return false;}
}
}
return false;