hi i'm trying to tranform while loop to a recursive function to read the array from left to right and then another version from right to left but i'm just unable ! can i have some idea ?

#define DIM 10
int csTrie(int n, int *tab){
  int i=0;
  return i==(n-1);
void main(){
  int tab[DIM]={2,3,4,6,9};
  int i=0;
  printf("LOGICFOUND:%d\n", csTrie(5, tab));

Pseudo code

loop function (array):
   for each element in array
       if its the one you're looking for exit loop

recursive function (array):
   if the first element is the one you're looking for return it
   return recursive function(array with the first element removed)

ps you don't need to create a new array - just pass a ref to the new "first" element