下面 schedule 函数的时间复杂度为( )。 #include using namespace std; struct activity { int id, start, end; }; bool compare(activity a, activity b) { return a.end = end) { end = p[i].end; cnt++; } } return cnt; }
A:O(n)
B:O(log(n))
C:O(nlog(n))
D:O(n2)
正确答案:C
试卷来源:202403 CCF-GESP编程能力等级认证C++七级真题