/// <summary>
        /// Sort jagged array using bubble sorting by different criteria.
        /// </summary>
        /// <param name="jaggedArray">Jagged array.</param>
        /// <param name="variantForSorting">Delegate.</param>
        public static void BubbleSorting(int[][] jaggedArray, VariantForSorting variantForSorting)
        {
            if (jaggedArray == null)
            {
                throw new ArgumentNullException(nameof(jaggedArray));
            }

            for (int i = 1; i < jaggedArray.Length; i++)
            {
                for (int j = 0; j < jaggedArray.Length - 1; j++)
                {
                    if (variantForSorting.Compare(jaggedArray[j], jaggedArray[j + 1]) > 0)
                    {
                        Swap(ref jaggedArray[j], ref jaggedArray[j + 1]);
                    }
                }
            }
        }
 /// <summary>
 /// Sort jagged array using bubble sorting by different criteria.
 /// </summary>
 /// <param name="array">Jagged array.</param>
 /// <param name="variantForSorting">Delegate.</param>
 public static void BubbleSorting(int[][] array, VariantForSorting variantForSorting)
 {
     BubbleSorting(array, (IComparer)variantForSorting);
 }