Re: Adding to the end of a list



Dear Brian,

Brian Hulley wrote:
>
> Anders Lindén wrote:
> > (Just like you add to a list in the beginning with [A|List]?
>
> No - [A|List] is a new list whose head is A and whose tail is List
> (nothing is added to List)

That depends upon your definition of 'add'. E. g., if you add 1 to 2 you
get 3. However, 2 remains the same, it does not become 3 when you add 1
to it. Similarly, when you add Head to Tail to get [Head | Tail], Tail
remains the same.

Best regards,

Bill
.



Relevant Pages

  • Re: Python Doc Problem Example: os.path.split
    ... I was working on a program where i needed to split a path into dirname, ... > Split the pathname path into a pair, (head, tail) where tail is the ... > last pathname component and head is everything leading up to that. ... > tail part will never contain a slash; if path ends in a slash, ...
    (comp.unix.programmer)
  • Re: Using a link list over an array.
    ... compile (p->data is a void *) so you have not shown us some key ... int cmp ... head = list_sort; ... list_type *tail; ...
    (comp.lang.c)
  • HELP for doubly linked list
    ... forward and one pointing backwards. ... You must be able to insert a new node at the head of the ... You must be able to insert a new node at the tail of the ... tail, F – display contents forward, B – display contents backwards, ...
    (microsoft.public.dotnet.languages.vc)
  • HELP for doubly linked list
    ... forward and one pointing backwards. ... You must be able to insert a new node at the head of the ... You must be able to insert a new node at the tail of the ... tail, F – display contents forward, B – display contents backwards, ...
    (microsoft.public.dotnet.languages.vc)
  • Re: Linked List
    ... pete wrote: ... int main ... head = tail = NULL; ... head = list_sort; ...
    (comp.lang.c)