diff --git a/Ex_3/Algorithme.java b/Ex_3/Algorithme.java index 589ecd6..9d9491e 100644 --- a/Ex_3/Algorithme.java +++ b/Ex_3/Algorithme.java @@ -2,6 +2,7 @@ import java.util.*; import java.util.stream.Collectors; public class Algorithme { + // O(n²m+nm²) public static void Algo(int[][] a) { if (a == null) throw new IllegalArgumentException("Tableau null"); int n = a.length; @@ -26,6 +27,7 @@ public class Algorithme { for (int i = 0; i < n; i++) selection(a[i]); } + // O(n²) public static void selection(int[] arr) { int n = arr.length; for (int i = 0; i < n - 1; i++) { @@ -39,12 +41,14 @@ public class Algorithme { } } + // O(n) public static int sum(int[] arr) { int s = 0; for (int x : arr) s += x; return s; } + // O(n²m+nm²) public static void main(String[] args) { int[][] t = { {0, 3, 2},