#include <vector>
#include <string>
#include <algorithm>
#include <iostream>
#include "Node.h"

using namespace std;

bool comparitor (Node x, Node y) {
  if (x.getNum() < y.getNum()) {
    return true;
  }
  else if (x.getNum() == y.getNum()) {
    if (x.getName() < y.getName()) {
      return true;
    }
    else {
      return false;
    }
  }
  else {
    return false;
  }
}

int main() 
{
	vector<Node> testVect(0);

	Node newNode1("One", 1);
	testVect.push_back(newNode1);
	Node newNode2("Two", 2);
        testVect.push_back(newNode2);
	Node newNode3("Three", 2);
        testVect.push_back(newNode3);
	Node newNode4("Four", 4);
        testVect.push_back(newNode4);
	Node newNode5("Five", 2);
        testVect.push_back(newNode5);
	Node newNode6("Six", 6);
        testVect.push_back(newNode6);
	Node newNode7("Seven", 3);
        testVect.push_back(newNode7);
	Node newNode8("Eight", 8);
        testVect.push_back(newNode8);
	Node newNode9("Nine", 9);
        testVect.push_back(newNode9);
	Node newNode10("Ten", 3);
        testVect.push_back(newNode10);

	sort(testVect.begin(),testVect.end(), comparitor);
	
	vector<Node>::iterator it;
	for (it = testVect.begin(); it != testVect.end(); it++) {
	  cout << *(it);
	}

	return 0;
}
