Traverse from the beginning of a doubly-linked list to the end, and from the end to the beginning.



See also

 Array
 Associative array: Creation, Iteration
 Collections
 Compound data type
 Doubly-linked list: Definition, Element definition, Element insertion, List Traversal, Element Removal
 Linked list
 Queue: Definition, Usage
 Set
 Singly-linked list: Element definition, Element insertion, List Traversal, Element Removal
 Stack


Dim As Integer i, MiLista()
 
For i = 0 To Int(Rnd * 100)+25
    Redim Preserve MiLista(i)
    MiLista(i) = Rnd * 314
Next
 
'Tour from the beginning 
For i = Lbound(MiLista) To Ubound(MiLista)
    Print MiLista(i)
Next i
 
Print
'Travel from the end 
For i = Ubound(MiLista) To Lbound(MiLista) Step -1
    Print MiLista(i)
Next i
Sleep