Arcesium Interview question on stack
Anonymous User
1826

Write a code to create a stack. Make it’s push and pop functions. Now you have ten such stacks. Do the following push operations:
Value Stack number
2638 1
382 5
2728 10
There should be single push function for all the ten stacks. You can’t use any conditional statement (like – if else statements) in push function for knowing in which stack you have to push the number, nor you can use any array of objects.

Please help me with this. Any thoughts on this is much appreciated. Thanks.

Comments (4)