Gah, I didn't think that one all the way through. Yes it wouldn't be possible to know when you've hit the maximum element for a row so I'll rest my O(n) case.
Type: Posts; User: OnionKnight
Gah, I didn't think that one all the way through. Yes it wouldn't be possible to know when you've hit the maximum element for a row so I'll rest my O(n) case.
I can't believe I oerlooked that. But thinking about it, I think there's still an O(n) solution. You only have to check 2n - 1 elements. Basically taxicab geometry where you start in the top left and...
There is only one row you'd need to search through as all other rows are guaranteed to have it's maximum value less than it. In the case of equality, it wouldn't matter which of the possible rows...
The ordo notation gives upper bounds, which means the obvious O(n) solution is also O(n*log(n)). Not sure if I want to point it out though, seems to be an awful lot like "do my homework".
What does it mean that a row is less than another?
I have a table representing a hierarchy using the nested set model, declared as
CREATE TABLE tags (
id INTEGER PRIMARY KEY AUTOINCREMENT,
label TEXT NOT NULL UNIQUE,
lft INTEGER NOT NULL,...
4k is perfectly reasonable for a path. I suppose this is under Linux?
What makes you think your system uses extended ASCII? In latin1, 'ä' is 228. But why are you worried about the code for the character in the first place?
Utilizing the upper limit for paths is arguably the easiest way to do it. The PATH_MAX constant, while not standard to C, is quite convenient as it is defined both in Windows in windows.h and in...
What's a "hasard"?
Yeah I can't see the need for anything else than constant memory either. This seems like a classical XY problem where a person has a problem X and though of a solution Y and asks about Y instead of...
C++ is riddled with things that make it clumsy and a lot less useful. Thinking it has somehow superseded C is just wrong on so many levels.
http://yosefk.com/c++fqa/defective.html
Sending messages, WM_COPYDATA in particular, can be used for IPC as well.
Would also turn out troublesome if sizeof(int) differed from sizeof(float).
There is no /proc/mounts on the machine that requires the program. I found out the mtab on it is /etc/mnttab so I suppose I could just parse that.
I want to be able to get a list of file systems and the path they're mounted just like the df program will print out, which reports disk usage. Is this possible with some POSIX.1 function or...
When you have to integrate sin(x)^8 dx is when I go SCREW YOU
How about snprintf(dest, sizeof(dest) < 10 ? sizeof(dest) : 10, "%s", src); ?
You cannot compare NAN like you can with infinity. Anything compared with NAN is false, so NAN == NAN is false. Use isnan() in the form of std::isnan(). If you really don't like it you can use...
Microsft Access has localized keywords for SQL queries. It was a pretty scary sight.
I don't understand how instance specific would be a problem, but I have noticed that the static global variable is back at NULL when another function is called after the one that passes the HWND to...
I try to stay away from shared memory and things that aren't lock- and wait-free.
I don't quite get it, filter function? The page on MSDN seems to be about a functional programming filter...
I made a global keyboard hook which according to MSDN needs to be in a separate DLL and it works fine. Now when a user does a certain keypress I want the DLL to report that back to the application...
I forgot to mention that I could consider using an RDBMS if it can be compiled into the program so I might just go with SQLite. The theory behind relational databases seems a bit too broad to get...
I am thinking of writing a tag engine for files using a relational database, but I can't find much information regarding the implementation of an efficient database. Supposedly there are books out...