0
Iterative quicksort or quicksort?
In which cases iterative one is faster? What are iterative version's advantages
2 Answers
+ 3
There is an iterative and a recursive version of quicksort. They both have a time complexity of O(n log n) with worst case of O(n²). However, the iterative version is faster, but has a greater space complexity due to its use of a data structure to simulate the recursion call stack.
Here's an example of a recursive quicksort.
https://code.sololearn.com/c8N978Jok1av/?ref=app
https://www.sololearn.com/learn/669/?ref=app
+ 1
Thank you
Hot today
What’s wrong?
3 Votes
Question is write a c program to print prime numbers up to n and print the largest number in array.
1 Votes
Question - Java: Pyramid layers
2 Votes
Error in Program
1 Votes
What is next?
0 Votes