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

hw can we delete an internal node of binary search tree the internal node has child node..plz write progarm

1801


What is the size of structure in c?

878


Explain setjmp()?

814


write a programming in c to find the sum of all elements in an array through function.

1899


Why c is called free form language?

739


What does it mean when the linker says that _end is undefined?

842


What are the different types of errors?

811


Can a function be forced to be inline? Also, give a comparison between inline function and the C macro?

856


Is sizeof a keyword in c?

744


What is the significance of an algorithm to C programming?

776


write a program using linked list in which each node consists of following information. Name[30] Branch Rollno Telephone no i) Write the program to add information of students in linked list

2509


What is a wrapper function in c?

812


What is derived datatype in c?

809


What is int main () in c?

835


What is spark map function?

773