A sidewalk is defined by its purpose: it is 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 is a sidewalk, so the right answer is “Both of the above.”