CS205 Assignment 2
assign2_tree.hpp
1#pragma once
2
3#include <cstdint>
4
5struct tree_node {
6 tree_node *father;
7 tree_node *l_child, *r_child;
8
9 uint32_t node_count;
10 uint32_t tree_count;
11
12 uint64_t data;
13};
14
15struct BST {
16 tree_node *root;
17
26 int (*comp)(uint64_t, uint64_t);
27};
Definition: assign2_tree.hpp:15
int(* comp)(uint64_t, uint64_t)
Definition: assign2_tree.hpp:26
Definition: assign2_tree.hpp:5
uint32_t tree_count
the size of the subtree (including the root)
Definition: assign2_tree.hpp:10
uint32_t node_count
the number of occurrences of a certain data (repetation count)
Definition: assign2_tree.hpp:9
uint64_t data
only save 8-bytes width memory for the data of any representation
Definition: assign2_tree.hpp:12