Pega Interview Question
Software Engineer / Developers1)
Sort the array nlogn
scan the sorted array using two indices and element duplicates between two indices
Runtime O(nlogn), space O(1)
2)
hash array elements as key to a hash-table, output the keys in the hashtable
Runtime O(n), space -- depends on hash-table, assuming typical, O(n)
store the data from array to set
- Anonymous June 04, 2012