Bit array Vs Bit vector

471 views Asked by At

I am trying to figure out the difference between a bit array and a bit vector.

When browsing the web I find conflicting information.

Some sources claim that a bit array is simply an array with 1s and 0s in each index.

E.g.

{0,1,0,0,0,1}

And some sources claim that a bit vector is some sort of array that can have for example one nibble in each cell.

{0001,0010,0000,0011}

Does this mean that the terms bit vector and bit array are the same and that they come in multiple forms or is it just that they are different data structures?

1

There are 1 answers

0
fetknoppen On BEST ANSWER

A bit vector only contains bit's, like (1,0,1).

A bit array may be able to contain a single bit...not sure, but I think I would use it only if each element contained more than one bit, like ([1,1],[0,1],[1,0]).

So the difference is, if there are elements in the collection that have 2 or more binary digits(01..) I would call it an array, otherwise bit vector.

so a bit array is an array filled with bit vectors. :)