-
Notifications
You must be signed in to change notification settings - Fork 0
/
Expressions.h
45 lines (39 loc) · 944 Bytes
/
Expressions.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#pragma once
#include <string>
#include <iostream>
class treeNode
{
public:
treeNode(const std::string &str);
virtual void printNode() = 0;
virtual std::string &getNodeValue();
private:
std::string nodeValue;
};
class binaryNode: public treeNode
{
private:
binaryNode *leftPtr, *rightPtr;
void printBinaryTree(std::string &res, binaryNode *ptr, std::string padding, std::string pointer);
public:
binaryNode(const std::string &currNodeVal, binaryNode *lptr, binaryNode *rptr);
void printNode();
binaryNode(const std::string &currNodeVal);
// binaryNode(integerNode ptr);
};
class integerNode: public binaryNode
{
private:
public:
integerNode(int val);
int getIntegerNodeValue();
void printNode();
};
class Expression: public treeNode
{
private:
public:
void printNode()
{
}
};