Universidad de Costa Rica

Escuela de Ciencias de la Computación e Informática

CI-0118 Lenguajes ensambladores

Ejemplos

CI0118 / ejemplos / Semana-13 / BinTrees


/**
  *  Binary tree C++ implementation
  *
  *  Author: CI0118 g3
  *  Date:	2023-ii
  *
 **/

#include <cstddef> 
#include "BinNode.h"


BinNode::BinNode() {

   this->left = NULL;
   this->right = NULL;   
   this->key = -1;

} 

int BinNode::getKey() {

   return key;

}


BinNode * BinNode::getLeft() {

   return this->left;

}


BinNode * BinNode::getRight() {

   return this->right;

}


void BinNode::setKey( int key ) {

    this->key = key;

}


void BinNode::setLeft( BinNode * node ) {

   this->left = node;

}


void BinNode::setRight( BinNode * node ) {

   this->right = node;

}