<commit_before>import java.util.Random;
import java.util.Scanner;

import static java.util.Arrays.copyOf;

public class SortingArrays {

	private static int MAX_ALLOWED_NUMBER = 99;

	public static void main(final String[] args) {
		final Scanner input = new Scanner(System.in);

		System.out.print("Array length: ");
		final int[] array = getRandomArray(input.nextInt());

		printArray("Source array", array);
		printArray("Bubble sort", bubbleSort(array));
		printArray("Selection sort", selectionSort(array));
		printArray("Insertion sort", insertionSort(array));
	}


	private static int[] getRandomArray(final int len) {
		final Random rand = new Random();
		final int[] randomArray = new int[len];

		for (int i = 0; i < randomArray.length; ++i) {
			randomArray[i] = rand.nextInt(MAX_ALLOWED_NUMBER);
		}

		return randomArray;
	}


	private static void printArray(final String caption, final int[] array) {
		System.out.print(caption + ":\t\t");

		for (final int elem : array) {
			System.out.print(elem + "\t");
		}

		System.out.println();
	}


	private static int[] bubbleSort(final int[] sArray) {
		int[] bblArray = copyOf(sArray, sArray.length);
		int tmp;

		for (int i2 = 0; i2 < bblArray.length; i2++) {
			for (int i = 0; i < bblArray.length - 1; i++) {
				if (bblArray[i] > bblArray[i + 1]) {
					tmp = bblArray[i];
					bblArray[i] = bblArray[i + 1];
					bblArray[i + 1] = tmp;
				}
			}
		}

		return bblArray;
	}


	private static int[] selectionSort(final int[] sArray){
		int[] slcArray = copyOf(sArray, sArray.length);
		int tmp, min;
<commit_msg>fix syntax<commit_after>import java.util.Random;
import java.util.Scanner;

import static java.util.Arrays.copyOf;

public class SortingArrays {

	private static int MAX_ALLOWED_NUMBER = 99;

	public static void main(final String[] args) {
		final Scanner input = new Scanner(System.in);

		System.out.print("Array length: ");
		final int[] array = getRandomArray(input.nextInt());

		printArray("Source array", array);
		printArray("Bubble sort", bubbleSort(array));
		printArray("Selection sort", selectionSort(array));
		printArray("Insertion sort", insertionSort(array));
	}


	private static int[] getRandomArray(final int len) {
		final Random rand = new Random();
		final int[] randomArray = new int[len];

		for (int i = 0; i < randomArray.length; ++i) {
			randomArray[i] = rand.nextInt(MAX_ALLOWED_NUMBER);
		}

		return randomArray;
	}


	private static void printArray(final String caption, final int[] array) {
		System.out.print(caption + ":\t\t");

		for (final int elem : array) {
			System.out.print(elem + "\t");
		}

		System.out.println();
	}


	private static int[] bubbleSort(final int[] sArray) {
		int[] bblArray = copyOf(sArray, sArray.length);
		int tmp;

		for (int i2 = 0; i2 < bblArray.length; i2++) {
			for (int i = 0; i < bblArray.length - 1; i++) {
				if (bblArray[i] > bblArray[i + 1]) {
					tmp = bblArray[i];
					bblArray[i] = bblArray[i + 1];
					bblArray[i + 1] = tmp;
				}
			}
		}

		return bblArray;
	}


	private static int[] selectionSort(final int[] sArray) {
		int[] slcArray = copyOf(sArray, sArray.length);
		int tmp, min;

{'fraction_non_alphanumeric': 0.14593908629441624, 'fraction_numerical': 0.007614213197969543, 'mean_word_length': 3.7990867579908674, 'pattern_counts': {'":': 2, '<': 9, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7237495', 'n_tokens_mistral': 1235, 'n_tokens_neox': 1082, 'n_words': 289}