This is the sidewalk etiquette that I've adopted to when bike lanes are not available or it is not safe to ride on the shoulder of the road.
When I approach a person from behind on a sidewalk...........I cup my hand around my mouth and throw my voice at them and shout "Coming up behind you", It makes Kings and Queens step aside. When I pass them when they step aside, I say "Thank You" and motor on thru.
When I approach a person from behind on a sidewalk and they are smoking a cigarette.............I cut the engine and sneak up on them, when I get right next to them stealth like. I shout. "Right Side" letting them know I'm passing them on the right. You should see them loose control. They cover their heads like a bomb had been dropped. It is good for them though, scares the **** out of them.