Important Questions

CBSE Guess > Papers > Important Questions > Class XII > 2010 > Computer Science > Computer Science By Ravi Kiran

CBSE CLASS XII

(b) Assuming LBR=LBC=0
S=4 bytes
Number of Rows(N)=15
Number of Columns(M)=20
LOC(Arr[I][J]).= B +((I-LBR)*M+(J-LBC))*S
LOC(Arr[5][2]).= B +((5-0)*20+(2-0))*4
1500.= B +(100+2)*4
B.= 1500-408
B.= 1092
LOC(Arr[3][2].= 1092+((3-0)*20+(2-0))*4
= 1092 + (62*4)
= 1092+248
= 1340

OR

Assuming LBR=LBC=1
S=4 bytes
Number of Rows(N)=15
Number of Columns(M)=20
LOC(Arr[I][J]).= B +((I-LBR)*M+(J-LBC))*S
LOC(Arr[5][2]).= B +((5-1)*20+(2-1))*4
1500 .= B +(80+1)*4
B .= 1500-324
B .= 1176
LOC(Arr[3][2]).= 1176+((3-1)*20+(2-1))*4
. .= 1176 + (41*4)
.= 1176+164
.= 1340

(c) class QUEUE
{
Customer *Rear,*Front;
public:
QUEUE( ) { Rear=NULL; Front=NULL;}
void DELETE( );
~QUEUE( );
};

//Function definition DELETE()
void QUEUE::DELETE()
{
if(Front==NULL) // OR if(!Front)
cout<<”\n Queue Underflow\n”;
else
{
Customer *Temp;
Temp=Front;
cout<<Front->Cno<<”:”<<Front->Cname
<<”Deleted”<<endl;//To be ignored
Front=Front->Link;
delete Temp;
if (Front==NULL)
Rear=NULL;
}
}

OR

void DELETE(Customer *&Front,Customer *&Rear)
{
if(!Front)
cout<<”\n Queue Underflow\n”;
else
{
Customer *Temp;
Temp=Front;
cout<<Front->Cno<<”:”<<Front->Cname
<<”Deleted”<<endl;//To be ignored
Front=Front->Link;
delete Temp;
if (Front==NULL)
Rear=NULL;
}
}

Paper By Mr. Ravi Kiran
Email Id : [email protected]