
Learn core concepts, essential formulas, and attempt practice questions designed on the latest TCS NQT testing patterns.
In what condition is Binary Search applicable?
Correct Answer: A) Array must be sorted
Step-by-step Solution: Binary search relies on ordering to discard halves. It requires a sorted array.
Find middle index formula preventing integer overflow in Java/C++:
Correct Answer: A) mid = low + (high - low) / 2
Step-by-step Solution: Adding low and high directly can exceed the maximum integer bounds. (low + (high-low)/2) avoids overflow.
Always remember: Binary Search requires sorting first.