Data Structures Lerax 1.0.0
Essential Data Structures for C language
Loading...
Searching...
No Matches
bst.h
Go to the documentation of this file.
1
12
13#ifndef BST_H
14#define BST_H
15
21
22// definition of BinaryTree and struct node.
23#include "tree/binary-tree.h"
24
25/* Binary Search Tree DataType Definition */
26typedef struct BinaryNode BSTree;
27
28#ifndef Type
29#define Type BINARY_NODE_TYPE
30#endif
31
32#define BST_EMPTY (BSTree*) 0
33
34/* Função que cria um nó de uma Árvore */
36
37/* Função que cria uma Árvore Binária de Busca Vazia. */
39
40/* Testa se uma Árvore Binária é vazia. */
42
43/* Função que determina se um caractere pertence à Árvore. */
44int bst_exists(BSTree *t, Type c);
45
46/* Função que busca a sub-árvore que contém um inteiro. */
48
49/* Função que imprime os elementos de uma Árvore. */
51
52/* Função que retorna a altura de uma Árvore. */
54
55/* Função que insere um inteiro em uma Árvore. */
57
58/* Função que remove um inteiro em uma Árvore. */
60
61/* Libera o espaço alocado para uma Árvore. */
63
64/* Imprime a árvore linearmente em pós-ordem */
66
67/* Imprime a árvore linearmente em pré-ordem */
69
70/* Imprime a árvore linearmente de forma simétrica */
72
73/* Count the number of nodes */
75
76/* Return the number of leafs which are prime numbers */
78
79/* Return the number of nodes that has two children */
81
82/* Return the number of nodes which have equal branch heights*/
84
85/* Compare if t1 and t2 are equal by traversal tree search */
86int bst_equals(BSTree *t1, BSTree *t2);
87
88#endif
BSTree * bst_create_node(BSTree *left, BSTree *right, Type value)
BSTree * bst_create(void)
int bst_exists(BSTree *t, Type c)
BSTree * bst_remove(BSTree *t, Type c)
int bst_nodes(BSTree *t)
void bst_infix(BSTree *t)
int bst_equals(BSTree *t1, BSTree *t2)
int bst_two_children(BSTree *t)
int bst_height(BSTree *t)
void bst_free(BSTree *t)
struct BinaryNode BSTree
Definition bst.h:26
void bst_posfix(BSTree *t)
BSTree * bst_search(BSTree *t, Type c)
int bst_empty(BSTree *t)
int bst_leafs_primes(BSTree *t)
BSTree * bst_insert(BSTree *t, Type c)
void bst_prefix(BSTree *t)
void bst_print(BSTree *t)
int bst_nodes_equal_height(BSTree *t)
Definition binary-tree.h:23
BINARY_NODE_TYPE value
Definition binary-tree.h:24
struct BinaryNode * left
Definition binary-tree.h:26
struct BinaryNode * right
Definition binary-tree.h:27