This preview shows page 1. Sign up to view the full content.
Unformatted text preview: f.readline reads one line of the file if you do f.readline it reads first line and if u do f.read after it just reads rest of lines. f.readlines reads every line and returns it as a list. enter is represented by \n Open and close files Lists, aliasing vs. cloning b=a points b to the same copy of the data in a b=a[:] clones the file. Creates a new copy for b that is the same as a. Twodimensional arrays (list within a list) indexing splicing Sorts: merge, bubble, selection, quick, insertion know how a sort will operate on a list Searches: binary and sequential big O measures the amount of work a function does in relation to the number of elements (n) there are in a list bubble O(n 2 ) insertion O(n 2 ) merge O(n log n) selection O(n 2 ) quick O(nlogn) binary O(logn) sequential O(n)...
View
Full
Document
This note was uploaded on 02/16/2012 for the course CS 1301 taught by Professor Staff during the Fall '08 term at Georgia Institute of Technology.
 Fall '08
 Staff

Click to edit the document details