Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
17
Task/Binary-search/Maple/binary-search-3.maple
Normal file
17
Task/Binary-search/Maple/binary-search-3.maple
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
> N := 10:
|
||||
> P := [seq]( ithprime( i ), i = 1 .. N ):
|
||||
> BinarySearch( P, 12, 1, N ); # recursive version
|
||||
FAIL
|
||||
|
||||
> BinarySearch( P, 13, 1, N ); # recursive version
|
||||
6
|
||||
|
||||
> BinarySearch( Array( P ), 13, 1, N ); # make P into an array
|
||||
6
|
||||
|
||||
> PP := Array( -2 .. 7, P ): # check it works if the array is not 1-based.
|
||||
> BinarySearch( PP, 13 ); # iterative version
|
||||
3
|
||||
|
||||
> PP[ 3 ];
|
||||
13
|
||||
Loading…
Add table
Add a link
Reference in a new issue