Array

 An array is a collection of similar data elements stored at contiguous memory locations. It is the simplest data structure where each data element can be accessed directly by only using its index number.

For instance, if we want to store the marks scored by a student in 5 subjects, then there’s no need to define individual variables for each subject. Rather, we can define an array which will store the data elements at contiguous memory locations.

· array marks[5] defines the marks scored by a student in 5 different subjects where each subject marks are located at a particular location in the array i.e. marks[0] denotes the marks scored in first subject, marks[1] denotes the marks scored in 2nd subject and so on.



Comments

Popular posts from this blog

Asymptotic notations