Determine whether a given array contains duplicate elements. A hash table solves this. I actually used a map, which is a binary search tree in C++. The O(log n) solution, so the performance isn’t the best.
| |
Determine whether a given array contains duplicate elements. A hash table solves this. I actually used a map, which is a binary search tree in C++. The O(log n) solution, so the performance isn’t the best.
| |