Timeline for Merge sort and linked list implementation
Current License: CC BY-SA 3.0
6 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jan 5, 2017 at 6:03 | vote | accept | MikeJava | ||
| Dec 19, 2016 at 5:21 | answer | added | user66619 | timeline score: 1 | |
| Dec 18, 2016 at 18:23 | comment | added | user66619 |
You are taking an index-based approach to a problem in which there is no use of index at all. In _sort(..), you call list.listIterator(index) every time and it in turn calls findNode(..) which is O(n). This dramatically inscreases your runtime. I don't see any other reason for the O(n^2) runtime. Take a look at the classical merge sort for linkedlists.
|
|
| Dec 18, 2016 at 18:00 | history | edited | Jamal | CC BY-SA 3.0 |
added 2 characters in body; edited title
|
| Dec 18, 2016 at 10:47 | review | First posts | |||
| Dec 18, 2016 at 10:52 | |||||
| Dec 18, 2016 at 10:37 | history | asked | MikeJava | CC BY-SA 3.0 |