Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit d3d1d03

Browse files
Added Comment on Linear Search Logic
1 parent 356dfb1 commit d3d1d03

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

‎src/com/jwetherell/algorithms/search/BinarySearch.java‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ private static int recursiveFind(int value, int start, int end, boolean optimize
5656
}
5757

5858
private static final int linearSearch(int value, int start, int end) {
59+
// From index i = start to i = end check if value matches sorted[i]
5960
for (int i = start; i <= end; i++) {
6061
int iValue = sorted[i];
6162
if (value == iValue)

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /