Question: C++ Write a compression function that reads in an array of numbers a where each number is 2 bits. Compress into a single 64-bit word,

C++
Write a compression function that reads in an array of numbers a where each number is 2 bits. Compress into a single 64-bit word, then write out to output. Example: if you have 65 numbers in a, then you should write out 3 numbers into output, the first two are full, and the last one has only a single value.
uint64_t compress(uint32_t a[],
uint32_t len, uint64_t output[]);

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!