Skip to main content

Questions tagged [bitset]

A bit array (also known as bitmap, bitset, bit string, or bit vector) is an array data structure that compactly stores bits. It can be used to implement a simple set data structure. A bit array is effective at exploiting bit-level parallelism in hardware to perform operations quickly. A typical bit array stores kw bits, where w is the number of bits in the unit of storage, such as a byte or word, and k is some nonnegative integer.

3 votes
2 answers
874 views

Intro In this post, I will present three (3) non-negative integer encoding techniques: Elias gamma coding Elias delta coding Golomb-Rice coding Code ...
coderodde's user avatar
  • 32.6k
2 votes
0 answers
75 views

I have this GitHub repository (BitPredictor.java). Basically, I tried to harness a machine learning model for predicting bit strings. I have implemented it to the best of my understanding and have ...
coderodde's user avatar
  • 32.6k
5 votes
3 answers
1k views

I have currently implemented an increment method. A method to add bytes. And a method to print out the bitset.   Main.cpp ...
Christian Phillips's user avatar
1 vote
1 answer
134 views

(This post is the continuation of Bit vector in Java supporting O(1) rank() and O(log n) select(). It resides here (version 1.0.1).) Basically, I have implemented everything harold suggested, except ...
coderodde's user avatar
  • 32.6k
1 vote
1 answer
201 views

Introduction I have this GitHub repository (version 1.0.0.). It implements a rank(i) operation in \$\Theta(1)\$ time, and ...
coderodde's user avatar
  • 32.6k
3 votes
2 answers
373 views

I am looking for opinion on this bitset implementation. It only has 4 functions and they are set - set a bit/clear - clear a bit/check - test a bit /zero - zero out all bits. There is another one as ...
sOmEonE 's user avatar
3 votes
1 answer
96 views

https://github.com/speedrun-program/small_array/blob/main/small_array.py As a personal project, I wanted to try to make Snake Game in pygame where the grid can be arbitrarily large. I made these ...
my_stack_exchange_account's user avatar
4 votes
3 answers
410 views

Motivation: I am working with sequences of n-bit values coming from an ADC. I was initially using a std::vector<unsigned short> to store these values (12 bit ...
lobis's user avatar
  • 161
6 votes
2 answers
1k views

This is my draft implementation of Huffman encoding & decoding. I'd appreciate any feedback, but have a couple specific questions: I wrote the code assuming vector represents each bool with a ...
Uri Raz's user avatar
  • 213
1 vote
4 answers
253 views

I have this tool for permuting bits in BitSets: com.stackexchange.codereview.util.BitPermutation.java: ...
coderodde's user avatar
  • 32.6k
0 votes
1 answer
186 views

I'm using a long as a bitset to represent a game board. If a field is set (X) the corresponding bit is set, if it's empty (...
martin's user avatar
  • 131
8 votes
2 answers
1k views

So I have been learning more about binary numbers lately, particularly in related to describing a gamestate. While perhaps chess is the most natural candidate I wanted to start of with something ...
N3buchadnezzar's user avatar
3 votes
4 answers
145 views

Context I have an array of maximum-fixed-size, size, containers of items; these items are either pointers to objects or an index of the same array, (but no loops.) ...
Neil's user avatar
  • 1,112
2 votes
1 answer
529 views

So this is my task: You are given an irregular shape on a bitmap. How do you determine if a point is inside or ousdie of the shape? We are allowed to assume that ...
NoobCoder's user avatar
  • 129
1 vote
2 answers
1k views

Im not that good at C, so go easy on me, but I wanted to be able to have individual bit access in C without using a ton of functions to do bit manipulation on a ...
QuestionLimitGoBrrrrr's user avatar

15 30 50 per page
1
2 3 4 5