Derive an algorithm which updates the ith elements from the top of the stack, upgrade this algorithm to calculate the maximum value among the contents of the task. Hence write a java program to implement this task
Mauricejude1
0
Newbie Poster
Recommended Answers
Jump to Postwhat's your question about it?
possible solution I can think of right now is add the values and save to a variable as you push an element or when the stack already has a content, pop
All 2 Replies
zeroliken
79
Nearly a Posting Virtuoso
JamesCherrill
4,733
Most Valuable Poster
Team Colleague
Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.