⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 comm.h

📁 数据结构C++语言描术—清华大学出版的
💻 H
字号:
// determine the number of committees with k members that
// can be chosen from n persons
int comm (int n, int k)
{
    // stopping condition; too few persons 
    if (k > n)    
        return 0;
    // stopping condition; committee of the whole or 0 members
    else if (n == k || k == 0)
        return 1;
    else
        // recursive step: all committes without person A
        // + all committees that include person A
        return comm(n-1,k) + comm(n-1,k-1);
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -