MAT 21B Lecture 13: Lecture 13
Lecture 13
Arrays
The case for arrays
Draw backs
- Approach is not scalable
- Doesn’t quiet capture the nature of grades
As algorithms become more complex
- Break down in smaller steps
- Functions can be refined even further
- Hierarchy of function
Data types also form a hierarchy
- Use simple data types to define more complex ones
- As many levels as necessary to represent what the program requires
- Combine independent data value into a single unified collection
- Reduce conceptual complexity
Algorithms +Data structure = Programs
Array definition
- An array groups distinct variable of the same type under a single name
o Definition of array grade
▪ Four distinct elements
▪ Each type int
o Access to each element through a subscript
▪ Index is an integer value
▪ First element at index 0
▪ Last element at index one less than the number of element
- Visual representation
beigecamel74 and 41 others unlocked
83
MAT 21B Full Course Notes
Verified Note
83 documents