We investigate the behavior of an unknown program. Different parts of ... - Question | Learnok.com

We investigate the behavior of an unknown program. Different parts of program ar ...

We investigate the behavior of an unknown program. Different parts of program are written in different programming languages and source codes aren't equipped with any comments. We have found that one of the most important and more often executable code part is the following for (j=0;  j<K; j=j+1)      run_dlx(); where K is given as a fixed (integer) parameter. The procedure run_dlx() is an external procedure which can't provide any parameters when called, but only a start signal. Default value of K is 10. For K=10 the program running time is 6.534 seconds. When we changed K=20, the running time was 41.32 seconds. When we changed K=30, it seemed us that program does not finish its work at all and we terminated it. Therefore, we tested for K=25, for which the running time was 18 minutes and 41 seconds. For K=0 the running time was 6.5 seconds. Finally, we decided to test once more for K=30 and decided to wait more patiently a little bit longer - the running time was 9 hours and 54 minutes.  To be sure of the results we obtained, we decided to repeat all the experiments - for all K values 0, 10, 20, 25 and 30. In all cases we got the same results (running times) as for previous trials. Tasks:  1. Please explain, what might be the reason that for high K values the program running time is extremely long. 2. Please explain, what we can conclude about the behavior and features of procedure run_dlx() having the above-mentioned testing data. 3. Try to evaluate program running time for K=40 and K=50 and additionally for K=15.
Price $ 5.00

Answers to advanced questions are only visible to original posters.

We have mentors from

  • Suffolk University Boston
  • University of California, Los Angeles
  • New York University
Contact support