You don't have to move or free pointers, fragmenting your heap.
- From: Jeff☠Relf <Jeff_Relf@xxxxxxxxx>
- Date: 27 Sep 2007 08:30:08 GMT
Has anyone ever implemented a stack using a linked list ?
Who, exactly, thinks linked-lists are faster and/or better ?
I've spent years coding ( for money ) in FORTH and PostScript,
so I'm quite familiar with indexing into the array that is the stack.
In VC++ 8.0, every local variable is
an index into “ the array that is the stack ”,
not a journey down a linked list, not a thread.
Only one end of a stack is dynamic.
You don't have to move or free pointers, fragmenting your heap;
instead, you can create dedicated heaps and destroy them.
With a dynamic array of pointers ( instead of a linked list )
you can do things like: copy-off a chunck of pointers,
quick-sort it any way you like and do binary searches on it.
Try doing that with linked lists !
.
- Follow-Ups:
- Re: You don't have to move or free pointers, fragmenting your heap.
- From: Ben Voigt [C++ MVP]
- Re: You don't have to move or free pointers, fragmenting your heap.
- References:
- I suggest binary searches not “ linklist.h ”.
- From: Jeff☠Relf
- Re: I suggest binary searches not " linklist.h ".
- From: Ben Voigt [C++ MVP]
- How does a linked-list optimize a stack ?
- From: Jeff☠Relf
- Re: How does a linked-list optimize a stack ?
- From: Tim Roberts
- Linked-lists don't make sense.
- From: Jeff☠Relf
- Re: Linked-lists don't make sense.
- From: Tim Roberts
- I suggest binary searches not “ linklist.h ”.
- Prev by Date: Re: Linked-lists don't make sense.
- Next by Date: convert VC++ code into VB6
- Previous by thread: Re: Linked-lists don't make sense.
- Next by thread: Re: You don't have to move or free pointers, fragmenting your heap.
- Index(es):
Relevant Pages
|