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.
Python dicts, however, are not based on RB trees but on hash tables with open addressing collision resolution. The probing method in use is double hashing (details here).
You can lookup the implementation of Python's hash function here. _PyHASH_BITS being defined as 31 for 32bit platforms and 61 for 64bit platforms, all integers dealt with in the current problem have different hash values.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Count Triplets
You are viewing a single comment's thread. Return to all comments →
You're right about O(1) being the average case.
Python dicts, however, are not based on RB trees but on hash tables with open addressing collision resolution. The probing method in use is double hashing (details here).
You can lookup the implementation of Python's hash function here. _PyHASH_BITS being defined as 31 for 32bit platforms and 61 for 64bit platforms, all integers dealt with in the current problem have different hash values.