CSc265 -- Exercise 4
DUE: midnight, Thursday 21 November 1996
Your task is to make the encode program execute more efficiently.
You should compile the encode.c to create the program named encode. You can run encode interactively by just entering the command
encodeand then entering the requested information, namely the date of the TV program, the channel, the starting time, and the program duration.
You can also run encode interactively by supplying a filename argument, where the file contains the information about each TV program for which the VCR+ number is desired. The file testdata is an example of such a file.
This version of encode is restricted to programs which
begin on the hour or on the half hour, and have a duration which
is a multiple of 30 minutes, up to a 5 hour maximum.
More information about program usage is provided in the
comments at the start of the encode.c file.
By inspecting the output produced by tcov, you should locate places in the encode program where you can significantly speed up program operation. Use the testdata file (or an even larger file) as input so that you exercise the program as much as possible.
You are to select one function in the program where
a recoding of the function's logic would have the most effect.
You should re-code that function, verify that the new version
of the program is more efficient, and then submit the source
code for your revised program.
% mail -s 'Exercise 4 submission' csc265@gulf < encode.c
As always, you may submit the assignment only once because only the first submission will be graded.