3 ms·
Not really O(1), you still need to go through the big tree to find the node with teh deisred hash. You also have to check if the trees are truly identical to ha
by pierrebai 7y ago
Not really O(1), you still need to go through the big tree to find the node with teh deisred hash. You also have to check if the trees are truly identical to handle the case of hash collision.
- ThePhysicist 7y agoThe idea is that you create a hash map where the key is a tree hash and the value points to the tree in memory, so it should be O(1). Hash collision can of course happen but is extremely unlikely if you use a robust scheme like SHA256.