This exercise is a (second) example of using a harmonic minor scale to create a melody over a minor ii-V-i progression. To do this we use the harmonic minor scale of the i chord. For example in a D-7b5 (ii), G7b9,b13 (V7) and C-maj7(i) progression, a C harmonic minor scale is used throughout.
If you examine the modes of harmonic minor you’ll see that the 2nd mode outlines the -7b5 7th chord and that the 5th mode outlines a dominant 7 with a b9.
Often times dogmatic music pedagogy tells us the b9 on a -7b5 chord is an ‘avoid note’ or that a natural 11 over a dominant 7th chord is an ‘avoid note’. Although these notes sound mildly dissonant when sustained in a vertical harmonic structure, they are quiet melodic when used in a linear, or horizontal context. both these notes and the harmonic minor scale in general is used frequently in both baroque music (Bach) and bebop (Sonny Stitt, Bud Powell etc…).
This melody is played around the circle of fourths starting in concert C minor.