Posts

Showing posts from June, 2022
Image
  Single and Multidimensional array In computer science, an array data structure, or simply an array, is a data structure consisting of a collection of elements (values or variables), each identified by at least one array index or key. An array is stored such that the position of each element can be computed from its index tuple by a mathematical formula. The simplest type of data structure is a linear array, also called a one-dimensional array. An array is used to store a collection of data, but it is often more useful to think of an array as a collection of variables of the same type. Arrays are commonly used in computer programs to organize data so that a related set of values can be easily sorted or searched . Many time programmers need a way to store many variables of the same category or same type, so arrays can be used to store all these variables with a single variable name which is the name of the array. For example, if a programmer wants to store months of the year like ...