C++ Best way to sort a linked list in place? -


i have linked list of elements texture index. unsorted. need them sort them texture index ascending in order. declare list , read curious ways sort in place. have suggest or link of should start/what should start looking this? not using stl list.

thank you!

sorting linked list best served mergesort (still o(n log n) list) since don't have random element access. if can switch std::list list::sort function take care of you.

alternately use non-list container instead of list , can use sort method please.


Comments