To sort an array of integer's with recursive functions ?
Managed C++/CLI
3
Posts
2
Posters
11
Views
1
Watching
-
i have tried it but it doen't work. It would be great if you could point out my mistake and better if correct it.
#include #include int inc_order(int num[], int count, int i);
int compare(int hole, int value, int num[]);int main(){
int num[50], n, count, j, i=0;printf("Number of integers: \\t"); scanf("%d", &count); printf("\\nEnter your integers: \\n"); for(n=0; nvalue){ num\[hole\] = num\[hole-1\]; hole--; } compare(hole, value, num);
}
-
i have tried it but it doen't work. It would be great if you could point out my mistake and better if correct it.
#include #include int inc_order(int num[], int count, int i);
int compare(int hole, int value, int num[]);int main(){
int num[50], n, count, j, i=0;printf("Number of integers: \\t"); scanf("%d", &count); printf("\\nEnter your integers: \\n"); for(n=0; nvalue){ num\[hole\] = num\[hole-1\]; hole--; } compare(hole, value, num);
}
That is not a proper task for recursion.
-
That is not a proper task for recursion.