fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. // Node structure
  5. class Node {
  6. public:
  7. int data;
  8. Node* left;
  9. Node* right;
  10.  
  11. Node(int value) {
  12. data = value;
  13. left = right = nullptr;
  14. }
  15. };
  16.  
  17. int main() {
  18. Node* root = nullptr;
  19.  
  20. if (root != nullptr) {
  21. cout << "Tree is not empty";
  22. }
  23. else {
  24. cout << "Tree is empty";
  25.  
  26. }
  27. return 0;
  28. }
Success #stdin #stdout 0s 5308KB
stdin
Standard input is empty
stdout
Tree is  empty