#ifndef __DSET__
#define __DSET__

#include <iostream>
#include <vector>

class dset
{
 public:
  struct descriptor
  {
    double data;
    unsigned int id;
  };
  dset();
  ~dset();
  int insert(unsigned int id, double amount);
  int print();
  std::vector< std::pair<float, unsigned int> > desclist();
  int clear();
 private:
  struct dnode
  {
    descriptor data;
    dnode *left;
    dnode *right;
  };
  int rm(dnode *n);
  int insert(dnode **n, unsigned int id, double amount);
  int print(dnode *n);
  int print(dnode *n, std::vector< std::pair<float, unsigned int> > &dlist);
  int degree;
  int numnodes;
  int leaves;
  int depth;
  dnode *datatree;
};

#endif
