Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

I die a little inside

Name: Anonymous 2006-12-28 18:02

Every time someone adds an element to the end of a linked list.

Name: Anonymous 2006-12-28 18:37

Because static arrays rock

Name: Anonymous 2006-12-28 21:38

lulz, enjoy your stack dynamic memory

Name: Anonymous 2006-12-29 5:44 (sage)

I only add elements to the front of my linked lists.

Name: Anonymous 2006-12-29 13:00 (sage)

>>1
I really don't think it matters as long as you don't try to do it with singly linked ones.

Name: Anonymous 2006-12-29 14:24

>>1
not if you keep a pointer to the end of the list.

Name: Anonymous 2006-12-29 14:28

>>6
Hah, right, as if. Did you ever see a professor write code?

Name: Anonymous 2006-12-30 7:07

>>1
That's what happens when you don't keep a head _and_ a tail pointer in your list head.

Name: Anonymous 2006-12-30 11:03 (sage)

>>7
some of us have professors who don't suck.

Name: Anonymous 2006-12-30 13:57

conclusion: op is a failure who thought he knew something, but didn't

Name: Anonymous 2006-12-30 19:00

I didn't understand the OP until I read someone mention "professor", then I was like hahaha oh wow, but then I realized that was totally possible from remembering my professors.

Name: Anonymous 2006-12-30 19:04

I still don't understand the OP...?

Name: Anonymous 2006-12-31 6:58

(define (cons x y)
  (lambda (f) (f x y)))

Name: Anonymous 2006-12-31 7:42

>>13
(define tmp car)
(define car cdr)
(define cdr tmp)

Name: Anonymous 2006-12-31 7:58

>>8
Or you could, y'know, just use a doubly linked list.

Name: Anonymous 2006-12-31 8:47

>>12
Appending to head of linked list == O(1)
Appending to end of linked list == O(n)

Or just use a doubly-linked list.

Name: Anonymous 2006-12-31 8:48 (sage)

>>15
Doesn't help, unless it's also circular.

Name: Anonymous 2006-12-31 9:16

>>17
Use sentinal nodes!

Name: Anonymous 2006-12-31 9:22

Use existing lists you morans! There are 1E+6 implementations of linked lists in the world. Don't add yours; use a proven one.

Name: Anonymous 2006-12-31 16:18

>>19
Please leave, you're clueless.

Name: Anonymous 2006-12-31 18:46 (sage)

>>16
At some point in your code you're going to walk the entire list to get to the end... and anyone in that position would realize that that's retarded, and would immediately add a tail pointer to their implementation, or just insert their shit at the front.

Name: Anonymous 2006-12-31 19:02

>>21
A pointer to the end of the list has no other use besides adding elements to the end.

Name: Anonymous 2006-12-31 20:50 (sage)

>>22
Or accessing or removing from the end. What's your point?

Name: Anonymous 2007-01-01 5:11

>>22
which can be very important sometimes, you're a loosy programmer if you can't adapt the solution to the problem.

Name: Anonymous 2007-01-01 6:16

>>17
Well, obviously.

>>19
Unless you're writing code for an embedded device and don't have access to a large library, and don't want one either, since you have limited RAM...

Name: Anonymous 2009-01-14 14:05

What?

Name: Sgt.Kabu點撷kiman滜 2012-05-28 21:32

Bringing /prog/ back to its people

Don't change these.
Name: Email:
Entire Thread Thread List