Then if the weight of i is less than the available weight, I can return the value of i.
然后如果i的重量,小于剩下的重量,我将返回i的价值。
One is less than 2 so I return.
因此返回。
Now, less than is just, if you haven't used it before, it's just the operator you'd expect, it's comparing two things and it's going to return either true or false depending on whether the first argument is false less than the second argument.
现在,小于这个符号是,如果你之前没用过它的话,它就是你期望的那个运算符,它会比较两个独享,然后基于第一个参数是不是,小于第二个参数,返回true或者。
So I'll be producing this stuff, this water at cost c and only getting p, which is not only less than c in return.
这就导致成本是c的瓶装水只能卖到p,这个价格都不能捞回本钱呢
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周期有关。
So given some input of N elements, first, if N is less than 2, I return immediately.
给出N个元素的一些输入,首先,如果N小于,就立即返回。
应用推荐