
Learn core concepts, essential formulas, and attempt practice questions designed on the latest TCS NQT testing patterns.
What is the average search time complexity of a Hashmap?
Correct Answer: A) O(1)
Step-by-step Solution: Hashmaps use hash tables to locate keys directly, achieving O(1) constant time complexity on average.
Find first non-repeating character in 'stress':
Correct Answer: A) t
Step-by-step Solution: Frequencies: s:3, t:1, r:1, e:1. Scanning from left: 's' repeats. 't' is the first character with frequency 1.
Use hashmaps when you need to solve O(N^2) search problems in O(N) time.