Sidewalks are not appropriate places to ride a bike.  It's a place for walking. It can also be dangerous because a driver is not likely to suspect something to be coming at that rate on the sidewalk as they come in and out of driveways and parking lots. 

If you do feel like the best thing to do in a situation is ride on the sidewalk (certainly you should use your judgement and always do what you think is right/safe..) please try to ride in the same direction as traffic.