C#のArray.BinarySarch()で見つからない場合は負の値が返ってくるけど、ドキュメントを読んでもわからん。
https://onecompiler.com/csharp/433ycp238検索対象の配列:[1,3,7,20]try to find 1found index:0try to find 3found index:1try to find 8not foundnear index:2try to find 100not foundnear index:3
https://onecompiler.com/csharp/433ycp238
検索対象の配列:[1,3,7,20]
try to find 1
found index:0
try to find 3
found index:1
try to find 8
not found
near index:2
try to find 100
near index:3
コードで書くとこういう感じになるが、これで解釈はあってる?
Permalink | 記事への反応(0) | 15:52
ツイートシェア