Connect with knowledgeable individuals and get your questions answered on IDNLearn.com. Discover prompt and accurate responses from our experts, ensuring you get the information you need quickly.

Which sorting algorithm is known for having the worst-case time complexity of O(n²) but performs well on small or nearly sorted datasets?
A) Bubble sort
B) Merge sort
C) Quick sort
D) Insertion sort