From c15bde258ff864453002d8315119a61677fb9b6c Mon Sep 17 00:00:00 2001 From: ducreux Date: Wed, 15 Oct 2025 11:45:46 +0200 Subject: [PATCH] =?UTF-8?q?complexit=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Ex_3/Algorithme.java | 4 ++++ 1 file changed, 4 insertions(+) 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},