Skip to Main Content
Data Structures Using C, 2nd Edition by Pearson
book

Data Structures Using C, 2nd Edition by Pearson

by A. K. Sharma
May 2024
Intermediate to advanced content levelIntermediate to advanced
521 pages
14h 12m
English
Pearson India
Content preview from Data Structures Using C, 2nd Edition by Pearson
Stacks and Queues 185
{
*Front = (*Front + 1);
*val = pQ[*Front];
return 1;
}
}
void display ( struct proc pQ[], int Front, int Rear)
{
int i;
printf (“\n The contents of queue are:”);
i=Front;
while ( i != Rear)
{
i = i + 1;
printf (“(%s , %d) “, pQ[i].process, pQ[i].priority);
}
}
It may be noted that in order to keep it simple, the priority queue has been implemented as a linear
queue. A sample input is given below:
Enter the process number and its priority to be added P4 7
where ‘P4’ is the name of the process and ‘7’ is its priority.
4.3.4 The Deque
A deque is a queue that allows additions and deletio ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Data Structures Using C

Data Structures Using C

Samir Kumar Bandyopadhyay, Kashi Nath Dey
Intermediate C Programming, 2nd Edition

Intermediate C Programming, 2nd Edition

Yung-Hsiang Lu, George K. Thiruvathukal

Publisher Resources

ISBN: 9781299831582