If there are less than two elements there I just check one or both of those to see if I'm looking for the right thing.
列表里是否剩余超过两个元素?,是否剩余不足两个元素,这里面我就挑一两项来检查下是否运行正常。
Because I thought everyone was going to be around like the 45 range because 66 is two-thirds, or right around of 100, and they were going to go two-thirds less than that and I did one less than that one.
因为我想每个人都会选45左右的数,因为66约等于一百的2/3,而大家会选比那小的,我就选了更小的数
The less than side is gonna be a less than sign, and then the word and is going to become not one & but two ampersands back to back, and we'll see why it's two and not one before long.
小于“侧还是用的“小于“,而中间的“and“将去掉,换成两个紧挨着的&符号,但至于为什么是&&而不是,我们以后会提到。
So this line or these lines of code up here are arguably constant time steps to say if N is less than 2 in return, that it will always take maybe one step, maybe two steps, some number of fixed CPU cycles.
如果N小于2并返回,那么这些行所对应的代码,通常只需要执行一步,或者两步,具体数字与CPU周期有关。
应用推荐