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.
Memory hierarchy: There is another type of high speed memory, known as Cache memory, which is used to increase the speed of processing by making current programs and data avai
#questioPurpose of this assignment: 1. Using dictionaries. Assignment: Write a program to read a text file and create a dictionary. The keys for the dictionary should be all
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
Suppose there are exactly five packet switches (Figure 4) between a sending host and a receiving host connected by a virtual circuit line (shown as dotted line in figure 4). The tr
There are two kinds of FCB, the normal, whose length is 37 bytes and the expanded one of 44 bytes. The FCB is created of data given by the programmer and by data which it takes dir
QUESTION (a) Distinguish between passive and active attacks. (b) Give two reasons why it is important to organise security awareness programs for users. (c) Explain how s
• A set of process is in a deadlock state if each process in the group is waiting for an event that can be caused by only another process in the set. In other words, each member of
Overview of a Computer System There are three major elements in every computer solution. They are: Data Hardware Software Hardware + Softwa
Artificial Intelligence Agents: We discussed what we will be talking about in Artificial Intelligence and why those things are important. This chapter is all about how we wi
Write an Assembly program that reads an integer (-32,768 through 32,767) in decimal and prints its equivalent in binary. The output must show all 16 bits. And you must use a loop
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