Professional Documents
Culture Documents
Research Faisalabad
Task#2
Write a function to display an array.
C Function:
void printArray(int* array, int arraySize)
{
int i;
printf("Array: ");
Task#4
Write a function for selection sort of an array.
C Function:
void selection_sort(int *array, int n)
{
int i, j, pos, swap;
Task#5
Write a function for insertion sort of an array.
C Function:
void insertion_sort(int *array, int n)
{
int i, j, temp;
Conclusion:
In this lab, I came to know the different sorting techniques and their use in
different arrays. The sorting techniques are as follows: Bubble, Insertion, Selection sort.