Other than an array, what data structure has O(1) insertion and O(1) search?
Anonymous
The array does not have O(1) search.... It takes O(n) if it's unsorted, O(log n) if sorted, but if it is sorted, then insertion is no longer O(1)
Check out your Company Bowl for anonymous work chats.