I would like to get feedback on my proposed algorithm to compute all the gaps that exist in a set of intervals.
My algorithm is as follows: