Data Structures & AlgorithmsHardTCS NQT · Accenture
In the list [1, 3, 4, 7, 2, 9], how many nodes come strictly before the first node whose value exceeds 5?
- A. 4
- B. 5
- C. 3
- D. 7
Correct answer: C. 3
The first node above 5 is 7, which is preceded by 1, 3 and 4.
Practise more Arrays, Strings, Linked Lists, Stacks, Queues and Hashing questionsArrays, Strings, Linked Lists, Stacks, Queues and Hashing: notes and key points
More Arrays, Strings, Linked Lists, Stacks, Queues and Hashing questions
- How many index pairs i < j in [3, 5, 6, 1] satisfy a[i] XOR a[j] < a[i]?
- How many pairs of positions i < j in the string aabbab have s[i] = a and s[j] = b (the letters need not be adjacent)?
- What is the sum of the prefix-function values pi[0] through pi[n-1] of the string abacabab?
- What is the sum of lcm(i, i+1) for i = 1 to 9?
- What is the smallest positive integer n such that n! has exactly 10 trailing zeros?
- How many integers x in [1, 1000] have exactly 3 positive divisors?