Home /
Expert Answers /
Computer Science /
draw-control-flow-diagram-please-hand-drawing-only-q2-solve-the-following-problem-the-following-so-pa275
(Solved): draw control flow diagram PLEASE HAND DRAWING ONLY Q2: Solve the following problem: The following so ...
draw control flow diagram
PLEASE HAND DRAWING ONLY
Q2: Solve the following problem: The following source code returns the longest substring that appears at both the beginning and end of the string without overlapping. For example: sameEnds("abXab") returns "ab". 01 public String sameEnds (String string) 02 int len = string.length (); 03 string fin = "n; 04 string tmp ="n; 05 06 for (int 1?0;1<1 en; 1++ ) 1 07 tmp +- string.charAt (i); 08 Int tmplen = tmp. length (); 09 if (111) 12 return fin; 13 ) Draw the control-flow graph (CFG) of the source code above