https://github.com/bornalgo/binarytree
Binary Tree: Sample C++ code inspired by LeetCode
https://github.com/bornalgo/binarytree
argument-parsing bash batch binary-tree ci-cd cmake compiler cpp generator make makefile schematic
Last synced: 5 months ago
JSON representation
Binary Tree: Sample C++ code inspired by LeetCode
- Host: GitHub
- URL: https://github.com/bornalgo/binarytree
- Owner: bornalgo
- License: mit
- Created: 2023-04-23T19:35:45.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-05-10T03:31:14.000Z (almost 3 years ago)
- Last Synced: 2025-07-15T20:15:58.593Z (8 months ago)
- Topics: argument-parsing, bash, batch, binary-tree, ci-cd, cmake, compiler, cpp, generator, make, makefile, schematic
- Language: C++
- Homepage:
- Size: 50.8 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Binary Tree
## _Sample C++ code inspired by [LeetCode](https://leetcode.com/)_
[](../../../TextAnimator)
BinaryTree is a library inspired by [Maximum Width of Binary Tree](https://leetcode.com/problems/maximum-width-of-binary-tree/) and
[Print Binary Tree](https://leetcode.com/problems/print-binary-tree) questions.
## Features
- Creates schematic of a binary tree
- Evaluates the maximum width of a binary tree
- Converts a vector to a binary tree
- CMake is used to build the library
- [Batch script](buildWindows.bat) can be executed to create the make file and build the program in Windows
- [Bash script](buildLinux.sh) can be executed to create the make file and build the program in Linux
- more to come ...
## Prerequisites
- g++ or any C++ compiler
- cmake
- make
## Build
### Windows
Execute the following command
```bat
.\buildWindows.bat
```
The following additional options can be provided
```
-source [SOURCE] : source directory
-build [BUILD] : build directory excluding operating system
-generator [GENERATOR]: generator for cmake
-compiler [COMPILER] : compiler for cmake
-make [MAKE] : make executable
-vcvarsall : path to vcvarsall.bat to set the environment variables for visual studio
* : any cmake arguments
-- * : any make arguments
```
### Linux
Execute the following command
```sh
./buildLinux.sh
```
The following additional options can be provided
```
-source [SOURCE] : source directory
-build [BUILD] : build directory excluding operating system
-generator [GENERATOR]: generator for cmake
-compiler [COMPILER] : compiler for cmake
-make [MAKE] : make executable
* : any cmake arguments
-- * : any make arguments
```