Seaching Algorithms

This commit is contained in:
2023-11-12 19:18:10 +05:30
commit 1abfa41674
4 changed files with 49 additions and 0 deletions

View 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;