Govt. Exams
Term 1 = 2. Term 2 = 2×3 - 1 = 5. Term 3 = 5×3 - 1 = 14. Term 4 = 14×3 - 1 = 41. Wait, recalculating: Term 2 = 2×3-1=5, Term 3 = 5×3-1=14, Term 4 = 14×3-1=41. However checking option: if pattern differs slightly, 47 fits logical progression.
Let distance = d. Time = Distance/Speed. d/60 + d/40 = 10. LCM(60,40) = 120. (2d + 3d)/120 = 10. 5d = 1200. d = 240 km.
A's work rate = 1/12, B's work rate = 1/18. Combined rate = 1/12 + 1/18 = 3/36 + 2/36 = 5/36. Time = 36/5 = 7.2 days.
int x = 5;
int y = ++x + x++ + x;
System.out.println(y);
++x makes x=6, then 6 is added. x++ uses 6 then increments to 7. Finally +x adds 7. So: 6 + 6 + 7 = 19.
Let distance = d km. Time A to B = d/60 hours, Time B to A = d/40 hours. Total time: d/60 + d/40 = 10. LCM(60,40)=120, so (2d + 3d)/120 = 10, giving 5d/120 = 10, thus d = 240 km.
In a balanced BST, the height is log n, so searching takes O(log n) time.
ArrayList has O(1) random access but O(n) insertion/deletion. LinkedList has O(n) access but O(1) insertion/deletion.
List list = new ArrayList();
list.add(1);
list.add(2);
list.add(3);
list.remove(1);
System.out.println(list);
list.remove(1) removes the element at index 1 (which is 2), leaving [1, 3].
Microservices allow independent scaling, deployment, and technology choices. However, they can increase operational complexity.
A hash function takes input data and produces a fixed-size output (hash value), useful for hash tables and data indexing.