GATE Exam | Aptitude Questions | GATE Syllabus | GATE Result | Mock Test | GATE Preparation
Best Answer to Any Question
Email or Username
I forgot my password
Ask a Question
Recent questions tagged sorting
Ask a question:
sorting algorithms can be used to sort a random linked list with minimum time complexity
Which of the following sorting algorithms can be used to sort a random linked list with minimum time complexity? A Insertion Sort B Quick Sort C Heap Sort D Merge Sort
Why is quicksort better than other sorting algorithms in practice?
In a standard algorithms course we are taught that quicksort is O(nlogn) on average and O(n2) in the worst case. At the same time, other sorting algorithms are studied which are O(nlogn) in the worst case (like mergesort and heapsort), and even linear time in the best case (like bubblesort) but with some additional needs of memory. Also, consider that students learn in basic programming courses that recursion is not really good in general because it could use too much memory, ... Does it have to do with the way memory works in computers? I know that some memories are way faster than others, but I don't know if that's the real reason for this counter-intuitive performance (when compared to theoretical estimates).
To see more, click for the
full list of questions
The best answer to any question