No for example what algo is this: (I wrote this func as a part of solution
to a programming problem)
void fill(int x, int y)
{
checked[x][y] = true;
if(!checked[x+1][y]) if(!empty[x+1][y]) fill(x+1, y); else { MIN = MIN
> block_height[x+1][y] ? block_height[x+1][y] : MIN; }
if(!checked[x-1][y]) if(!empty[x-1][y]) fill(x-1, y); else { MIN =
MIN > block_height[x-1][y] ? block_height[x-1][y] : MIN; }
if(!checked[x][y+1]) if(!empty[x][y+1]) fill(x, y+1); else { MIN = MIN
> block_height[x][y+1] ? block_height[x][y+1] : MIN; }
if(!checked[x][y-1]) if(!empty[x][y-1]) fill(x, y-1); else { MIN =
MIN > block_height[x][y-1] ? block_height[x][y-1] : MIN; }
empty[x][y] = true;
vol = vol + MIN - block_height[x][y];
vol = vol<0 ? 0 : vol;
return;
}
On Tue, Dec 20, 2011 at 11:40 AM, vivek dhiman <[email protected]>wrote:
> thanks rahul.
>
> What are the standard algos atlease the basic one's that should be known ?
>
>
> On Tue, Dec 20, 2011 at 11:33 AM, rahul raghavendra
> <[email protected]>wrote:
>
>> It is always better to know certain standard algorithms.
>> So whenever u see a problem and can possibly match it with any standard
>> algorithm .. u r in luck and can solve it in the most efficient manner as u
>> already know how to go about it.
>>
>> Whereas for the other case when u hav no idea abt the problem ,, then u
>> gotta start thinking about the logic in a normal way.
>>
>> Knowing such standard algo's will also allow u to use their logic in
>> building more complex solutions .
>>
>>
>> On Tue, Dec 20, 2011 at 11:19 AM, vivek dhiman <[email protected]>wrote:
>>
>>> Given that you don't know any standard algorithm but you know how do you
>>> find out which algo will be used for any given problem?
>>>
>>> Thing is whenever i see any problem i start solving it without thinking
>>> about a possible standard algo.. i want to be faster ..
>>> can some one reply ?
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Google Code Jam" group.
>>> To post to this group, send email to [email protected].
>>> To unsubscribe from this group, send email to
>>> [email protected].
>>> For more options, visit this group at
>>> http://groups.google.com/group/google-code?hl=en.
>>>
>>
>>
>>
>> --
>> *
>> K.Rahul :)
>> VII Semester
>> Information Science
>> PESIT , Bangalore
>>
>> *
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Google Code Jam" group.
>> To post to this group, send email to [email protected].
>> To unsubscribe from this group, send email to
>> [email protected].
>> For more options, visit this group at
>> http://groups.google.com/group/google-code?hl=en.
>>
>
>
>
> --
> Regards
> Vivek Dhiman
>
--
Regards
Vivek Dhiman
--
You received this message because you are subscribed to the Google Groups
"Google Code Jam" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-code?hl=en.