I took a break from studying to graph the verse melody of "Here, There and Everywhere" by the Beatles. Most people can intuitively sense that there's some kind of pattern behind a good melody, but I was surprised to find just how clear the pattern is in this song.
This graph splits the 8-bar verse section into quarters (x-axis is the time written in eighth notes, y-axis is the interval of the melody note relative to the home key of G, which this example equals 1). While these graphs are open to several interpretations, you can immediately see that Q1 and Q2 are nearly identical in terms of phrase length and initiation, while Q3 and Q4 use the space left blank in Q1 and Q2. The point? If you want to write songs and/or better melodies and don't know where to begin, graphing out predecessor melodies by breaking it into quarters might be a good starting point. (Side note: Q1 corresponds to "Here, making each day of the year, Q2 to "Changing my life with a..." Q3 to "a wave of her hand/nobody can deny" and Q4 to "that there's something there.")
Continuing the idea, here is Verse 2 and bridge of "Here, There and Everywhere." Notes added to the primary phrases are circled in green. Please see my previous post for an explanation of these graphs.