A neat way to see this without memorising a formula is to picture binary search as a decision tree. Every internal node of this tree represents one comparison against a middle element, has a "target is smaller" branch and a "target is larger" branch, and every leaf represents "search space is now empty, target is absent".
A tree where each internal node has 2 branches and needs to represent every possible "gap" outcome for a missing element needs enough leaves to cover all $n+1$ gaps (before the first element, between each pair of elements, and after the last element). With $n = 1000$ elements, there are $1001$ such gaps.
A binary tree with depth $d$ can have at most $2^d$ leaves. We need
\[ 2^d \ge 1001 \]Check successive powers of 2: $2^9 = 512$, which is too small, and $2^{10} = 1024$, which is enough to cover all 1001 gaps. So the smallest depth that works is $d = 10$.
Each level of this decision tree corresponds to exactly one comparison in the actual search, so the worst-case unsuccessful search needs 10 comparisons before it can conclude the element is not present.
This also lines up with just repeatedly halving 1000: $1000 \to 500 \to 250 \to 125 \to 62 \to 31 \to 15 \to 7 \to 3 \to 1 \to 0$, which is 10 halving steps to reach an empty range.
\[ \boxed{10} \]\(\underline{\hspace{1cm}}\) refers to a set of data values and associated operations that are specified accurately, independent of any particular implementation.
Match LIST-I with LIST-II
\[\begin{array}{|c|c|}\hline \text{LIST-I} & \text{LIST-II} \\ \hline \text{A. The first index comes after the last index.} & \text{I. Head-tail Linked List} \\ \hline \text{B. More than one queue in the same array of sufficient size} & \text{IV. Multiple Queue} \\ \hline \text{C. Elements can be inserted or deleted at either end.} & \text{III. Circular Queue} \\ \hline \text{D. Each element is assigned a priority.} & \text{II. Priority Queue} \\ \hline \end{array}\] Choose the correct answer from the options given below:
Consider the following statements about arrays. Which of the following are TRUE?
A. The index specifies an offset from the beginning of the array to the element being referenced.
B. Declaring an array means specifying three parameters; data type, name, and its size.
C. The length of an array is given by the number of elements stored in it.
D. The name of an array is a symbolic reference to the address of the first byte of the array.
Choose the correct answer from the options given below:
Consider the binary tree given below. What will be the corresponding infix expression to this?
