1 | static int indexOfSearchingFromMiddleIC(L<S> l, S s) { |
2 | int len = l(l), middle = len/2, count = len-middle; |
3 | for n to count: { |
4 | int i = middle+n; |
5 | if (i < len && eqic(l.get(i), s)) ret i; |
6 | i = middle-n-1; |
7 | if (i >= 0 && eqic(l.get(i), s)) ret i; |
8 | } |
9 | ret -1; |
10 | } |
download show line numbers debug dex old transpilations
Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1013108 |
Snippet name: | indexOfSearchingFromMiddleIC |
Eternal ID of this version: | #1013108/6 |
Text MD5: | d54baf9fba5283428346f5f274e2dc3a |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2017-12-25 21:53:53 |
Source code size: | 284 bytes / 10 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 374 / 412 |
Version history: | 5 change(s) |
Referenced in: | [show references] |