mohd hisham said:
Write a C program to construct a queue of integers and to perform the
following operations on it:
a. insert
b. delete
c. display
The program should print appropriate messages for stack overflow and stack
empty.
i hope u guys can help me,for me it is difficult question.
Try to get clarification on what is to be done. I don't think (I hope)
anyone whose native language is English and speaking carefully is likely to
put things quite that way. Insert usually means somewhere in the middle, as
in a linked list. Members added to a queue are added at one end and taken
off at the other end. Members are added to a stack at one end and taken off
at the same end. You can't delete a specified member of a stack. But the
concepts of overflow don't apply to a queue or to a linked list. It is true
you *could* run out of hardware, but that is an aberration, not something a
(neophyte) programmer would handle.
I realize that some people use the word "queue" for a linked list, but I
would never do that. To me a queue should connote a physical queue, as a
line of people waiting for a bus. A linked list is something that doesn't
exist in the real world, it's a programmer's invention. OTOH, a queue does
have a real world manifestation.
So, my synopsis: it's not a stack, it's not a queue, it's not a linked list.
What is it?