c++ - AVL Tree implementation with nodes or without nodes -


we have class project implement avl tree. here 2 general implementations:

template<class t> class avltree {   int key;   int height;   int bf;   t data;   avltree<t>* father, leftson, rightson; . . . } 

a friend told me should use nodes wasn't able explain why. here second implementation have seen in many places (using node):

template<class t> class avltree {   int key;   int height;   int bf;   t data;   node* father, leftson, rightson;    class node {     int key;     int height;     int bf;     t data;     node* father, leftson, rightson;   } . . . } 

what's difference? implementation impossible in terms of compiler?

technically, right , nodes not necessary, though remember c++ oop language, , object want avltree, consisted of nodes.


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -