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


Please Help Members By Posting Answers For Below Questions

how to execute a program using if else condition and the output should enter number and the number is odd only...

1640


Why is %d used in c?

551


program to find out date after adding 31 days to a date in the month of febraury also consider the leap year

2557


What is keyword in c?

582


I have written a pro*C program to fetch data from the cursor. where in i have used the concept of BULK FETCH.... each FETCH statement is taking lots of time to fetch specified number of rows at...

9642






What are the advantages of c preprocessor?

694


Why can arithmetic operations not be performed on void pointers?

581


Why is main function so important?

602


Is a house a shell structure?

683


How can I find the modification date and time of a file?

590


Why dont c comments nest?

607


What is difference between Structure and Unions?

626


Subtract Two Number Without Using Subtraction Operator

343


Why c is procedure oriented?

556


the constant value in the case label is followed by a a) semicolon b) colon c) braces d) none of the above

709