Question
Download Solution PDFThe decrease by variable factor approach involves reducing the problem size by a variable factor in each step. Which algorithm uses this approach?
This question was previously asked in
Beltron Programmer 1 Oct 2023 Official Paper
Answer (Detailed Solution Below)
Option 1 : Merge sort
Free Tests
View all Free tests >
Beltron Programmer Mock Test
0.8 K Users
20 Questions
20 Marks
24 Mins
Detailed Solution
Download Solution PDFThe correct answer is Option 1) Merge sort.
Key Points
- Merge Sort uses the Decrease by Variable Factor approach by dividing the problem into smaller parts in each recursive step.
- In merge sort, the array is recursively divided into subarrays — typically halves — and then merged after sorting.
- Though typically split in halves, the actual size of subarrays in recursive calls may vary depending on implementation and size, hence the term variable factor.
- It follows the Divide and Conquer strategy:
- Divide the array into two (or more) parts
- Recursively sort each part
- Merge the sorted parts
- Time complexity: O(n log n) in all cases (best, average, and worst)
Additional Information
- Option 2 – Bubble Sort: Uses a simple comparison approach, not based on decreasing the problem size by a factor.
- Option 3 – Selection Sort: Selects the smallest (or largest) element and places it correctly; no recursive size reduction involved.
- Option 4 – Insertion Sort: Builds the final sorted array one item at a time; again, no divide-and-conquer or variable factor reduction used.
- Conclusion: Only Merge Sort among these follows the decrease by variable factor (via recursive subproblems) approach.
Last updated on Nov 25, 2024
-> BELTRON Programmer 2024 Notification has been released on the official website.
-> The Bihar State Electronics Development Corporation Limited (BELTRON) has announced a recruitment drive for Programmer positions on a contractual basis.
-> Specific vacancy details will be shared separately.
-> Interested candidates can apply online from November 11, 2024, to December 10, 2024.
-> The Minimum age of the candidates should be 21 years and maximum age should be 59 year of age.