Filter interviews by
Difference between stack and queue
Merge sort has a time complexity of O(n log n) and is a divide and conquer algorithm.
Divides the array into two halves recursively
Sorts the two halves separately
Merges the sorted halves to produce the final sorted array
Uses extra space for merging
Suitable for sorting linked lists
Example: Sorting an array of 10 elements takes 30 comparisons and 3 merge operations
Quick sort has an average time complexity of O(n log n) and worst case complexity of O(n^2).
Quick sort is a divide-and-conquer algorithm that recursively partitions an array into smaller sub-arrays.
It selects a pivot element and partitions the array around the pivot, with elements smaller than the pivot to its left and larger to its right.
The pivot is then placed in its final position and the algorithm is applied to th...
Top trending discussions
Area Sales Manager
31
salaries
| ₹3.2 L/yr - ₹7.6 L/yr |
Territory Sales Incharge
22
salaries
| ₹1.6 L/yr - ₹2.7 L/yr |
Sales Officer
19
salaries
| ₹1.8 L/yr - ₹3.6 L/yr |
Executive Accountant
11
salaries
| ₹1.5 L/yr - ₹3 L/yr |
Store Manager
9
salaries
| ₹2.4 L/yr - ₹3.2 L/yr |
Bikanervala
Balaji Wafers
MTR Foods
Patanjali Ayurved