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

What is || operator and how does it function in a program?

1043


There is a practice in coding to keep some code blocks in comment symbols than delete it when debugging. How this affect when debugging?

1245


Why is c fast?

1012


5 Write an Algorithm to find the maximum and minimum items in a set of ā€˜n’ element.

2045


Is null equal to 0 in sql?

1092


What is the difference between array and pointer in c?

1092


What is line in c preprocessor?

1005


What is a stream in c programming?

1086


explain how do you use macro?

1100


What is a struct c#?

1001


What does c in a circle mean?

1024


Is null always equal to 0(zero)?

993


What is a far pointer in c?

994


I need a help with a program: Write a C program that uses data input in determining the whole of points A and a whole of circles B. Find two points in A so that the line which passes through them, cut through the maximum number of circles.

1894


Write a program to swap two numbers without using third variable in c?

1074