Recitation 1
From 6.006: Introduction to Algorithms
Python Lists
Basic list operations:
- indexing
- slicing/copying
- concatenation
- L.append() appends one element
- L.extend() appends elements in a list
- L.reverse()
- L.sort(), in-place sort, vs. sorted(L), new sorted copy
- L.pop() removes last element
- L.pop(x) removes element x
Strings are like lists of chars, but are not mutable.
Document Distance
Overview of the code. See Document Distance.