import java.util.*;
import java.lang.*;
import java.io.*;

class Main {
    public static boolean exists(int[] ints, int k){
        System.err.println("--Recherche d'un entier dans un tableau--");
        int result = Arrays.binarySearch(ints,k); // recherche dichotomique
        return result >= 0;
    }
    
    public static void main(String[] args) {
        System.out.println(exists(new int[]{0,8,24,100,-2},8));
    }
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: