Ref: CLRS section 16.4