Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
I was wondering that myself, niklasb, but then I found this on Wikipedia:
"If the input is given as a subroutine for calculating ƒ, the cycle detection problem may be trivially solved using only λ+μ function applications, simply by computing the sequence of values xi and using a data structure such as a hash table to store these values and test whether each subsequent value has already been stored. However, the space complexity of this algorithm is λ+μ, unnecessarily large. Additionally, to implement this method as a pointer algorithm would require applying the equality test to each pair of values, resulting in quadratic time overall. Thus, research in this area has concentrated on two goals: using less space than this naive algorithm, and finding pointer algorithms that use fewer equality tests."
what the heck kind of restriction is that?! How is one solution "better" than the other if it has the same asymptotic complexity, same code length and same real-world performance. That's just arbitrary.
You should tell that Hash has been disabled in the instructions. I was trying my solution and wondering why it didn't work at all!
Yep thanks I didn't manage to delete the Hash class or its methods, instead I return nil in the most useful methods . . .
Still allows doing this:
my_hash = {}
Done. No more hashes.
I didn't think of doing that. I added a time but it didn't really help. Thanks for the tip !!