A(q, cList){
for(i=1;i<q;i++){ // q is the number of keywords in the query
B(cList[i]);
}
}
B(c){
for(j=1; j<c;j++){ // c specifies how many times the keyword is included, and taken as input
do something
}
}
For example:
A(2, [5, 7]) // 2 keywords are searched, that are included in 5 and 7 documents
A(2, [100, 1500]) // 2 keywords are searched, that are included in 100 and 1500 documents
A(3, [1, 10000, 1500]) // 3 keywords are searched, that are included in 1, 10000 and 1500 documents
外循环取决于 q。但我不决定 B 的复杂性?
c 的值随每个关键字而变化。我认为这也取决于 c 值。
那么,A的复杂度是多少?