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
Write the control statements in C language
Why & is used in scanf in c?
What is self-referential structure in c programming?
What is ambagious result in C? explain with an example.
A text file that contains declarations used by a group of functions,programs,or users a) executable file b) header file c) obj file d) .cfile
Can we replace the struct function in tree syntax with a union?
What is typedef struct in c?
What is pass by value in c?
Is there a built-in function in C that can be used for sorting data?
What header files do I need in order to define the standard library functions I use?
What is #define size in c?
What is static and auto variables in c?
how to introdu5ce my self in serco
Give differences between - new and malloc() , delete and free() ?
Write a program to swap two numbers without using the third variable?