#=
Description:  Bubble Sort
Author: Tushar Gautam
Date: 8th Jan 2022
=#

using BenchmarkTools

# Length of array
LEN = 100
# Min/Max range for array elements
min = 0.
max = 100.

# Initialising Arrays
arr = rand(min:eps():max, LEN)

println("Array: ", round.(arr, digits=3))

# Bubble sort
for i = 0:LEN-2
    for j = 2:LEN-i
        if (arr[j-1] > arr[j])
            tmp = arr[j-1]
            arr[j-1] = arr[j]
            arr[j] = tmp
        end
    end
end

println("Sorted Array: ", round.(arr, digits=3))
