A sidewalk is defined by its purpose: it's the part of the road meant for pedestrians. It may run right alongside the roadway, or it may be separated from it in any way — for example, by a strip of grass or a fence. Either way it's a sidewalk, so the correct answer is “Both of the listed cases.”