Question
Which sorting algorithm is the most efficient for large
datasets and uses a divide-and-conquer approach?Solution
Merge Sort is a divide-and-conquer algorithm that divides the dataset into smaller subarrays, sorts each recursively, and merges them back to form a sorted array. Its time complexity is O(n log n) in all cases, making it highly efficient for large datasets.Advantages of Merge Sort include:
- Stability: It maintains the order of equal elements.
- Predictable performance: Consistent time complexity across best, worst, and average cases.
- Handles large datasets effectively, especially when external memory (e.g., disk storage) is involved.
A factory produces two types of gadgets: Type A and Type B. In a day, it produces 300 Type A gadgets and 400 Type B gadgets. If the production cost of T...
Identify the logic of the below given series and given answer.
Series I :: 81, 89, 116, 241, (A), 1915
Series II :: (B), 204, 208, 4...
4 5 12 39 160 ?
...64Â Â Â Â Â Â 66Â Â Â Â Â Â Â 76Â Â Â Â Â Â 126Â Â Â Â Â Â 376Â Â Â Â Â Â Â ?
...20 25 54 165 662 ?
...1240 600 ? 140 90 25
...1 6 13 24 41 ?
21, 63, 315, ?, 19845, 218295
21, 22, 48, 153, 628, ?
9 134 170 ? 577 1306
...