October 21, 2007

  • wow it has been six days

    haven't really done much except play games, watch anime and sit.  i am taking the weekend off because of stress from the week and a general lack of sleep.  one thing i have to report is i have finished a programming assignment my professor hasn't assigned yet - we have a midterm next week and he didn't want to burden us with having to think about an assignment and a midterm at the same time.  but since he is covering concepts from the assignment on the midterm he posted the assignment with no due date.  i got to work on it last night and mostly finished it.  i still need to debug, but i probably have almost two weeks to worry about that.

    i also have an assignment due next month that requires implementing a queue.  my professor said it can be done with a stack, but after looking at what was required i realized a queue made with an ArrayList would be much easier to work with.  i have to represent LRU cache replacement, so when i get a hit i move the item to the end of the queue.  with a stack i'd have to pop everything off until i got to the element i hit, then push everything back on.  with an ArrayList i can pull stuff out anywhere i want.  i just reinsert the object after i pull it out.

    also i realize it's more traditional to implement a Queue with a LinkedList, and Java sort of insists i do so since LinkedList implements the Queue interface.  but i like to try new things, and so far it seems like my implementation is working.  i did some rough initial testing after i coded it and all my methods work well.  all it's manipulating is integers, so memory and overhead isn't an issue.

    anyway enough of that i am late for bed.