#ifndef BTREE_H
#define BTREE_H

struct Data {
  int key;
  int value;
};

struct Node {
  Data data;
  Node *leftChild;
  Node *rightChild;
  Node *parent;
};

class Btree {

public:
  Btree();
  int addValue(int, int);
  bool getValue(int, int&);
  bool getMinKey(int&);
  bool getNext(int&);

protected:

private:
  Node *createNode(int, int);
  int insert(Node *, int, int);
  bool get(Node *, int, int&);
  bool getMin(Node *, int&);
  bool getN(Node *, int&);
  void setRootParent(Node *);
  bool isRootNode(Node *);
  Node *rootNode;

};

#endif
