Sunday, February 12, 2006

CS Agony

I have a ridiculously hard Computer Science midterm tommorow. We are given 50 minutes to solve 6 problems, 2 of which are straightforward computations (but require quite a bit of time, one is a page long fill-in the blanks sheet which requires meticulous analysis of code). The other 4 are harder programming problem. We have to write a program which does a certain task on the spot.
Here's an example of an array problem from the test:


Write a method longestSortedSequence that returns the length of the longest sorted sequence within a list of integers. For example, if a variable called list stores the following sequence of values:
(1,3,5,2,9,7,-3,0,42,308,17)
then the call
list.longestSortedSequence();

would return the value 4 because it is the length of the longest sorted sequence. If the list is empty, your method should return 0. Notice that for a non-empty list the method will always return a value of at least 1 because any individual element constitutes a sorted sequence.

Now, this is pretty hard on its own, but imagine having to do 4 of these with about 35 minutes left on the clock. You basically have only one try to get it right. Oh, and did I mention that an 80% is equivalent to a 2.6? Talk about pressure.

So far, I've gotten about 50% on my physics midterm. We'll see if this test score gets better as my results come back.

No comments: