Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma once
- #include <iostream>
- template<class T>
- class Node{
- public:
- Node<T> *left;
- Node<T> *right;
- T data;
- unsigned int height;
- Node(const T &data, Node<T> *left = nullptr, Node<T> *right = nullptr): data(data), left(left), right(right),
- height(1 + std::max((left? left -> height:0), (right? right -> height:0)))
- {};
- };
Advertisement
Add Comment
Please, Sign In to add comment