Binary tree of fractions
Will be used in creating the cw tree.
This commit is contained in:
14
src/main.cpp
14
src/main.cpp
@@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
#define MIN(A, B) ((A) < (B) ? (A) : (B))
|
#define MIN(A, B) ((A) < (B) ? (A) : (B))
|
||||||
#define MAX(A, B) ((A) > (B) ? (A) : (B))
|
#define MAX(A, B) ((A) > (B) ? (A) : (B))
|
||||||
@@ -73,6 +74,19 @@ struct Fraction
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct Node
|
||||||
|
{
|
||||||
|
Fraction value;
|
||||||
|
Node *left, *right;
|
||||||
|
|
||||||
|
Node(Fraction val, Node *left = nullptr, Node *right = nullptr)
|
||||||
|
: value{val}, left{left}, right{right}
|
||||||
|
{
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
std::vector<Node> nodes;
|
||||||
|
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
puts("Hello, world!");
|
puts("Hello, world!");
|
||||||
|
|||||||
Reference in New Issue
Block a user