language: C++ 4.7.2 (gcc-4.7.2)
date: 207 days 19 hours ago
link:
visibility: private
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#define YES 10
#define NO 20
#define SIZE 4
using namespace std;
#include <iostream>
 
struct Node
{
    Node ** children;
    int     childCount;
    char name[1];
    int empty;//YES or NO
    int sequence;
    double  value;
};
 
using namespace std;
 
bool isEmpty(Node ptr[SIZE][SIZE]) {    
    for (int i = 0; i<SIZE; i++) {
        for (int j = 0; j < SIZE; j++) {
            if(ptr[i][j].empty == YES){
                return true;
            }
        }
    }
    return false;
}
 
int main (int argc, const char * argv[])
{
    Node tree[SIZE][SIZE];
// some stuff
    if (isEmpty(tree)) {
        cout<<"this is empty\n";
        return 0;
    }
    return 0;
}