Functional Data Structures in R by Thomas Mailund

Functional Data Structures in R by Thomas Mailund

Author:Thomas Mailund
Language: eng
Format: epub, pdf
Publisher: Apress, Berkeley, CA


Front: lazy_thunk(

cons(1, cons(2, cons(3, nil)))

)

Back: nil

At this point, the entire back list has been reversed and appended to the front queue, and from here on we can just dequeue the elements. The first dequeuing gets rid of the thunk as well as the first element:

q < dequeue(q)

Front: cons(2, cons(3, nil))

Back: nil

Other dequeue operations are now straightforward.

Let us go back to the empty list and insert six elements:

q <- empty_lazy_queue()

for (x in 1:6)

q <- enqueue(q, x)



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.