Algorithms icon indicating copy to clipboard operation
Algorithms copied to clipboard

Add Intervals Algorithm: Insert Intervals.

Open Aryaman3007 opened this issue 1 year ago • 4 comments

I want to add the Insert Intervals algorithm in C++.

Insert Intervals

The insert intervals algorithm will find the correct position to insert the new interval while ensuring that the resulting intervals are still in ascending order and non-overlapping. If the new interval overlaps with existing intervals, it should be merged with the overlapping intervals.

For example, given the input intervals: [[1,3], [6,9], [10,13]], and the new interval to insert: [7,12], the output should be: [[1,3], [6,13]].

I Will provide the approach and solution for Merge Intervals and Insert Intervals algorithms with proper comments and documentation.

I would like to work on this issue. Could you please assign this issue to me under SSoC ' 23.

Aryaman3007 avatar May 31 '23 03:05 Aryaman3007