Shifting a Java BitSet

后端 未结 8 1578
太阳男子
太阳男子 2020-12-31 00:11

I am using a java.util.BitSet to store a dense vector of bits.

I want to implement an operation that shifts the bits right by 1, analogous to >

8条回答
  •  遥遥无期
    2020-12-31 00:57

    You can use BigInteger instead of BitSet. BigInteger already has ShiftRight and ShiftLeft.

提交回复
热议问题