We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
I just finished the empirical complexity analysis. Actually, according to my results, your algorithm runs in O(N^4). I don't understand your code well enough to say why that is, though.
I generated an input consisting of 100 randomly initialized strings from length 10 to 1,000. I modified both of our codes slightly to output their running times in addition to the actual answer. On very small inputs, your code ran faster, (probably because of the language difference) but it took about 6 minutes on an input of length 1,000. With my hashing method, that input was processed in about a third of a second. You can check out all of my data and the analysis that I did in my excel file:
Sherlock and Anagrams
You are viewing a single comment's thread. Return to all comments →
I just finished the empirical complexity analysis. Actually, according to my results, your algorithm runs in O(N^4). I don't understand your code well enough to say why that is, though.
I generated an input consisting of 100 randomly initialized strings from length 10 to 1,000. I modified both of our codes slightly to output their running times in addition to the actual answer. On very small inputs, your code ran faster, (probably because of the language difference) but it took about 6 minutes on an input of length 1,000. With my hashing method, that input was processed in about a third of a second. You can check out all of my data and the analysis that I did in my excel file:
https://drive.google.com/file/d/0ByaGnKfMhkJLN1R3NzJ6SVRCNjA/view?usp=sharing