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.
What exactly is the name of this algorithm and under what category does your implementation fall under (ex: sorting, searching, greedy method, dynamic programming, etc)
It is a greedy algorithm and I would like to add only the Insert Interval question as the merge interval is already added.
Assigned! @Aryaman3007 : C, C++, Java and Python
Could you please add this issue on quine.
This issue has been automatically closed because it has been inactive for many days. Please reopen if you still intend on working on this problem