how to impliment 2 or more stacks in a single dimensional
array ?

Answer Posted / sakthigurunathan

to implement two stacks in a single array consider two
stacks growing towards each other and take tos1=-1
andtos2=max as empty condition and for full condition take
tos1=tos2-1 and to insert take push1 tos1++
and for push2 tos--

Is This Answer Correct ?    36 Yes 9 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is class and object in c?

591


Do pointers take up memory?

660


Lists the benefits of c programming language?

599


Is null always defined as 0(zero)?

616


a=10;b= 5;c=3;d=3; if(a printf(%d %d %d %d a,b,c,d) else printf("%d %d %d %d a,b,c,d);

646






Explain how do you sort filenames in a directory?

609


Is c pass by value or reference?

596


What is typedf?

671


Create a simple code fragment that will swap the values of two variables num1 and num2.

814


If i have an array 0 to 99 i.e,(Size 100) I place the values 1 to 100 randomly like a[0]=29,a[1]=56 upto array[99].. the values are only between 1 to 100. getting the array values by using scanf.. If i entered one wrong element value line a[56]=108. how can i find it.. and also how to find the missing value in 1 to 100.. and i want to replace the missing values.. any one of them know please post your answer..

1595


What does the && operator do in a program code?

698


why return type of main is not necessary in linux

1707


What is the best way of making my program efficient?

572


What is pragma c?

616


 write a program that will open the file, count the number of occurences of each word in the the complete works of shakespeare.  You will then tabulate this information in another file.

1731