1
$\begingroup$

Given the following statement:

"A nonempty array A consisting of N integers is given. Any integer K, such that 0 ≤ K < N-1, splits array A into two non-empty parts"

What does the 0 ≤ K < N-1 expression mean in this context?

$\endgroup$
  • 1
    $\begingroup$ Can you provide the reference to the original source like a url or the section of a book? Do we have enough context? Can you provide more context? Does it mean splitting the array $A$ into the first $K$ integers and the others? Or the last $K$ integers and the others? $\endgroup$ – Apass.Jack Oct 5 '18 at 21:52
4
$\begingroup$

You have an array with indices from $0$ to $N-1$. $K$ is an in integer in this range, i.e. larger or equal to zero and smaller than $N-1$.

This integer splits the array into two parts as follows:

Part 1: From $0$ to $K$ (including K)

Part 2: From $K$ (excluding K, i.e. starting with $K+1$) to $N-1$.

$K$ has to be smaller than $N-1$ (and not smaller or equal) because else there would only be one Part (the whole array) for $K= N-1$.

$\endgroup$
4
$\begingroup$

$a<b<c$ means $a<b$ and $b<c$.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.