INTRODUCTION TO ARRAY
An array is a finite ordered collection of homogeneous(same) data
element which provides random access to the element .
The array element share a common name .
Declaration :- Array
array name
int a[5] size of an array
Datatype
For e.g array of integers a[8]
0 1 2 3 4 5 6 7 8
a 1 2 3 4 5 6 7 8 9
Syntax Of array
int arr[10];
char arr[10];
float arr[5]
 It allows storing collection of information in one organised place .
All elements are stored in continous memory location
The size and type of an array cannot be changed after its compliation , hence
array are called as Static and Structure .
 Applications of Array
1. Array is used to store list of values .
2. Array is used to perform Matrix Operations .
3. Array is used to implement Search Algorithm .
4. Array is used to implement Sorting Algorithm .
5. Array is used to implement Data Structures .
6. Array is also used to implement CPU scheduling Algorithms
Representation of Array
Types of Array
Sorting Concept
Data can be sorted or arranged either in ascending order or in
descending order which is called Sort Order .
Sorting Methods
1. Bubble Sort
2. Insertion Sort
3. Merge Sort
4. Quick Sort
5. Selection Sort
Bubble Sorting
Step 1 :-
13 11 14 15 19 9
11 13 14 15 19 9
11 13 14 15 19 9
11 13 14 15 19 9
11 13 14 15 19 9
11 13 14 15 9 19
Step 5 :-
11 9 13 14 15 19
9 11 13 14 15 19
Hence List is Sorted
9 11 13 14 15 19
C Implementation of Bubble Sort
Output:-
Online website fro running program :-
https://www.onlinegdb.com/online_c_compiler