qsort2 [LeetCode] 2406. Divide Intervals Into Minimum Number of Groups, C Solution - Use qsort(2D array, 2 column) & Greedy Algorithms - Time Limit Exceed int minGroups(int** intervals, int intervalsSize, int* intervalsColsize) { int i = 0; int** RefArr; int RefArrSize = intervalsSize; int** TmpArr; int TmpArrSize = intervalsSize; int NumOfGroup = 0; int StartIndex = 0; int EndIndex = 0; // Sort qsort(intervals, intervalsSize, sizeof(intervals[0]), compare2Darray2Colu.. 2023. 1. 2. qsort This contents is referenced from here : (https://en.cppreference.com/w/c/algorithm/qsort) There is default qsort() function in c and cpp basic library. If you don't have good function for sorting, qsort is great alternatives. qsort - Sorts elements of given array point in ascending order void qsort(void *ptr, size_t count, size_t size, int (*comp)(const void *, const void *) ); parameters ptr - .. 2023. 1. 2. 이전 1 다음