A student implemented the method findArray as follows: int findArray(char [] smallA, char [] largeA) { int savedk,m; for (int k  0; k  largeA.length-smallA.length; k) { savedk  k; for (m  0; m ...

A student implemented the method findArray as follows: int findArray(char [] smallA, char [] largeA) { int savedk,m; for (int k  0; k  largeA.length-smallA.length; k) { savedk  k; for (m  0; m  smallA.length; m) if (smallA[m] ! largeA[savedk]) break; if (m  smallA.length) return k; } return -1; } Draw the flow graph of the method code. Add test cases to A if needed to do branch and statement coverage. Does the above code pass all test cases?. The code includes a logical error that you might or might not have found in your testing, what is it? Which test case can discover it? and if not in your plan, write it. Can you optimize the code?



May 26, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here