- Where Developers Learn, Share, & Build Careers


Below page 264 of CLRS, the authors say that after getting r0 = 17612864, the R4 yield is 14 Bits Hash Value H (K) = 67. I do not understand that 67 is 670011 due to 67 in binary 67 which is 7 bits. In the textbook:

Edit In textbooks, suppose we have k = 123456, p = 14, m = 2 ^ 14 = 16384, and w = 32 To optimize suggestion of Nith, we select the fraction of the form A / 2 ^ 32 which is closest (\ Sqrt (5) - 1) / 2, so that A = 2654435769/2 ^ 32 then k * s = 327706022297664 = (76300 * 2 ^ 32) + 17612864, and hence r1 = 76300 and r0 = 17612864. The 14 most important bit values ​​of r0 get H (K) = 67.

17612864 = 0x010CC040 = 0000 0000 1100 1100 0000 0100 0000

Its most important is 14 bits

  0000 0001 0000 11   

which is 0x43 , which is 67

besides:

  int32 input = 17612864; Int32 output = input & gt; & Gt; (32-14); // 67    

Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -