Here is another function which probably does not operate the way you
intended, but which meets the specifications.

bool uniform()
{
  static unsigned int count;
  if (non_uniform()) ++count;
  return ((count >> 31) == 1);
}

On Mar 17, 9:24 am, saurabh agrawal <[email protected]> wrote:
> Given a  function which returns true 60% time and false 40% time.
>
> Using this function you have to write a function which returns true 50% of
> the time.

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" 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/algogeeks?hl=en.

Reply via email to