0

Trying to find concurrent times using c++

Given user i out I am trying to figure out how to find out how many concurrent times there are. // A C++ program to check if any two intervals overlap #include <algorithm> #include <iostream> using namespace std;    // An interval has start time and end time struct Interval {     int start;     int end; };    // Compares two intervals according to their staring time. // This is needed for sorting the intervals using library // function std::sort(). See http:// goo.gl/iGspV bool compareInterval(Interval i1, Interval i2) {     return (i1.start < i2.start) ? true : false; }    // Function to check if any two intervals overlap bool isOverlap(Interval arr[], int n) {     // Sort intervals in increasing order of start time     sort(arr, arr + n , compareInterval);        // In the sorted array, if start time of an interval     // is less than end of previous interval, then there     // is an overlap     for (int i = 1; i < n; i++)         if (arr[i - 1].end >

1st Feb 2020, 1:04 AM
anthony rubio
1 Antwort
+ 1
Save the code in SoloLearn and share the link instead. This is the recommended way for codes having more than 10-15 line. As you can see, your text is truncated due to character limits. Follow this guide to share links in case you didn't know how 👍 https://www.sololearn.com/post/74857/?ref=app https://www.sololearn.com/post/75089/?ref=app
2nd Feb 2020, 5:35 AM
Ipang