We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5e4ecde commit b2365edCopy full SHA for b2365ed
zh-hans/basics_algorithm/bitmap.md
@@ -32,7 +32,7 @@ int main(int argc, char *argv[])
32
{
33
const int BIT_LEN = sizeof(int) * 8;
34
const unsigned int N = 1 << (BIT_LEN - 1);
35
- unsigned int *bits = (unsigned int *)calloc(N, sizeof(int));
+ unsigned int *bits = (unsigned int *)calloc(N / BIT_LEN, sizeof(int));
36
for (unsigned int i = 0; i < N; i++) {
37
if (i % 10000001 == 0) setbit(bits, i, BIT_LEN);
38
}
0 commit comments