小编niv*_*123的帖子

C++编译器错误:"isLeaf()尚未声明" - 但它确实如此

#include <cstdlib>
#include <iostream>
#include "Node.h"
#ifndef HW4_H
#define HW4_H
using namespace std;
/**
You are to implement the two functions in this class.
You can add any other method or members to it as well.
However, you cannot change their signature.  
**/
class HW4{

public:
    int count(Node* r) const
    {
        if(r->next==NULL&&r->bro==NULL) { return 0;}
        if(r.isLeaf())
        {
            return ((1+count(r->next)+count(r->bro)));
        }
        count(r->next);
    }

    /*
    This method will return true if the tree rooted at node sn can answer
    the demand induced …
Run Code Online (Sandbox Code Playgroud)

c++ declaration

3
推荐指数
1
解决办法
628
查看次数

标签 统计

c++ ×1

declaration ×1