Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. COIf I understand what you're saying, your answer would work in a case like this: B D G G G G G G G G G G G S Z Lower half: B D G G G G G -> B D G where mid + 1 would be the min index. Upper half: G G G G G S Z -> G S Z where mid - 1 would be the max index. Is this right? If it is though, I'm not sure it would work in this case: B D E F G G G G G H Q R S S Z Lower half: B D E F G G G -> G G G where Mid - 1 would have to be the min index. Upper half: G H Q R S S Z -> G H Q where mid - 2 would have to be the upper index. Am I understanding what you said, correctly?
      singulars
    2. CONo. Using your example to clarify: B D G G G G G G G G G G G S Z mid = G (index 7), now check the top half G G G G G S Z. mid = G (index 11), now check the top half G S Z. mid = S, not G, so check the bottom half G mid = G (index 12), and since there is no more to check, index 12 gives us our maximum index. Now we repeat this process on the lower half and get that the minimum index is 2. Then we know that the indices between 2 and 12 inclusive are all G.
      singulars
    3. COThank you. I understand now with the example you used. However, what about with the second example? B D E F G G G G G H Q R S S Z. Upper half: G H Q R S S Z mid = R, -> check G H Q mid = H, -> G so max index would be 8. However, for the bottom half: B D E F G G G mid = F, -> check G G G mid = G. In this case the mid is a match but it is not the min index. Or, maybe I am doing something wrong... :(
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload