629 views
1 votes
1 votes

A function fun() defined on stacks of integers satisfies the following properties,fun(∅) = 0 and fun(push (S, r)) = max (fun(S), 0) + r for all stacks S and integers r.If a stack S contains the integers 20, -7, 16, -14, 5, 3, 13 in order from bottom to top,what is fun(S)?

1 Answer

Best answer
4 votes
4 votes

36 is the answer.

selected by

Related questions

0 votes
0 votes
0 answers
1
iarnav asked Sep 26, 2017
303 views
Please explain What is properly balanced parenthesis?Keyword is properly. Kindly give some examples also.
1 votes
1 votes
0 answers
3
Shashank Chavan asked Dec 3, 2015
468 views
Whats is subarray ? Can you explain with example?!