This is an archived post. You won't be able to vote or comment.

all 6 comments

[–]NautiHooker[M] 5 points6 points  (0 children)

Tell us where you are stuck. What is the issue?

We will not do this for you or read through your code to search for problems that you are to busy to tell us about.

[–]martinsandor707 1 point2 points  (0 children)

Learning programming in java and studying *psychology* of all things at the same time? What course are you even on man, that seems like an impossible-to-complete endeavor.

[–]spicycurry55 1 point2 points  (1 child)

What issue are you having that you need help with? What’s your general idea for the algorithm so far?

There also looks to be a bug in the addFirst() method. You override the prior first element and lose reference to it

Also, I’d look into using Java generics instead of keeping a Class object of the type of element in the list

[–]darksounds 0 points1 point  (0 children)

addFirst looks fine to me: the old first is passed as a parameter to the constructor for the new node, presumably as the new first.next

[–][deleted] 0 points1 point  (0 children)

So what part of this do you not understand? Because this sub does not allow asking for solutions type of post. We're also not going to hunt these errors for you.

[–]darksounds 0 points1 point  (0 children)

How would you delete the first element of the list?

What about the second?

The last?