Guest User

Untitled

a guest
Jun 21st, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. typedef enum {
  2. NullaryNode = 0,
  3. UnaryNode = 1,
  4. BinaryNode = 2,
  5. TernaryNode = 3
  6. } NodeType;
  7.  
  8. typedef struct node_struct Node;
  9. struct node_struct {
  10. double p;
  11. NodeType type;
  12. union {
  13. struct { // Binary/Unary
  14. Node *next;
  15. Node *prev;
  16. };
  17. struct { // Ternary
  18. Node *pathA;
  19. Node *pathB;
  20. Node *pathC;
  21. };
  22. };
  23. };
Add Comment
Please, Sign In to add comment