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
hi folks i m approching for h1 b interview on monday 8th of august at montreal and i m having little problem in my approval notice abt my bithdate my employer has made a mistake while applying it is 12th january and istead of that he had done 18 the of january do any body have any solution for that if yes how can i prove my visa officer abt my real birthdate it urgent please let me know guys thaks dipesh patel
Differentiate call by value and call by reference?
What does sizeof return c?
Write a function that will take in a phone number and output all possible alphabetical combinations
How will you print TATA alone from TATA POWER using string copy and concate commands in C?
Is c object oriented?
What are the types of unary operators?
A collection of functions,calls,subroutines or other data a) library b) header files c) set of files d) textfiles
is it possible to create your own header files?
What is the return type of sizeof?
What language is lisp written in?
What is sizeof array in c?
Explain the advantages of using macro in c language?
What are the advantages of external class?
What is the deal on sprintf_s return value?