http://www.perlmonks.org?node_id=740867

donkeykong has asked for the wisdom of the Perl Monks concerning the following question:

Hi guys, how would you mathematically prove that a hash is a more efficient and scalable data structure than an array, in a situation where you have to read a file, find all its unique keys and show the # of occurrences each unique key had in the file? I came to the conclusion that the hash in big-oh notation is O(1) and the array is O(n), but again, how can I mathematically prove it? I appreciate your help.