A command to remove the current element from a linked list but not free the memory would be nice.
*removed_element = RemoveElement(list())
Linked list addition
- tinman
- PureBasic Expert
- Posts: 1102
- Joined: Sat Apr 26, 2003 4:56 pm
- Location: Level 5 of Robot Hell
- Contact:
Linked list addition
If you paint your butt blue and glue the hole shut you just themed your ass but lost the functionality.
(WinXPhSP3 PB5.20b14)
(WinXPhSP3 PB5.20b14)
Wouldn't this create an extra overhead in the checking of a new element in the list?!? Meaning it has to check to see if an element allready was allocated, and then see if it's empty or not..
Come to think of it, it might be solved with an additional field in the list structure called "empty" or something.. just to set to null if it's allocated, but "realeased"...
Come to think of it, it might be solved with an additional field in the list structure called "empty" or something.. just to set to null if it's allocated, but "realeased"...
AMD Athlon XP2400, 512 MB RAM, Hercules 3D Prophet 9600 256MB RAM, WinXP
PIII 800MHz, 320 MB RAM, Nvidia Riva Tnt 2 Mach 64 (32MB), WinXP + Linux
17" iMac, 1.8 GHz G5, 512 MB DDR-RAM, 80 GB HD, 64 MB Geforce FX 5200, SuperDrive, OSX
if a) you keep a pointer telling you where the missing element exist
and b) chenge the pointer of the previouselement to point to the element the "deleted" elemnt point it will have no overhoult at all since that how linked list work they are a pointer to the previous element the structure itself and a pointer to the next element
and b) chenge the pointer of the previouselement to point to the element the "deleted" elemnt point it will have no overhoult at all since that how linked list work they are a pointer to the previous element the structure itself and a pointer to the next element
Christos