ARRAY
As we know an Array is a particular variable that can store multiple values . They store data of the same/ similar types. It is the simplest data structure where each data element can be accessed directly by only using its index number. find the data type (like int ) and specify the name of the array followed by square brackets []. To insert values to it, use a comma-separated list, inside curly braces: int myNumbers[] = {25, 50, 75, 100};.
An arrangement of objects, pictures, or numbers in rows and columns.
What is the syntax of an array?
Declaration Syntax of Array:
int A[10]; Here 10 means, this array A can have 10 integer elements. char B[10]; This array B can have 10 character elements.
Where can arrays be used?
Arrays are used to store lists of related information. Your shopping list (Type = string); for the names of the students in a class (type = string) for the grades for the first exam (type = numbers). Note: Array variables should usually be named with "plural" words. For example: grades, students, words.
Where are arrays used outside of programming?
Arrays are used in many ways practically in real life. There are many array-structured physical devices such as computer screens, televisions and phased-array radar. Image processing such as can be done with Photoshop applies algorithms to arrays representing photo data.
Why do we use arrays for kids?
Arrays can be helpfully used to explore calculations such as 13 x 5 where the array can be split into useful chunks such as 10 and 3. This means that children can use their known number facts to work out calculations.
Applications of Arrays
- Implementation of Stacks and Queues. Arrays can be used to implement stack and queue data structures.
- Implementation of other data structures.
- CPU Scheduling.
- Processing an Image.
- Implementation of complete binary trees.