Author: Stan Eisenstat
Subject: Re: [Cs223] Counting calls to addD() and pushD()
Date: Monday, 30 Mar 2020, 07:28:23
> Message Posted By: Unknown > > The public test script counts the number of calls to addD()/pushD() and > the number of deques that are used as stacks and queues. Is there any way > to see these numbers? As far as I can tell, the test scripts don't display > them in the error messages when the tests are failed. As announced earlier, Date: 27 Mar 2020 15:53:53 -0400 (Fri) Subject: Utility for countin compares et al. As an aid to writing an efficient Qsort, I have released a utility based on Tests #303 and #304: % /c/cs223/Hwk4/Tests/Stats.pl /c/cs223/Hwk4/Tests/f007 /c/cs223/Hwk4/Tests/f057 File(s): /c/cs223/Hwk4/Tests/f007 /c/cs223/Hwk4/Tests/f057 #lines = 64 #compares = 351 2*(#compares+#lines) = 830 4*(#compares+#lines) = 1660 #calls to addD() = 201 #calls to pushD() = 609 #calls to remD() = 810 You can specify zero or more files. The output gives the total number of lines in the files, the number of compares used by QsortH, the limits in Tests #303 and #304, and the number of calls to addD(), pushD(), and remD(). To count the number of Deques in use, add code to your createD() and destroyD() to report to stderr wnenever they are called. --Stan-PREV INDEX NEXT