mirror of
https://github.com/Hizenberg469/Algorithms-snippets.git
synced 2026-04-19 22:52:23 +03:00
Seaching Algorithms
This commit is contained in:
6
Searching/binary_search_jump.cpp
Normal file
6
Searching/binary_search_jump.cpp
Normal file
@@ -0,0 +1,6 @@
|
||||
//Binary Search Jump.
|
||||
int ans = n;
|
||||
for(int b = n/2 ; b >= 1 ; b/=2 ){
|
||||
while(check(ans - b))ans -= b;
|
||||
}
|
||||
cout << ans << endl;
|
||||
Reference in New Issue
Block a user