algorithm analysis /*recursive maximum contiguous subsequence sum algorithm finds maximum sum in subarray spanning [left rightdoes not attempt to maintain actual best sequence *int maxsumrecconst vector aint leftint right ifleft =right /base case ifaleft return aleft ]else return int center left right int maxleftsum maxsumrecaleftcenter )int maxrightsum maxsumrecacenter right )int maxleftbordersum leftbordersum forint centeri >left-- leftbordersum +ai ]ifleftbordersum maxleftbordersum maxleftbordersum leftbordersumint maxrightbordersum rightbordersum forint center <right++ rightbordersum +aj ]ifrightbordersum maxrightbordersum maxrightbordersum rightbordersumreturn max maxleftsummaxrightsummaxleftbordersum maxrightbordersum )/*driver for divide-and-conquer maximum contiguous subsequence sum algorithm *int maxsubsum const vector return maxsumreca size )figure algorithm