I'm going to set up an index, which is going to tell me where to look, starting at the first part of the list, right?
索引告诉我从哪里开始检索数组,对不对?,然后我会去记录下我做了多少次比较,这样我就能看到这个算法的工作量了?
So I'm not going to take the item with an index of 2.
所以我不会选择,索引值为2的物品。
It says while the index is smaller than the size - of the list, I'm not at the end of the list and I don't have an answer yet, check.
当然是如果我还没检索到目标数的话,因此我会去看看是不是,这里真的看不情。
OK. What does that say? I'm going to change MinIndex min index to also point there n value is 8, j starts off here, and I say, OK, is the thing I'm looking at here smaller than that? Yes.
好的,这意味着什么?,我打算交换,让它也指向那里,MinVal是8,j从这里开始,我要找的值比这个小么?是的。
应用推荐