Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualKhatharr

Posted 14 December 2012 - 02:41 AM

I dunno if wrapping LL in a class is the best first exercise. You really have to be very comfortable with pointers before you can sling around LL code easily, and they're still error prone.

That being said, the first 2 problems you've mentioned had to do with type awareness, not linked lists.

A linked list (you've probably heard this) is easier to visualize if you draw a picture of a train with a head, a tail and boxcars in-between. If you do this on paper and then draw a new picture for each step in the process it becomes much easier to see what order things need to be done in. (It doesn't have to be a train, just some labelled boxes with arrows between them works too.)

Anyway, don't stress out about this. Take a break or a nap or something and just let it simmer in your subconscious. It really does take time for the brain to adjust to this kind of concept. Eventually it just clicks and you're fine.

As for your most recent error - fire up that debugger. Put a breakpoint at the start of the loop and start walking through it step-by-step until you see a value go bad.

#2Khatharr

Posted 14 December 2012 - 02:36 AM

I dunno if wrapping LL in a class is the best first exercise. You really have to be very comfortable with pointers before you can sling around LL code easily, and they're still error prone.

That being said, the first 2 problems you've mentioned had to do with type awareness, not linked lists.

A linked list (you've probably heard this) is easier to visualize if you draw a picture of a train with a head, a tail and boxcars in-between. If you do this on paper and then draw a new picture for each step in the process it becomes much easier to see what order things need to be done in. (It doesn't have to be a train, just some labelled boxes with arrows between them works too.)

Anyway, don't stress out about this. Take a break or a nap or something and just let it simmer in your subconscious. It really does take time for the brain to adjust to this kind of concept. Eventually it just clicks and you're fine.

#1Khatharr

Posted 14 December 2012 - 02:34 AM

I dunno if wrapping LL in a class is the best first exercise. You really have to be very comfortable with pointers before you can sling around LL code easily, and they're still error prone.

That being said, the first 2 problems you've mentioned had to do with type awareness, not linked lists.

A linked list (you've probably heard this) is easier to visualize if you draw a picture of a train with a head, a tail and boxcars in-between. If you do this on paper and then draw a new picture for each step in the process it becomes much easier to see what order things need to be done in. (It doesn't have to be a train, just some labelled boxes with arrows between them works too.)

PARTNERS