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



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

Answer / 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

More C Interview Questions

What is maximum size of array in c?

0 Answers  


How do you define CONSTANT in C?

0 Answers   ADP,


Is there anything like an ifdef for typedefs?

0 Answers  


WHAT IS MAXIMUM SIZE OF AN ARRAY IN C LANGUAGE?

8 Answers   Carphone Warehouse, IBM, SAS,


What is enumerated data type in c?

0 Answers  


write a program in c language for the multiplication of two matrices using pointers?

8 Answers   Ignou,


how does a general function , that accepts an array as a parameter, "knows" the size of the array ? How should it define it parameters list ?

0 Answers  


what is diference between return 0 and return NULL??

3 Answers  


write a program to convert a expression in polish notation (postfix) to inline (normal)

0 Answers   Siemens,


what is differnence b/w macro & functions

1 Answers  


How can you dynamically allocate memory in C?

2 Answers  


Tell me what is null pointer in c?

0 Answers  


Categories