Skip to content

Commit 50ccde3

Browse files
author
alx
committed
Adding Javadoc to merge method
1 parent 2388655 commit 50ccde3

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/main/java/com/thealgorithms/sorts/BitonicSort.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,15 @@ private <T extends Comparable<T>> void bitonicSort(T[] arr, int low, int cnt, bo
4646
}
4747
}
4848

49+
/**
50+
* Merges the bitonic sequence in the specified direction.
51+
*
52+
* @param <T> the type of elements in the array, which must be Comparable
53+
* @param arr the array containing the bitonic sequence to be merged
54+
* @param low the starting index of the sequence to be merged
55+
* @param cnt the number of elements in the sequence to be merged
56+
* @param dir the direction of sorting: true for ascending, false for descending
57+
*/
4958
private <T extends Comparable<T>> void bitonicMerge(T[] arr, int low, int cnt, boolean dir) {
5059
if (cnt > 1) {
5160
final int k = cnt / 2;

0 commit comments

Comments
 (0)