how to implement stack work as a queue?

Answer Posted / shruti

it can be done using linked list.
create a linked list as a stack..

while displaying
display reverse. :-)

i can write a code for u if u want..

Is This Answer Correct ?    3 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can I discover how many arguments a function was actually called with?

628


in case any function return float value we must declare a) the function must be declared as 'float' in main() as well b) the function automatically returned float values c) function before declared 'float' keyword d) all the above

587


What is the use of ?

613


How can you increase the size of a dynamically allocated array?

636


What is a loop?

547






What is the process to generate random numbers in c programming language?

601


What does d mean?

572


What is difference between main and void main?

617


What is the difference between declaring a variable and defining a variable?

710


Why should I use standard library functions instead of writing my own?

665


How do you sort filenames in a directory?

699


a number whose only prime factors are 2,3,5, and 7 is call humble number,,write a program to find and display the nth element in this sequence.. sample input : 2,3,4,11,12,13, and 100.. sample output : the 2nd humble number is 2,the 3rd humble number is 3,the 4th humble number is ,the 11th humble number is 12, the 12th humble number is 14, the 13th humble number is 15, the 100th humble number is 450.

4534


What is a spanning Tree?

940


Do you know the difference between malloc() and calloc() function?

601


How can I generate floating-point random numbers?

596