Binary Search Tree (C++)
Loading...
Searching...
No Matches
Node.h
Go to the documentation of this file.
1
16
17#pragma once
18
19#ifndef NODE_H
20#define NODE_H
21
34
35class Node {
36public:
41 Node(int value);
42
46 int getValue() const;
47
52 void setValue(int value);
53
58 Node* getLeft() const;
59
65 void setLeft(Node* left);
66
71 Node* getRight() const;
72
78 void setRight(Node* right);
79
80private:
81 int value;
82 Node* left;
83 Node* right;
84};
85
86#endif // NODE_H
Node * getRight() const
Returns a pointer to the right child node.
Definition Node.cpp:52
Node(int value)
Constructs a Node with the specified integer value.
Definition Node.cpp:20
void setLeft(Node *left)
Sets the pointer to the left child node.
Definition Node.cpp:46
void setValue(int value)
Sets the stored integer value.
Definition Node.cpp:32
void setRight(Node *right)
Sets the pointer to the right child node.
Definition Node.cpp:59
Node * getLeft() const
Returns a pointer to the left child node.
Definition Node.cpp:39
int getValue() const
Returns the stored integer value.
Definition Node.cpp:25