Govt Exams
In a sorted array, median is at index n/2, which is accessed in constant time O(1).
Memoization is an optimization technique where results of expensive function calls are cached and returned when same inputs occur again.
XOR (exclusive OR) returns 1 only when bits are different. 1 XOR 1 = 0 because both bits are the same.
MergeSort has O(n log n) worst-case and is stable. QuickSort is O(n²) worst-case, HeapSort is not stable.
A power of 2 has only one bit set. n & (n-1) removes the rightmost set bit, so if result is 0, n is a power of 2.
BFS uses a Queue (FIFO) to explore nodes level by level. DFS uses a Stack (LIFO).
QuickSort uses O(log n) space for the recursion call stack in the average case.
Load factor = n/m = 15/10 = 1.5. Average chain length in hash table = load factor = 1.5
Google uses both functional and OOP paradigms depending on requirements. Go language (created by Google) supports both paradigms.
'Un-' is a prefix meaning 'not' or the opposite of something (unhappy = not happy).