[quote]> 3 in [1,2,3,4]
true
> -1 in [1,2,-1,-2]
false[/quote]
testing negative number, it always returns false, no matter this number is actually in the array.
true
> -1 in [1,2,-1,-2]
false[/quote]
testing negative number, it always returns false, no matter this number is actually in the array.
本文探讨了一个有趣的现象:在数组中搜索负数时,无论该数是否存在,搜索结果总是返回False。这一现象对于理解数据结构和搜索算法至关重要。

被折叠的 条评论
为什么被折叠?



