Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- typedef enum {
- NullaryNode = 0,
- UnaryNode = 1,
- BinaryNode = 2,
- TernaryNode = 3
- } NodeType;
- typedef struct node_struct Node;
- struct node_struct {
- double p;
- NodeType type;
- union {
- struct { // Binary/Unary
- Node *next;
- Node *prev;
- };
- struct { // Ternary
- Node *pathA;
- Node *pathB;
- Node *pathC;
- };
- };
- };
Add Comment
Please, Sign In to add comment