Topic Wise Solved Problems Question – Computer Sir Ki Class

Login


Lost your password?

Don't have an account ?
Register (It's FREE) ×
  


Shop
siteicon
CPP All :Topicwise Exam Questions: queues siteicon
03D 4

Write the definition of a member function ADDMEM() for a class QUEUE in C++, to add a MEMBER in a dynamically allocated Queue of Members considering the following code is already written as a part of the program.

struct Member
{
  int MNO;
  char MNAME[20];
  Member *Next;
};
class QUEUE
{
  Member *Rear,*Front;
public:
  QUEUE(){Rear=NULL;Front=NULL;}
  void ADDMEM();
  void REMOVEMEM();
  ~QUEUE();
};
CBSE12D-2017

03C-2016 4

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();
};
CBSE12D-2016

03D 4

Write the definition of a member function AddPacket() for a class QUEUE in C++, to remove/delete a Packet from a dynamically allocated QUEUE of Packets considering the following code is already written as a part of the program.

struct Packet
{
  int PID;
  char Address[20];
  Packet *LINK;
};
class QUEUE
{
  Packet *Front, *Rear;
public:
  QUEUE(){Front=NULL;Rear=NULL;}
  void AddPacket();
  void DeletePacket();
  ~QUEUE();
};
CBSE12A-2018

03C 4

Write the definition of a member function DELETE() for a class QUEUE in C++, to remove a product from a dynamically allocated Queue of products considering the following code is already written as a part of the program.

struct PRODUCT
{
  int PID; char PNAME[20];
  PRODUCT *Next;
};
class QUEUE
{
  PRODUCT *R,*F;
public:
  QUEUE(){R=NULL;F=NULL;}
  void INSERT();
  void DELETE();
  ~QUEUE();
};
CBSE12A-2016