Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct TreeNodeBase
- {
- int color;
- TreeNodeBase *parent;
- TreeNodeBase *left;
- TreeNodeBase *right;
- };
- struct TreeNode : public TreeNodeBase
- {
- double value;
- };
- struct Tree
- {
- TreeNodeBase header;
- unsigned long node_count;
- };
- extern void side_effect(Tree *);
- double write_eps(int n)
- {
- Tree cells;
- cells.node_count = 0;
- cells.header.color = 0;
- cells.header.parent = 0;
- cells.header.left = &cells.header;
- cells.header.right = &cells.header;
- for (int i = 0; i < n; ++i)
- {
- side_effect(&cells);
- }
- return static_cast<TreeNode*>(cells.header.left)->value;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement