Advertisement
alansam

Untitled

Jan 21st, 2022
1,037
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. #include <stdio.h>
  3. #include <string.h>
  4.  
  5. typedef enum { RED, BLACK } nodeColor;
  6. typedef char T[80];
  7.  
  8. typedef struct rbt {
  9.   struct rbt *left; /* left child */
  10.   struct rbt *right; /* right child */
  11.   struct rbt *parent; /* parent */
  12.   nodeColor color; /* node color (BLACK, RED) */
  13.   T data; /* data stored in node */
  14. } rbt_t;
  15.  
  16. // <---- line 28    |     this is starting from line 29 ---->
  17.  
  18. extern void insertNode (rbt_t ** root, rbt_t *);
  19. extern void deleteNode (rbt_t **, rbt_t *);
  20. extern void initRoot (rbt_t **);
  21. extern rbt_t *smallestNode (rbt_t **);
  22.  
  23. int main() {
  24.   rbt_t RBT = { NULL, NULL, NULL, RED,  };
  25.   strcpy(RBT.data, "Hello World");
  26.  
  27.   printf("%s\n", RBT.data);
  28.   return 0;
  29. }
  30.  
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement