News for hackers. Stuff that matters.
Re:Data structures and algorithms problems in C++ using STL by pierrebai on Friday March 10, 2017 @03:43PM (#13841955)
Nit-pick: I believe there are no sorting algorithm in O(1) space: just keeping the index of an element takes log2(N) space. Most algorithms hide this fact by assuming numbers have an infinite range. If you do, then you can use a single data for any algorithm, given a sufficiently clever encoding :) (Just use a number base-N and then you got as much easy-to-access, direct-addressable storage as you want per elements.)
Re:Data structures and algorithms problems in C++ using STL by cousin_it on Friday March 10, 2017 @06:19PM (#13842998)
When people talk about these things, they usually assume something like the transdichotomous model (machine word size is unknown, n fits in a machine word, arithmetic on machine words is O(1)). It gives the right complexities for everyday algorithms.