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 are bit fields? What is the use of bit fields in a structure declaration?

1 Answers   Flextronics, TISL, Virtusa,


What are pointers? What are different types of pointers?

0 Answers   Fidelity,


What are near, far and huge pointers?

1 Answers   Hexaware, Thomson Reuters, Virtusa,


What is an lvalue and an rvalue?

1 Answers  


Is javascript based on c?

1 Answers  


code for quick sort?

1 Answers  


What are type modifiers in c?

1 Answers  


difference between function & structure

9 Answers   Verizon,


Write a function that accepts a sentence as a parameter, and returns the same with each of its words reversed. The returned sentence should have 1 blank space between each pair of words. Demonstrate the usage of this function from a main program. Example: Parameter: “jack and jill went up a hill” Return Value: “kcaj dna llij tnew pu a llih”

5 Answers   Mind Tree,


What is binary tree in c?

1 Answers  


Explain what is page thrashing?

1 Answers  


What is the right type to use for boolean values in c? Is there a standard type?

1 Answers  


Categories