Re: Linked lists
From: KiLVaiDeN (KiLVaiDeN_at_CaRaMaiL.CoM)
Date: Fri, 31 Dec 2004 22:20:57 +0100
> "The /\\o//\annabee" wrote...
>Since I at most
> need a list as big as maybe a few hundred, maybe a static list is much
> better, and probably faster too ?
I dont know how you manage your linked list, but the algorithm of deletion
of one item inside the list implies that you move the last element of the
list to the position of that previously deleted item, and that means moving
some pointers to the new moved item position. Otherwise you might have a
list ever growing in size, and I dont think you want that, unless it's
You also need to "nullify" some pointers when you delete an item, those from
the items which were pointing to that item.
Take care not to link 2 items more than once on the same list or it'll be an
endless loop. I dont think you did that, but it's just in case this bug is
in your code, you check for it.
Also why I asked about the null thing in my previous question, is that in
the loop that looks through the list, you need to stop when you found the
object OR when you are in front of a null pointer. If you dont put that last
condition, your program will loop forever. I've seen cmp eax 0 | je L7> in
your loop, is that the test i'm talking about ?
I've worked a lot with linked list and binary trees, though not in ASM, but
if you need help about algorithm, I could help eventually. I suck in ASM
sorry :) can't even read your code properly because it's destroyed by the NG
If my post is useless then no problem hehe I am a bit bored here before
Happy new year to all !