CS234 Lecture Notes - Dynamic Array, Horse Length
56 views2 pages
4 Feb 2014
School
Department
Course
Professor
Document Summary
L=[4, 5, 1, 1, - 3] L[0] 4: creating lists, access elements in lists, slicing [:] l[:2] [4, 5] L[:] [4, 5, 7, 1, - 3] L [4, 5, 7, c , - 3] l1. L [4, 5, 7, c , - 3] L1 [4, 5, 7, c , - 3] [4, 5, 7, c , - 3, 47] L. append([- 5, 3]) 4, 5, 7, c , - 3, 47, - 5, 3] [4, 5, 7, c , - 3, 47, - 5, 3, 4, 5, 7, 1, - 3] L. insert( 3, 14. 9) [4, 5, 7 , 14. 9, c , - 3, 47, - 5, 3] [4, 5, 7, 1] [4, 5, 1, - 3] *(l1 is a list) (note: l1=[4, 5, 7, 1, - 3] ) (note: l1=[4, 5, 7, 1, - 3] ) How should we implement the matrix adt: 2 dimensional array 2 indices.