Logo

Programming-Idioms

  • Kotlin
  • Java
items.add(0, x);

items implements List<E>. Complexity depends on list implementation.
(def items2 (conj items x))

conj take a list and an item, in that order, and appends the item to the list at the front.

New implementation...
< >
programming-idioms.org