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 || operator and how does it function in a program?
There is a practice in coding to keep some code blocks in comment symbols than delete it when debugging. How this affect when debugging?
Why is c fast?
5 Write an Algorithm to find the maximum and minimum items in a set of ānā element.
Is null equal to 0 in sql?
What is the difference between array and pointer in c?
What is line in c preprocessor?
What is a stream in c programming?
explain how do you use macro?
What is a struct c#?
What does c in a circle mean?
Is null always equal to 0(zero)?
What is a far pointer in c?
I need a help with a program: Write a C program that uses data input in determining the whole of points A and a whole of circles B. Find two points in A so that the line which passes through them, cut through the maximum number of circles.
Write a program to swap two numbers without using third variable in c?