Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Note that re-sorting an array after making a constant number of changes can be done in O(n) and will usually be very fast in practice. Insertion sort will do it, as will Timsort and similar algorithms.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: