Linked List
Posted: Sat May 29, 2004 8:17 am
This may have been asked before, but I would like to store a Linked list in another one, in the aim of being able to use the first one without having mylist(). Err, pseudo code would be easier to understand :
Newlist indexlist()
Newlist myfirstlist()
Newlist mysecondlist()
Newlist mythirdlist()
addelement(indexlist()
indexlist()=myfirstlist()
addelement(indexlist()
indexlist()=mysecondlist()
addelement(indexlist()
indexlist()=mythirdlist()
thethirdlist=selectelement(indexlist(),3)
addelement(thethirdlist)
[...]
the problem is that this code doesnt work, we need to use the original mythirdlist() to add an element to it
Newlist indexlist()
Newlist myfirstlist()
Newlist mysecondlist()
Newlist mythirdlist()
addelement(indexlist()
indexlist()=myfirstlist()
addelement(indexlist()
indexlist()=mysecondlist()
addelement(indexlist()
indexlist()=mythirdlist()
thethirdlist=selectelement(indexlist(),3)
addelement(thethirdlist)
[...]
the problem is that this code doesnt work, we need to use the original mythirdlist() to add an element to it