1. The document discusses algorithms for solving problems related to stacks and queues. It contains 4 questions asking to write algorithms to: find the sum of all elements in a stack; count the frequency of a value in a stack; convert the frequency counting algorithm to a program; and find the sum of even numbers in a queue.
1. The document discusses algorithms for solving problems related to stacks and queues. It contains 4 questions asking to write algorithms to: find the sum of all elements in a stack; count the frequency of a value in a stack; convert the frequency counting algorithm to a program; and find the sum of even numbers in a queue.
1. The document discusses algorithms for solving problems related to stacks and queues. It contains 4 questions asking to write algorithms to: find the sum of all elements in a stack; count the frequency of a value in a stack; convert the frequency counting algorithm to a program; and find the sum of even numbers in a queue.
Problem Solving in Computing (Stacks and Queues) 1- Assume that we want to find the sum of all elements in a stack of length 10. Write and algorithm to find that sum? 2- Assume that we have a stack of length 10. The stack contains integer numbers. Write an algorithm to count the frequency of the value 3 in this stack. 3- Covert algorithm in question 2 into a program using C++ or Java. 4- A queue of length 20 contains 20 even and odd numbers. Write an algorithm to find the sum of those even numbers in that queue.