Power Point Presentation On-: Array Based Applications in C Language
Power Point Presentation On-: Array Based Applications in C Language
Power Point Presentation On-: Array Based Applications in C Language
Sorting
• Selection Sort
Overview
Array
What is Array?
One-D Array
One-D Array Initialization
Accessing element of array
Searching in Array
• Sequential Search
• Binary Search
Sorting
• Selection Sort
int marks
One-D array Initialization
The process of assigning values to array elements at the time of
array declaration is called array initialization.
Syntax: 70 21 50 42 11
Using Loop:
e.g. int a[5];
for(int i=0;i<5;i++)
{ //Input statement
We can run a for
cin>>a[i]; loop to traverse
the array and any
//Output Statement operation like
insertion or
cout<<a[i]; display.
}
Searching in array
Descending order
43 36 33 25 12
Find mid of the array and sort the elements before mid in
ascending and after mid in descending order .