![]() |
.. (לתיקייה המכילה) | |
In CurrentRanking(), are you sure that the complexity is O(nlog*n)? | |
Yes, we're sure. |
What is the complexity of n union/find operations on a UF structure not at its initial state? | |
The proof mentioned in class proves that m U/F operations on a freshly init'd UF (with n elements) take O(mlog*(n)) time. You may assume that n U/F operations take O(nlog*(n)) , on any UF structure, even one that has already been changed by previous union/find commands. |
Who allocates the array "results" in CurrentRanking()? | |
The array is allocated before being passed to the function, so there is no need to allocate it within the function. |
***THIS QUESTION IS NOW OBSOLETE*** | |
We are aware of the warning, and it can be ignored for now. You can compile without -Wall, but make sure that is the only warning present. Note that other warnings should be treated normally. |
Does the size of my hash table have to be prime? | |
No, it doesn't have to be prime. Unless you are using double hashing, both prime and composite table sizes will offer an O(1) average operation time. This is true due to the uniform distribution assumption regarding the input. Choosing prime numbers for your modulo hash function does provide a better (non-asymptotic, average case) performance, but it's not a must. |