Freelists and Linked Lists Java

Gamingphreek

Lifer
Mar 31, 2003
11,679
0
81
Hey Guys,

In my textbook, I have an example of a Linked List class implementation with freelist extensions.

I think, since my professor wrote this book, something is messed up. Nothing is successfully getting store in the linked list from what I can tell when I try and mess around with the code.

If I send the code via PM or E-Mail, does anyone have time to look at the code and tell confirm whether or not it works. I have spent hours on my portion of the code and, as far as I can tell, his code is completely messed up to the point that I want to write my own linked list class.

-Kevin
 

Gamingphreek

Lifer
Mar 31, 2003
11,679
0
81
Nevermind - it was definitely his code. I found the error and fixed it. Why is it that whenever I use the code from the book instead of my own (We were allowed to do either) I always regret it?

Thanks,
-Kevin
 

degibson

Golden Member
Mar 21, 2008
1,389
0
0
Originally posted by: Gamingphreek
Nevermind - it was definitely his code. I found the error and fixed it. Why is it that whenever I use the code from the book instead of my own (We were allowed to do either) I always regret it?

Thanks,
-Kevin

A lot of professors haven't written any meaningful code in years.
 

L337Llama

Senior member
Mar 30, 2003
358
0
0
i'd recommend adding a function to llist that lets you deallocate the whole llist onto the freelist.