diff --git a/Algo/CM/Lists.md b/Algo/CM/Lists.md index 88e6e1f..6b9b614 100644 --- a/Algo/CM/Lists.md +++ b/Algo/CM/Lists.md @@ -42,3 +42,13 @@ WITH `first`return the first element of the list (is equivalent to contents) `tail`remove the first element of the list (eg. fl <- tail (li)) `next`return the element after a box (eg. pspt <= next(head(li)))) + +## Array implementation +Let's take a list l = E ; D ; C ; B ; A. An array implementation of the list l will be: + +|1|2|3|4|5| +|:----:|:----:|:----:|:----:|:----:| +|A|B|C|D|E| +|5| + +The first line of the table is the $n^{th}$ place of the element, the second line is all the element of the list, and the third line is the place of the first element of the list (here E is at the $5^{th}$ position).