These are some sample problems for the final. Some are closely based on problems that are actually on the final, others test issues that I think it is important for you to consider. As you might guess, there will be problems on the final that cover topics other than those given here and that have different forms than those given here.
Write a regular expression for comments in C. In C, a comment begins
with /*
and ends with */
. A comment cannot
contain */
although it may contain another /*
.
Write two classes, Alpha
and Beta
such that
the main()
routine of Alpha
generates the
code for Beta
and vice versa. Neither program should
read the source code of the other.
I will not tell you how to do this sample problem. If you did the appropriate homework, it should be trivial.
Using your input and output classes, sketch a program that one might use to format tables. The input to your program should be a file that contains:
Part of your goal in this problem is to determine a useful way to represent the form of the input.
Consider the documentation that Sun supplies for class XXXX. How is this documentation ambigious? What else is wrong with the documentation? How might you improve it?
Suppose you've written a series of profiling classes, including
AddProfCommands
which adds profiling commands to a
a Java program, storing the results in a new file.
These profiling commands will be used to write profiling data to the file
profile.data
when the updated class
is compiled and executed.
You would execute this class with
java AddProfCommands original updated
InsertProfData
,
which inserts profiling data into a original file, putting the results
into a separate file. You would execute this class with
java InsertProfData original data result
Profiler
, which provides the commands that
AddProfCommands
uses.
Assume that you wish to profile the class Alpha
and that
you may need to modify not just Alpha.java
but also your
profiling classes.
Write a makefile that can be used to automatically generate
Alpha.prof
, a profiled (with annotations as to number
of executions) version of Alpha.java
.
During class discussions, we came up with a number of benefits for using associative arrays, primarily in making it easier to do input, output, and debugging based on human-readable values. We also suggested that it might be possible to use normal arrays instead and "encode" each piece of text with a number.
An interesting problem one often encounters in dealing with graphs is that of finding the minimum spanning tree (MST) of a nonnegatively weighted graph. The MST is a subgraph spans the graph in that it is possible to find a path between any two nodes in the graph using only edges in the MST. The MST is the smallest such subgraph.
Many people criticize the Microsoft Word HTML generation facility for being insufficiently general and failing to accomodate the needs of hypertext authors. For example, one might want to automatically split a Word document into separate nodes, one per section. Suggest how you might design a more appropriate translation scheme for word. Make sure that your answer describes features, presentation of those features, and process by which you would validate your design.
Upon implementing a variety of sorting algorithms in Java, you discover that they run significantly slower on our HP's than do corresponding versions written in Basic on old 80286s. Of particular concern is your quick sort routine.
Describe a process by which you might identify potential reasons for this slowness and improve the speed of your sorting routine.
Disclaimer Often, these pages were created "on the fly" with little, if any, proofreading. Any or all of the information on the pages may be incorrect. Please contact me if you notice errors.
Source text last modified Mon Dec 8 12:31:17 1997.
This page generated on Mon Dec 8 12:33:01 1997 by SiteWeaver.
Contact our webmaster at rebelsky@math.grin.edu