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