MENU
Question -

Write a function in C++ to perform insert operation in a dynamic queue containing DVD’s information (represented with the help of an array of structure DVD).



Answer -

/*Function in C++ to perform insert in a dynamic queue is given as*/

struct DVD 
{
long No; // DVD Number 
char Title[20]; // DVD Title 
DVD *Link 
};
void insert(struct DVD *start, char data[20] ) ;
{
DVD *q, *temp;
// Dynamic memory has been allocated for a node
temp=(DVD*)malloc(size of (DVD)); 
temp=Title[20]=data[20] ; 
temp"Next=NULL;
if (start    =    = NULL) /*Element
inserted at end*/
while (q"Next ! = NULL)
q=q.Next;
q.Next = temp;

Comment(S)

Show all Coment

Leave a Comment

Free - Previous Years Question Papers
Any questions? Ask us!
×