Uploaded by Prophecy Kachingwe

Assignment ADP

advertisement
Assignment questions for ALGORITHMIC AND DESIGN AND PROBLEM.
Due date: 26th April 2020.
1. Find the address of each element in 5*4 matrix. Base address is 300.size of an element is 8. Use row
major mapping and column major mapping.
2. Convert the following infix expression to postfix.
((A+B) + (B-C)/(C*D))
3. In a table 35 number of plates are stacked. Mr. A came and took 5 plates and put 2 plates back. Mr. B
came and took 25 plates and put 5 plates back. Mr. C came and took 12 plates and put 1 plates back. Mr.
A came again to look for 2 plates. Use the appropriate data structure to solve the problem. Show the
data structure in each step. Explain the scenario.
3. Use the appropriate algorithm to solve the following problem. Given: 3 poles P, Q, R. 6 set of discs are
in pole P. Move all the discs from pole P to R.
4. Three patients were waiting in the hospital for the doctor to get treatment. The first two in the front
decided to go to another hospital. As soon as they left three more patients came. The waiting time was
too much. So the patient who was in the 2nd place in the front left. One more patient came. After 5
minutes a patient came in with a kid who injured in his leg.20 minutes later the doctor came in. Explain
the scenario with suitable data structure.
5. Convert the following infix expression to prefix expression.
(P-Q+ (F*G)/ (T/H))
6. Evaluate the postfix notation.
P: 18, 77, 19, +,*, 76, 45,-, +
7. Evaluate the prefix notation
P: *, +,-, 56, 78, -, 67, 98, 54
Download