Home |
Search |
Today's Posts |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Robert,
when I taught data structures in the 1980's I used BBC Basic to demonstrate how a linked list structure could be implemented. A 1-D string array was used to hold the data and a numeric array held the pointers. In addition, a free-space pointer pointed to the next available element of the array. As data was added (in any order) the pointers were adjusted to maintain the correct sequence. If data is deleted then the free space pointer is adjusted, along with the pointer of the element which is removed and the pointer which pointed to that element. It can also be beneficial to have another set of pointers which point back to the previous data item, so that the list can be searched in both directions. I haven't tried to implement this using VBA, but similar approaches could be taken. Hope this helps. Pete On Dec 26, 8:38*pm, "Robert Crandal" wrote: I know I didnt answer the question about a "linked list". *I thought it would be better if I just forget about linked lists because it is an abstract data type that is often implemented in the C/C++ programming language. Basically, a "linked list" is a set of data structures or "nodes" that is in sequence; ie, the list has a beginning (i.e "head") and and an end (i.e "tail"). *Each node contains data, in addition to a "next" pointer which points to the next node in the list. Below is a text/graphical depiction of a linked list with 6 nodes. *H is the head node, T is the tail node, and all the other nodes are marked as N. *Each node has an arrow or pointer which points to the next node. * [H]--[N]--[N]--[N]--[N]--[T] The nice thing about linked lists is that you can make them dynamically grow or shink, by adding or deleting nodes. So, a linked list is ALMOST like an array. *The main difference is that an array size is usually fixed, but a linked list can dynamically grow and new nodes can be inserted anywhere in the middle of the list. Is this really your first experience with linked lists?? "GS" wrote in message ... That's a bit more helpful but doesn't answer my Q about a 'linked list'..- Hide quoted text - - Show quoted text - |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Use VBA to reset data validation (=list) value to first value in that list (list is a named range) | Excel Programming | |||
data validation list: how do i 'force' a user to enter data from the list? | Excel Discussion (Misc queries) | |||
data validation list: how do i 'force' a user to enter data from the list? | Excel Discussion (Misc queries) | |||
How to view a list of data based on another list of data | Excel Discussion (Misc queries) | |||
converting vertical data list to horizontal data list | Excel Worksheet Functions |