Wednesday, October 20, 2004

Many Solutions

So last week I wrote a blog entry that mentioned an assignment that we had been asked to write in our CS class. I was so pleased by my answer, I was even proud of it. So proud of it, that I posted it here on the web so that you could see it in its glory. Well, as with all assignments in that class, the professor also writes code for the assignment and posts it for us to look at it after we have finished our solutions. All I can say is that comparing his solution to mine was a humbling experience. His approach to the exact same problem was SO MUCH MORE ELEGANT than mine. I guess that is why he is the Phd. I hope someday that elegant, efficient, and beautiful code will fall out of my fingertips like that. Needless to say, I needed to spend some time re-arranging my class files so that I could make this week's assignment work the way that it "should". Maybe later I will post it.

The interesting stuff today was found in collecting metrics on the contains() function in the java collections framework. In class we have discussed the theory behind ArrayList, LinkedList, TreeSet, and HashSet, but we didn't ever do any hard comparisons until today. Processing an input file with 100,000 records, and calling the contains() method 50,000 times you really begin to see some dramatic results. It was some fun computer science. There are still two problems that I need to attack on this weeks programming assignment. One dealing with recursion and palindromes, another with algorithm complexity. Learning is fun, but it takes time.

Preparation for my ODE test next week still continues, and I didn't work on Discrete Math today, but I must face it in the morning tomorrow.

No comments: