Suppose you want to implement two stacks (ST1 and ST2) in one array a[N] where the sum of the two stack size should never grow more than N integers. * (6 Points) Write the functions: ST1.pop, ST2.pop(), ST1.push(x) and ST2.push(y) such that you maximize the utilization of the space in the array a[N] for the two stacks ST1 and ST2. Explain you stacks design.
$1 Dual Stack Structure Click to add subtitle ΤΙ T2 N-1 $2
Suppose you want to implement two stacks (ST1 and ST2) in one array a[N] where the sum of the two stack size should neve
-
correctanswer
- Posts: 43759
- Joined: Sat Aug 07, 2021 7:38 am
Suppose you want to implement two stacks (ST1 and ST2) in one array a[N] where the sum of the two stack size should neve
Register for solutions, replies, and use board search function. Answer Happy Forum is an archive of questions covering all technical subjects across the Internet.