Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <utility>
- using namespace std;
- class coordinate {
- public:
- coordinate(int, int, int, int, int, int, int, int, int);
- ~coordinate();
- private:
- int a, b, c, d, e, w, x, y, z;
- };
- coordinate::coordinate(int a, int b, int c, int d, int e, int w, int x, int y, int z) {
- this->a = a;
- this->b = b;
- this->c = c;
- this->d = d;
- this->e = e;
- this->w = w;
- this->x = x;
- this->y = y;
- this->z = z;
- }
- coordinate::~coordinate() {
- }
- typedef union data {
- int value;
- coordinate point;
- } Data;
- typedef enum type {
- v, p
- } Type;
- class Node {
- public:
- Node(Type, char, int, coordinate);
- private:
- Type type;
- Node* left;
- Node* right;
- Data data;
- char axis;
- };
- Node::Node(Type type, char axis = ' ', int value = 0, coordinate point = coordinate(0,0,0,0,0,0,0,0,0)) {
- this->type = type;
- switch(this->type) {
- case v:
- this->axis = axis;
- this->data.value = value;
- break;
- case p:
- this->data.point = point;
- break;
- default:
- break;
- }
- }
- class KDTree {
- public:
- KDTree();
- ~KDTree();
- void insert();
- private:
- Node* root;
- };
- KDTree::KDTree() {
- this->root = nullptr;
- }
- KDTree::~KDTree() {
- }
- int main()
- {
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement