We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 537741d commit dec548cCopy full SHA for dec548c
test/searches.jl
@@ -8,8 +8,10 @@ using TheAlgorithms.Searches
8
unsorted_sample = [124, 53, 21, 163]
9
@test binary_search(sample, 52) == 3:3
10
@test binary_search(sample, 602) == 6:6
11
+ @test binary_search(sample, 45) == 3:2
12
@test binary_search(reversed_sample, 52; rev = true) == 5:5
13
@test binary_search(reversed_sample, 602; rev = true) == 2:2
14
+ @test binary_search(reversed_sample, 45; rev = true) == 6:5
15
@test_throws ErrorException binary_search(unsorted_sample, 21) # throws an error
16
end
17
@testset "binary_search - second method" begin
0 commit comments