[[1]]
[1] 1
[[2]]
[1] 2
[[3]]
[1] 3
List (Sequence)
AKA: Sequence, \(a_n\) where n is the nth element, (1,2,3, ….)
Distinct from: Set
Measure of:
Description: A list is a collection of objects with a specific ordering and where the same object can appear more than once. Call each object an element, and its location its index or rank. An index is a natural number counting upward from the first element in the list. Whether counting begins at 0 or 1 depends on local conventions.
Formalization:
Algorithm:
Cites: Wikipedia Wikidata Encyclopedia Of Math Wolfram PlanetMath
Documentation:
list: Lists – Generic and Dotted Pairs
Examples:
Sorting a list in R Sorting or Ordering Vectors
You can specify auto, shell, quick, or radix algorithms. Auto typically chooses radix. Radix applies to lexigraphical data, e.g. string and numbers. Radix has \(O(nw)\) time where \(n\) is the number of keys and \(w\) is the length of the keys.
Fast, stable and scalable true radix sorting
*Radix because it’s fast for R’s use case
*It is stable. Stable sorts preserve the original order of two elements if they are equal by the sorting criteria.
Documentation:
Examples:
The ‘range’ function returns a generator for integers from between start to (stop-1). It’ll do reverse as well but you have to pass a third decrement term. The Python range() Function (Guide)
Python lists have to ways to sort, in palce with “sort” or returning a new list with “sorted”. Sorting HOW TO
Python uses Timsort whose best case is \(O(n)\) and worst and average case are both \(O(nlog(n))\)