I have a code class below which represents a node in a binary tree:
//btnode class
class btnode {
public:
btnode(int data): m_info(data), m_left(nullptr), m_right (nullptr) {}
btnode* get_left_btnode () { return this->m_left; }
btnode* get_right_btnode () { return this->m_right; }
int get_data () { return this->m_info;}
private:
int m_info;
btnode* m_left;
btnode* m_right;
};
I've a questions! how would it matter if i had members functions like follows:
btnode* get_left_btnode () { return m_left; }
btnode* get_right_btnode () { return m_right; }
int get_data () { return m_info;}
any other suggestion of how efficiently write this treenode will be helpful