Not a great sort but it is easy to remember. Push everything onto the heap and then pop it back off.
Binary Search
Tail
This will read n lines from the file f. I am pretty sureā¦ I need to double check if it is fully buffering the file.
Moving Average
Smooth out data in time series.
Round Robin
Could probably use this as in deque to implement a circular buffer.
rotate(-1) just shifts elements to the left by one without truncating or pushing elements off the end of the queue. They get requeued on the right if the fall off the left side of the queue.
Efficient Counter
Build a dictionary of lists
Regular expression matching
You generally want to use a compiled regex pattern if you are going to be searching multiple times.
Split() on steroids
You can use re.split() to split on multiple delimiters and regular expression patterns.