![]() |
Why is mege sort O(n log n)?
Example, n is 8. Merge sort (for link list) is constantly divide the list into two sublist until every node->next will point to null. Then, sort them by merging them. When I tried to count it myself, in the divide part first divide the 8 nodes into two. In link list, you will need to traverse....
|
| All times are GMT -4. The time now is 02:17 AM. |
Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.