Good question Varies
In public, first concern is safety. No child should go anywhere alone until parents are confident that kid can & will assert self and make noisy call for help if threatened in any way. Family bathrooms in public places are becoming more common, but if not available, child should go with parent into br of parent's gender. Better an uncomfortable bystander than unsafe child.