Advertisement
Gabriel_Rofl

tree.h updated

Nov 16th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.77 KB | None | 0 0
  1. #ifndef __TREE_H__
  2. #define __TREE_H__
  3.  
  4. /*estrutura da arvore*/
  5. typedef struct no {
  6.  
  7.         int data;
  8.  
  9.         struct no* left;
  10.  
  11.         struct no* right;
  12.  
  13. }tree;
  14.  
  15.  
  16. /*estrutura da fila*/
  17.  
  18.  
  19. typedef struct ptr{
  20.  
  21.      tree* data;
  22.  
  23.      struct ptr* anterior;
  24.  
  25.      struct ptr* proximo;
  26.  
  27. }elemento;
  28.  
  29. typedef struct {
  30.  
  31.     elemento* inicio;
  32.  
  33.     elemento* final;
  34.  
  35. }fila;
  36.  
  37.  
  38. /*funçoes da arvore*/
  39.  
  40. tree* cria_no();
  41.  
  42. tree* inseri_na_arvore(tree* raiz, int dado);
  43.  
  44. void pre_order(tree* raiz);
  45.  
  46. void order(tree* raiz);
  47.  
  48. void pos_order(tree* raiz);
  49.  
  50. void em_largura(tree* raiz);
  51.  
  52. /*funçoes da fila*/
  53.  
  54. elemento* aloca_elemento(tree* data);
  55.  
  56. fila* aloca_fila();
  57.  
  58. void enfilera(tree* data, fila* lista);
  59.  
  60. tree* desenfilera(fila* lista);
  61.  
  62. int check_fila(fila* lista);
  63.  
  64. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement