using System.Collections;
public static void Main()
int[] arr = {5, 0, -1, 6, -9};
BubbleSort bs = new BubbleSort(arr);
int[] sortedArray = bs.Sort();
for(int i=0; i < sortedArray.Length; i++) {
Console.WriteLine(sortedArray[i]);
public class BubbleSort {
public BubbleSort(int[] arr) {
int upperLimit = this.arr.Length;
for(int i = 0; i < upperLimit; i++) {
for(int j = 0; j < (upperLimit-1); j++) {
if (this.arr[j] > this.arr[j+1]) {