Ternary search in C
问题 I want to do a ternary search for integers in C ... I have tried it...but it's not working well for particular cases. Please help me to remove the bugs from the following program-- My attempt: #include<stdio.h> #include<conio.h> void tsearch(int *a,int i,int j,int k); main() { int a[30],n,i,k; printf("\nEnter n:"); scanf("%d",&n); printf("\nEnter nos in ascending order:"); for(i=0;i<n;i++) scanf("%d",&a[i]); printf("Enter no to search:"); scanf("%d",&k); tsearch(a,0,n-1,k); getch(); } void