Consider the following chain of 4 matrices
A1−A4
A1→2×3
A2→3×5
A3→5×4
A4→4×2
The following table M[4,4] is filled up using Bottom-up dynamic programming to find the number of multiplications to multiply the above 4 matrices:
The correct values of P & Q are