Thread: LinkedList
View Single Post
Old 12-05-2008, 03:06 PM   #7
Ammorth
I blink, therefore I am.
 
Ammorth's Avatar
 
Join Date: Sep 2006
Posts: 1,812

Submissions (10)

Ammorth is a glorious beacon of light (461)Ammorth is a glorious beacon of light (461)Ammorth is a glorious beacon of light (461)Ammorth is a glorious beacon of light (461)

Default

Quote:
Originally Posted by Anitarf
If that's the issue, then you should have simply added a loopThroughList method that calls a user function (via a function interface or something) for each item on the list. Users shouldn't have to code their own low-level loops.

I never thought of that before. I'll go and add it then.

Quote:
Originally Posted by Anitarf
call list.AddToListBackOf(9, 2) // List contains: 8, 2, 5, 9, -3 Wouldn't 9 be added two spots after the end of the list, not one?
No, it adds the value after the 3rd element (index = 2). Since 5 is the 3rd element, it is added after 5.

Quote:
Originally Posted by Anitarf
You could add the less-or-equal and greater-or-equal search types. Also, that stuff should have a public keyword; either that, or make it a static integer in the struct.

There's too much duplication of code in the search function, you could have just a single loop and then an if/elseif statement inside it.

I'll revise it before the next update

Quote:
Originally Posted by Anitarf
A sort method would be nice to have.

Alright, will do. I'll hopefully implement merge-sort.

edit: at school so when I get home tonight, ill update.

edit2: alright, I have most of the code written, but its going to take awhile to write the handbook that goes with it. Expect an update sometime tomorrow (today, but after I get some sleep).
__________________
Ammorth is offline   Reply With Quote