Data Structure and
Algorithms
(Arrays)
UKZN
ENEL2DSH2
2016
,Definition
• A list of finite number of homogenous data elements
• Data elements could be
§ Characters
§ Numbers
§ Structures
Note!: After compilation, elements of array are stored in successive
memory location
Exception: User defined higher dimensional arrays
, Array of characters
Note that a single character is stored in one byte of memory
Example
char c;
c = ‘A’;
Strings are therefore an example of array of characters
Algorithms
(Arrays)
UKZN
ENEL2DSH2
2016
,Definition
• A list of finite number of homogenous data elements
• Data elements could be
§ Characters
§ Numbers
§ Structures
Note!: After compilation, elements of array are stored in successive
memory location
Exception: User defined higher dimensional arrays
, Array of characters
Note that a single character is stored in one byte of memory
Example
char c;
c = ‘A’;
Strings are therefore an example of array of characters