Arrays: Designed By: Harendra Singh Dhaila, Jaycees Public School, Rudrapur, Uttrakhand
Arrays: Designed By: Harendra Singh Dhaila, Jaycees Public School, Rudrapur, Uttrakhand
Designed By: Harendra Singh Dhaila, Jaycees Public School, Rudrapur, Uttrakhand
Definition
Array is a collection of variables of same data type with a common name.
Types of Arrays
One Dimensional Arrays
Declaration of Array
One Dimensional Arrays
int A[10]; float B[20]; char C[20];
Y X
Address of Location Y
In Row Major : 1018
Where B=Base address of the array n = Total column of the array i = Row number of desired row j = Column number of desired row
Where B=Base address of the array m = Total rows of the array i = Row number of desired row j = Column number of desired row
Sorting
Arranging number in order (either ascending or descending) is called sorting.
TYPES OF SORTING Selection Sort Bubble Sort Insertion Sort