Write the definition of a member function INSERT() for a class QUEUE in C++, to insert an ITEM in a dynamically allocated Queue of items considering the following code is already written as a part of the program.
struct ITEM
{
int INO; char INAME[20];
ITEM *Link;
};
class QUEUE
{
ITEM *R,*F;
public :
QUEUE() {R=NULL;F=NULL;}
void INSERT();
void DELETE();
~QUEUE();
};
void QUEUE::INSERT()
{
ITEM *T = new ITEM;
cin>>T->INO;
gets(T->INAME);
T->Link = NULL;
if(R==NULL)
{
F=T; R=T;
}
else
{
R->Link=T; R=T;
}
}