M
maruf.syfullah
Consider the following Class definitions:
class AClass
{
int ai1;
int ai2;
public:
CClass* c;
AClass(){}
insertValues(int parm1, int parm2){
ai1 = parm1;
ai2 = parm2;
}
};
class BClass
ublic AClass
{
int bi1;
int bi2;
public:
AClass* a;
BClass* b;
BClass(){}
insertValues(int parm1, int parm2){
bi1 = parm1;
bi2 = parm2;
}
};
class CClass
ublic BClass
{
int ci1;
int ci2;
public:
BClass* b;
CClass(){}
insertValues(int parm1, int parm2){
ci1 = parm1;
ci2 = parm2;
}
};
Consider a HEAD pointer BClass* BHead and create a doubly linked list
where the forward and backward chain is maintained using BClass
pointers. Each of the nodes in the chain should maintain 10 integer
values. You are free to choose how you distribute 10 integers among
the objects of a node. Plan a distribution and stick to it. You can
choose whether you want to insert new nodes at the beginning of the
list or at the end of the list. Stick to any one.
Write the following functions for the link list:
void insert(int* int10parm);
and
void delete(int* int10parm);
where <int* int10parm> contains 10 integers. Expect the parameter for
delete function to have integers in the same order as for the insert
function.
class AClass
{
int ai1;
int ai2;
public:
CClass* c;
AClass(){}
insertValues(int parm1, int parm2){
ai1 = parm1;
ai2 = parm2;
}
};
class BClass
{
int bi1;
int bi2;
public:
AClass* a;
BClass* b;
BClass(){}
insertValues(int parm1, int parm2){
bi1 = parm1;
bi2 = parm2;
}
};
class CClass
{
int ci1;
int ci2;
public:
BClass* b;
CClass(){}
insertValues(int parm1, int parm2){
ci1 = parm1;
ci2 = parm2;
}
};
Consider a HEAD pointer BClass* BHead and create a doubly linked list
where the forward and backward chain is maintained using BClass
pointers. Each of the nodes in the chain should maintain 10 integer
values. You are free to choose how you distribute 10 integers among
the objects of a node. Plan a distribution and stick to it. You can
choose whether you want to insert new nodes at the beginning of the
list or at the end of the list. Stick to any one.
Write the following functions for the link list:
void insert(int* int10parm);
and
void delete(int* int10parm);
where <int* int10parm> contains 10 integers. Expect the parameter for
delete function to have integers in the same order as for the insert
function.