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 vessel contains some milk .6 liter of the milk was taken out of the vessel and replaced with 6 liter of water and again 6 liter of mixture was taken o...
If A : B = 5:3 and A is 14 more than B then find the sum of A and B.
Ratio of male to female population of a town in 2018 was 3:2 and total population in 2018 was 15000. If the male population is ___ and female populatio...
The ratio of two numbers ‘X’ and ‘Y’ is 7:9, respectively. If 4 is added to each of ‘X’ and ‘Y’, then the ratio of ‘X’ and ‘Y’ b...
Divide 297 into two parts such that one may be to the other as 2:9.
A stone worth Rs.3800 drops and breaks with weight in the ratio 2:3:5. The price of stone is directly proportional to square of its weight. Find the tot...
Find the fourth proportion of (k + 2), (3k + 6) and (5k + 10). (Note: 'k' is the smallest odd prime number.)
The ratio of males to females on a bus is 7:6. At the next stop, 7 males and 8 females exit the bus, while 4 males and 24 females board it. As a result,...
Ratio of monthly income to monthly expenditure of A is 20:7, respectively and monthly savings of A is Rs. 3900. Find the monthly income of A.
The ratio of number of boys and girls in a factory of 660 workers is 7:5. How many more girls should be joined to make the ratio 1:1?