Add quick sort tests (#3165)

This commit is contained in:
Akshay Dubey
2022-06-24 11:27:01 +05:30
committed by GitHub
parent d8c9c1ac85
commit 85c836c795
2 changed files with 69 additions and 19 deletions

View File

@ -76,23 +76,4 @@ class QuickSort implements SortAlgorithm {
}
return left;
}
// Driver Program
public static void main(String[] args) {
// For integer input
Integer[] array = {3, 4, 1, 32, 0, 1, 5, 12, 2, 5, 7, 8, 9, 2, 44, 111, 5};
QuickSort quickSort = new QuickSort();
quickSort.sort(array);
// Output => 0 1 1 2 2 3 4 5 5 5 7 8 9 12 32 44 111
print(array);
String[] stringArray = {"c", "a", "e", "b", "d"};
quickSort.sort(stringArray);
// Output => a b c d e
print(stringArray);
}
}