Apply the scientific method to develop and validate a hypothesis about the order of growth of the running time of each of the following two code fragments as a function of n.
String s = "";for (int i = 0; i < n; i ++) if (StdRandom.bernoulli(0.5)) s += "0"; else s += "1";StringBuilder sb = new StringBuilder() ;for (int i = 0; i < n; i++) if (StdRandom.bernoulli(0.5)) sb.append("0"); else sb.append("1");String s = sb.toString();
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.