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 / gingercpu
One to pop and the other to push. Have to maintain all the
elements. Index converted to the # of push and pop
| Is This Answer Correct ? | 4 Yes | 2 No |
Post New Answer View All Answers
When should a type cast be used?
explain how do you use macro?
What are external variables in c?
What is the size of array float a(10)?
What are the uses of a pointer?
Explain what is the difference between #include and #include 'file' ?
What is a scope resolution operator in c?
What is c language & why it is used?
Can the curly brackets { } be used to enclose a single line of code?
Is there a way to switch on strings?
What are the storage classes in C?
What are the 4 types of programming language?
When should you not use a type cast?
Explain how do you view the path?
Write a program to replace n bits from the position p of the bit representation of an inputted character x with the one's complement. Method invertBit takes 3 parameters x as input character, p as position and n as the number of positions from p. Replace n bits from pth position in 8 bit character x. Then return the characters by inverting the bits.