You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
732 B

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
  1. /*
  2. * tree.h
  3. *
  4. * Created by Yigit Colakoglu on 07/06/2021.
  5. * Copyright yigit@yigitcolakoglu.com. 2021. All rights reserved.
  6. */
  7. #include "urlparse.h"
  8. #include <stdio.h>
  9. #ifndef tree_h
  10. #define tree_h
  11. typedef struct tnode {
  12. char *path;
  13. unsigned int red : 1;
  14. LinkedList *params;
  15. int nparams;
  16. struct tnode *parent;
  17. struct tnode *left;
  18. struct tnode *right;
  19. } TreeNode;
  20. TreeNode *addtree(TreeNode *parent, TreeNode *node);
  21. void rotatetreeright(TreeNode *node);
  22. void rotatetreeleft(TreeNode *node);
  23. void balancetree(TreeNode *root, TreeNode *node);
  24. TreeNode *treealloc(void);
  25. void printtree(TreeNode *root, FILE *out, char *payload, int minparams);
  26. #endif /* Symbol’s value as variable is void: \. */