Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

How do you define CONSTANT in C?

1283


What are derived data types in c?

1091


Why is it important to memset a variable, immediately after allocating memory to it ?

2077


What does the characters “r” and “w” mean when writing programs that will make use of files?

1484


What are dangling pointers in c?

1236


What is string constants?

1150


What happens if header file is included twice?

1152


what are the advantages of a macro over a function?

1146


Explain what is a static function?

1112


How can I generate floating-point random numbers?

1132


What is the function of volatile in c language?

1135


List a few unconditional control statement in c.

988


Explain the difference between getch() and getche() in c?

1000


Tell me with an example the self-referential structure?

1029


Write a program, where i have a grid with many cells, how many paths are possible from one point to other desired points.

1240