How do the bit manipulations in this bit-sorting code work?

前端 未结 6 1488
时光取名叫无心
时光取名叫无心 2021-01-31 22:20

Jon Bentley in Column 1 of his book programming pearls introduces a technique for sorting a sequence of non-zero positive integers using bit vectors.

I have taken the p

6条回答
  •  春和景丽
    2021-01-31 23:22

    A few doubts : 1. Why is it a need for a 32 bit ? 2. Can we do this in Java by creating a HashMap with Keys from 0000000 to 9999999 and values 0 or 1 based on the presence/absence of the bit ? What are the implications for such a program ?

提交回复
热议问题