Algorithms
Algorithms copied to clipboard
Add Intervals Algorithm: Insert Intervals.
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.