Merge pull request #210 from sayoojkz/master

Update LinearSearch.c
This commit is contained in:
Libin Yang 2019-01-29 09:03:46 +08:00 committed by GitHub
commit ffd651dd18
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -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);

View File

@ -1,6 +1,6 @@
#include <stdio.h>
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));