CS-355 Assignment 2
Submission Date: 24th November 2012 @ 9:00am
Implement a class called BitArray, which will simulate a list of bits of any size, which can be individually set, cleared, flipped, and queried. You will also implement a function that is to be used by a sample test program, which uses the Sieve of Eratosthenes technique (with the bit array) to find prime numbers.
The BitArray class
Here are some details about the BitArray class:
1. A bit array or binary number is to be implemented with an underlying array of type unsigned char. 'Unsigned' because we are only interested in bits, not in negatives, and type char because it is the smallest integer type. The concept of a BitArray object is that it will store an array of bits indexed at 0, just like normal arrays. The most significant bit represents the sign of the binary number.
2. The array of characters should be created dynamically. The primary constructor has one parameter, which indicates how many bits are needed.
3. The Length() function
1
Expert's answer
2012-11-23T02:34:08-0500
Unfortunately, your question requires a lot of work and cannot be done for free. Submit it with all requirements as an assignment to our control panel and we'll assist you.
Finding a professional expert in "partial differential equations" in the advanced level is difficult.
You can find this expert in "Assignmentexpert.com" with confidence.
Exceptional experts! I appreciate your help. God bless you!
Comments
Leave a comment