1.1 KiB
1.1 KiB
Fundamental Data Structures
- information to be processed: abstraction of some part of the real world
- computer has a selected set of data about the real world
- this data is an abstraction:
- certain properties/characteristics of the real world are ignored because they are considered peripheral to the problem
- therefore represents a simplification of facts
- problem solving: defining the set of characteristics relevant to the problem
- the choice of representation may involve several levels of detail:
consider deciding the position of an object.
- polar v. cartesian coordinates (and selection of origin)
- floating point v. integer representation of coordinates
The concept of data type
- in maths, we have different types: whole, integer, rational, etc...
- principle: every constant, variable, expression, or function is of a certain data type
- adherence to this means the compiler can check constructs for legality and compatibility
- programming languages provide base data types, which can be extended by the programmer
- cardinality: the number of distinct values belonging to some type T