Already have an account? Get multiple benefits of using own account!
Login in your account..!
Remember me
Don't have an account? Create your account in less than a minutes,
Forgot password? how can I recover my password now!
Enter right registered email to receive password!
QUESTION
(a) Give the representation of a queue as an abstract data type.
(b) What is a priority queue? Give two types of priority queues.
(c) The following program does the following:
1. Create a queue, q, consisting of 1 (front), 2, 3, 4 and 5 (rear).
2. Display the contents of q.
3. Remove an item from q and display the content of q.
#include
#define MAXQUEUE 6
#define TRUE 1
#define FALSE 0
struct queue
{
int items[MAXQUEUE];
int front, rear;
};
void initialize();
int empty();
void insert();
int rem();
void output();
int n;
void main()
struct queue q;
int i,E;
initialize(&q);
printf("Enter the number of elements: ");
scanf("%d",&n);
If (n { for(i=0;i { printf("Enter an element: "); scanf("%d",&E); insert(&q,E); } } else { printf("Number of elements must be less than MAXQUEUE.\n"); return; } printf("\nContent of the Queue from Front to Rear: "); output(&q); rem(&q); printf("\nContent of the Queue from Front to Rear: "); output(&q); } Write the functions initialize, empty, insert and rem in C.
for(i=0;i { printf("Enter an element: "); scanf("%d",&E); insert(&q,E); } } else { printf("Number of elements must be less than MAXQUEUE.\n"); return; } printf("\nContent of the Queue from Front to Rear: "); output(&q); rem(&q); printf("\nContent of the Queue from Front to Rear: "); output(&q); } Write the functions initialize, empty, insert and rem in C.
printf("Enter an element: ");
scanf("%d",&E);
insert(&q,E);
}
else
printf("Number of elements must be less than MAXQUEUE.\n");
return;
printf("\nContent of the Queue from Front to Rear: ");
output(&q);
rem(&q);
Write the functions initialize, empty, insert and rem in C.
Question 1 . What is an array? Explain Question 2 . What do you mean by optional arguments? Describe Question 3 . Describe in brief about interfaces Question 4
The divisions which make a macro are: • Declaration of the macro Code of the macro Macro termination directive The assertion of the macro is done the following way: Name Macro [par
Subject Name CIT2193 COMPUTER ARCHITECTURE Topic ASSIGNMENT Due Date 16 March 2012 Name : ……….…………………….……………….. Lecturer : ................................. Intake : ………………….
General Considerations for Search If we can specify the first state, the operators and the goal check for a look for difficulty, then we know where to create, how to move and w
1. The standard way for debuggers to plant breakpoints in a program in RAM (whatever the processor instruction set) is to save the breakpointed instruction and replace it by a jump
File Organization There are three types of file organization used in practice. Let us consider the example of a dictionary. The dictionary contains listing of English wo
Question 1 Define virtualization. Discuss the benefits of virtualization. Discuss the benefits of server virtualization Question 2 What is para virtualization? How para vi
20*2
The instructions of the logic functions are: and not, or and xor. These act on the bits of their operators. To make sure the result of the operations we revolve to the cmp and test
2. Mike sells on the average 15 newspapers per week (Monday – Friday). Find the probability that 2.1 In a given week he will sell all the newspapers [7] 2.2 In a given day he w
Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!
whatsapp: +91-977-207-8620
Phone: +91-977-207-8620
Email: [email protected]
All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd