When we do l1 @ l2
, it is O(length(l1))
because we have to go through l1 and connect l1 and l2.
So my question is that why the implementation does not maintain a last_element
pointer?
I ask this because I want to learn/understand the decision making process of OCaml
's standard library implementation.