Class ArraysUtil

java.lang.Object
org.ddolib.util.ArraysUtil

public class ArraysUtil extends Object
Utility class providing common array-related operations.

Currently, this class provides functionality to shuffle arrays of integers.

  • Constructor Details

    • ArraysUtil

      public ArraysUtil()
  • Method Details

    • shuffle

      public static void shuffle(int[] array)
      Randomly shuffles the elements of the given integer array in place.

      This method implements the Fisher–Yates (Knuth) shuffle algorithm.

      Parameters:
      array - the array of integers to be shuffled
      Throws:
      NullPointerException - if the input array is null