Question: 3. Test your code with the following script. What is the approximate slope of the line? may use polyfit. diele.2. (1:8): %test dimensions, start with
3. Test your code with the following script. What is the approximate slope of the line? may use polyfit. diele.2. (1:8): %test dimensions, start with smaller dimensions cpu zeros(length(din),1); Xfor store CPU times for k=1:length(dam) tic Xutart tining xerand (din(k), 1): Xrandom vector yesort(): call your sorting algorithm po(k) toc measure CPU time in seconds loglog(dis,cpu,lo) Xplot CPU tine growth, in log-log scale 3. Test your code with the following script. What is the approximate slope of the line? may use polyfit. diele.2. (1:8): %test dimensions, start with smaller dimensions cpu zeros(length(din),1); Xfor store CPU times for k=1:length(dam) tic Xutart tining xerand (din(k), 1): Xrandom vector yesort(): call your sorting algorithm po(k) toc measure CPU time in seconds loglog(dis,cpu,lo) Xplot CPU tine growth, in log-log scale
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
