Consider a language that does not have arrays but does have
stacks as a data type.and PUSH POP..are all defined .Show
how a one dimensional array can be implemented by using two
stacks.
Answer Posted / barun
In one stack keep values and in another stack keep index of
array. In other wards a[0] = 10. Then keep in bottom of
stack1 value 10 and in bottom of stack2 0. Both needs to be
synchronized in such implementation. Of course random access
is not possible.
Is This Answer Correct ? | 6 Yes | 2 No |
Post New Answer View All Answers
What is 2 d array in c?
What is the advantage of a random access file?
Is main is user defined function?
Explain how can you check to see whether a symbol is defined?
What is string function in c?
Explain what is meant by high-order and low-order bytes?
An application package has been provided to you without any documents for the following application. The application needs to be tested. How will you proceed?
Why clrscr is used after variable declaration?
How does placing some code lines between the comment symbol help in debugging the code?
c language interview questions & answer
What is the importance of c in your views?
Is printf a keyword?
How does normalization of huge pointer works?
Why n++ execute faster than n+1 ?
What are qualifiers and modifiers c?