Tag Info

New answers tagged

0

It sounds like you might like my answer here: http://programmers.stackexchange.com/a/262847/156217 The basic idea is: Address the cube in an x-y-z coordinate system, with a center at (0, 0, 0). A Piece class stores a position (x, y, z) and colors (cx, cy, cz). The Piece knows which sticker colors are on which axis (x, y, or z) but doesn't know which ...


3

Normally, size of an array has no effect on complexity of allocation itself. AFAIK, an array is internally a pointer to some address where the array begins and hidden fields for element size and element count. So it would be O(1). At least this is the case in Object Pascal, though I am not sure for C# or other languages. But finding the chunk of memory ...


1

It would be a bad practice, because it introduces a dependency on a subtle assumption that is hard to document and hard to remember accurately: namely, that the values maintained in this place are any strings without spaces in them. This is almost the same as "any strings", and the former definition will inevitably be mistaken for the latter one day. ...



Top 50 recent answers are included