how to impliment 2 or more stacks in a single dimensional
array ?

Answer Posted / sakthigurunathan

to implement two stacks in a single array consider two
stacks growing towards each other and take tos1=-1
andtos2=max as empty condition and for full condition take
tos1=tos2-1 and to insert take push1 tos1++
and for push2 tos--

Is This Answer Correct ?    36 Yes 9 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

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

863


What is a good way to implement complex numbers in c?

815


What are the differences between new and malloc in C?

832


Want to know how to write a C program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the total number of disk writes by MySQL.

1773


Write an algorithm for implementing insertion and deletion operations in a singly linked list using arrays ?

3280


What is sorting in c plus plus?

755


What is null pointer constant?

807


1234554321 1234 4321 123 321 12 21 1 1 12 21 123 321 1234 4321 1234554321

3453


What are logical errors and how does it differ from syntax errors?

940


write a program to convert a expression in polish notation(postfix) to inline(normal) something like make 723+* (2+3) x 7 (not sure) just check out its mainly printing expression in postfix form to infix.

3750


Describe dynamic data structure in c programming language?

838


Explain what will the preprocessor do for a program?

816


Write a program to show the change in position of a cursor using c

840


what is different between auto and local static? why should we use local static?

890


How can I open files mentioned on the command line, and parse option flags?

836