Question: You need to implement functions createBitArray and createBitmap in bitmaps.c . The first function is supposed to help in the implementation of the second. The
You need to implement functions createBitArray and createBitmap in bitmaps.c
The first function is supposed to help in the implementation of the second.
The createBitArray function sets ie gives the value to times of the rightmost bits in
a bitarray starting from index position. For example, createBitArray
should return : there are three bits set with the first one at index position if we
count indices right to left the first index being
The number of bit arrays that should be contained in a bitmap is controlled by the times
parameter of the createBitmap function. The id parameter is just used to set the offerid
of the bitmap struct. The times value is expected to satisfy times and timesD The
bit arrays that are created should have their ones at consecutive positions.
expected output:
BitmapOffer id:
Bitarrays:
:
:
:
:
:
BitmapOffer id:
Bitarrays:
:
:
:
:
:
BitmapOffer id:
Bitarrays:
:
:
:
:
:
BitmapOffer id:
Bitarrays:
:
:
:
:
:
BitmapOffer id:
Bitarrays:
:
:
:
:
:
scheduler.h:
#include
#include
#define L maximum number of characters in a name
#define D number of days of instruction in the schedule
typedef struct personstruct
char nameL;
struct personstruct next;
person;
typedef struct teachingoffer
int id; unique identifier for offer
int times;
char gradeL;
person teacher; one or more lead teachers
person assistant; one or more assistants
struct teachingoffer next;
offer;
typedef unsigned char bitarray; D should be less than
typedef struct bitmapstruct
int offerid;
bitarray bD;
struct bitmapstruct next;
bitmap;
void printOffer offer k;
void printBinary char n;
void printBitmap bitmap m;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
