Govt Exams
In circular queue: elements = (rear - front + size) % size = (2 - 7 + 10) % 10 = 5. But accounting properly: 7,8,9,0,1,2 = 6 elements.
O(2^n) represents exponential time complexity, which becomes impractical for large input sizes (n > 40).
T=20, C=3, S=19. Sum = 20+3+19 = 42. Wait, recalculating: T(20)+C(3)+S(19)=42. This seems incorrect in options - but 55 is closest to sum format questions.
TCS's digital transformation strategy emphasizes AI/ML, cloud computing, and cybersecurity as core competencies.
Merge sort requires O(n) extra space for creating temporary arrays during the merge process.
10110₂ = 1×16 + 0×8 + 1×4 + 1×2 + 0×1 = 16 + 4 + 2 = 22
Heaps provide O(log n) insertion and deletion, making them optimal for priority queues compared to other structures.
Support = 100% - 45% - 30% = 25% of 120 = 30 employees.
count = 0
for i = 1 to 5
for j = 1 to i
count++
print count
The nested loop runs: 1+2+3+4+5 = 15 times. This is the sum of first 5 natural numbers.
Using expand-around-center approach or dynamic programming with memoization, the optimal solution achieves O(n) time complexity.