【发布时间】:2019-05-15 10:04:03
【问题描述】:
你好,我正在准备期末考试,所以从我之前的考试中,我 得到了这个问题的部分功劳。递归算法使得它 计算给定链表中有多少节点的信息值小于 超过给定的阈值
typedef struct LLNode {
int info;
struct LLNode* pNext;
}LLNode;
int recCount(LLNode *front, int threshold)
{
}
我的回答是
int count = 0;
int total_less;
if(front == NULL)
return 0 ;
if(count < threshold)
count = 1 + recCount(front->next, front->info);
total_less++;
return total_
【问题讨论】:
-
得到结果后,你有没有运行你的程序并尝试调试它?
标签: c recursion data-structures linked-list