Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public <T extends Comparable<T>> int[] find(T[][] matrix, T key) {

public static <T extends Comparable<T>> int[] search(T[][] matrix, T target) {
int rowPointer = 0; // The pointer at 0th row
int colPointer = matrix.length - 1; // The pointer at end column
int colPointer = matrix[0].length - 1; // The pointer at end column

while (rowPointer < matrix.length && colPointer >= 0) {
int comp = target.compareTo(matrix[rowPointer][colPointer]);
Expand Down
Loading