# rzhyv/binary-trees architecture

> Architecture diagram of the GitHub repository rzhyv/binary-trees, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rzhyv/binary-trees
- Repository: https://github.com/rzhyv/binary-trees

## Overview

This is a single-file C++ expression-tree exercise. Its apparent user workflow is to read an expression, build a tree, display traversals, and evaluate it. The excerpt contains compile-time and logic inconsistencies, so the graph reflects the intended responsibilities visible in the code, not a confirmed working execution; there is no README or evidence of other product capabilities.

Main entry points: [`pptCodes.cpp`](https://github.com/rzhyv/binary-trees/blob/main/pptCodes.cpp) (Program Entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_expression["Expression Trees"]
  node_main["Program Entry<br/>[pptCodes.cpp]"]
  node_builder["Tree Builder<br/>[pptCodes.cpp]"]
  node_evaluator["Tree Evaluator<br/>[pptCodes.cpp]"]
  node_traversals["Tree Display<br/>[pptCodes.cpp]"]
end

subgraph group_structures["Tree Structures"]
  node_tree["Expression Tree<br/>[pptCodes.cpp]"]
  node_operators["Operator Stack<br/>[pptCodes.cpp]"]
  node_nodes["Node Stack<br/>[pptCodes.cpp]"]
end

node_user(("User"))

node_user -->|"enters expression"| node_main
node_main -.->|"builds tree"| node_builder
node_builder -->|"uses operators"| node_operators
node_builder -->|"assembles nodes"| node_nodes
node_builder -->|"creates tree"| node_tree
node_main -.->|"displays traversals"| node_traversals
node_main -.->|"evaluates tree"| node_evaluator
node_evaluator -->|"reads nodes"| node_tree
node_traversals -->|"visits nodes"| node_tree

click node_main "https://github.com/rzhyv/binary-trees/blob/main/pptCodes.cpp"
click node_builder "https://github.com/rzhyv/binary-trees/blob/main/pptCodes.cpp"
click node_evaluator "https://github.com/rzhyv/binary-trees/blob/main/pptCodes.cpp"
click node_traversals "https://github.com/rzhyv/binary-trees/blob/main/pptCodes.cpp"
click node_tree "https://github.com/rzhyv/binary-trees/blob/main/pptCodes.cpp"
click node_operators "https://github.com/rzhyv/binary-trees/blob/main/pptCodes.cpp"
click node_nodes "https://github.com/rzhyv/binary-trees/blob/main/pptCodes.cpp"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_main,node_builder,node_evaluator,node_traversals,node_user toneBlue
class node_tree,node_operators,node_nodes toneAmber
```

## Components

### Expression Trees

- [Program Entry](https://github.com/rzhyv/binary-trees/blob/main/pptCodes.cpp): `pptCodes.cpp`
- [Tree Builder](https://github.com/rzhyv/binary-trees/blob/main/pptCodes.cpp): `pptCodes.cpp`
- [Tree Evaluator](https://github.com/rzhyv/binary-trees/blob/main/pptCodes.cpp): `pptCodes.cpp`
- [Tree Display](https://github.com/rzhyv/binary-trees/blob/main/pptCodes.cpp): `pptCodes.cpp`

### Tree Structures

- [Expression Tree](https://github.com/rzhyv/binary-trees/blob/main/pptCodes.cpp): `pptCodes.cpp`
- [Operator Stack](https://github.com/rzhyv/binary-trees/blob/main/pptCodes.cpp): `pptCodes.cpp`
- [Node Stack](https://github.com/rzhyv/binary-trees/blob/main/pptCodes.cpp): `pptCodes.cpp`

### Other components

- **User**

## Connections

- User → Program Entry: enters expression (evidence: `pptCodes.cpp`)
- Program Entry → Tree Builder: builds tree (evidence: `pptCodes.cpp`)
- Tree Builder → Operator Stack: uses operators (evidence: `pptCodes.cpp`)
- Tree Builder → Node Stack: assembles nodes (evidence: `pptCodes.cpp`)
- Tree Builder → Expression Tree: creates tree (evidence: `pptCodes.cpp`)
- Program Entry → Tree Display: displays traversals (evidence: `pptCodes.cpp`)
- Program Entry → Tree Evaluator: evaluates tree (evidence: `pptCodes.cpp`)
- Tree Evaluator → Expression Tree: reads nodes (evidence: `pptCodes.cpp`)
- Tree Display → Expression Tree: visits nodes (evidence: `pptCodes.cpp`)
