Re: One algorithm problem



mohangupta13 said:

<snip>

I did put a lot of thought and did arrive with a solution but that
requires and additional space of size N
:

Say i have an array C[N]
for(i=0;i<N;i++)

You already broke the constraint that you're not supposed to use any
extra memory. You just used sizeof i bytes of extra memory.

<snip>

--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
.



Relevant Pages

  • Re: One algorithm problem
    ... Say i have an array C ... You just used sizeof i bytes of extra memory. ...
    (comp.programming)
  • Re: C Standard Regarding Null Pointer Dereferencing
    ... Knowing that -1 << 512 is of type int does not ... such a constraint into a future standard. ... Such a constraint is not possible. ...
    (comp.lang.c)
  • Re: One algorithm problem
    ... You already broke the constraint that you're not supposed to use any ... You just used sizeof i bytes of extra memory. ... Richard Heathfield ...
    (comp.programming)
  • Re: The Selfish Bachelor
    ... A phenomenon i've been encountering since I broke up with my girlfriend some ... time ago is people trying to hook me up. ...
    (soc.men)
  • Re: Some creationist quotes
    ... and proud to be part of it all, can't get out of the dorm because you're broke, so you waste bandwidth in the little free time you have left, until the next party/orgy you'll be invited to. ...
    (talk.origins)