diff --git a/searching/LinearSearch.c b/searching/LinearSearch.c index 23da2c8f..6a3eabbd 100644 --- a/searching/LinearSearch.c +++ b/searching/LinearSearch.c @@ -16,7 +16,7 @@ void main(){ int a[s]; printf("Enter the contents for an array of size %d:\n", s); - for (i = 0; i < s; i++) scanf("%d", &a[i]); + for (i = 0; i < s; i++) scanf("%d", &a[i]);// accepts the values of array elements until the loop terminates// printf("Enter the value to be searched:\n"); scanf("%d", &v); diff --git a/sorting/mergesort.c b/sorting/mergesort.c index bbe0ffe8..6533713f 100644 --- a/sorting/mergesort.c +++ b/sorting/mergesort.c @@ -1,6 +1,6 @@ #include -void swap (int *a,int *b) +void swap (int *a,int *b)//To swap the variables// { int t; t= *a; @@ -9,7 +9,7 @@ void swap (int *a,int *b) } -void merge(int a[],int l,int r,int n) +void merge(int a[],int l,int r,int n)//To merge // { int *b = (int*)malloc(n*sizeof(int)); int c=l; int p1,p2; @@ -64,7 +64,7 @@ void mergesort(int a[],int n,int l,int r) } } -int main(void) { +int main(void) { //main function// int *a,n,i; scanf("%d",&n); a = (int*)malloc(n*sizeof(int));