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.
2
votes
0
answers
66
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 ...
I have currently implemented an increment method. A method to add bytes. And a method to print out the bitset.
Main.cpp
...
1
vote
1
answer
117
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 ...
Introduction
I have this GitHub repository (version 1.0.0.). It implements a rank(i) operation in \$\Theta(1)\$ time, and ...
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 ...
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 ...
4
votes
3
answers
388
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 ...
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 ...
1
vote
4
answers
225
views
I have this tool for permuting bits in BitSets:
com.stackexchange.codereview.util.BitPermutation.java:
...
0
votes
1
answer
168
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 (...
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 ...
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.) ...
2
votes
1
answer
516
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 ...
1
vote
2
answers
973
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 ...
I've implemented a simple program to sort an input of unique numbers given as decimals on a separate line. The idea is, since all numbers are unique, to use a (long) bitfield where a 1 on index n ...