Sample C++ code inspired by LeetCode
BinaryTree is a library inspired by Maximum Width of Binary Tree and Print Binary Tree questions.
- 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 can be executed to create the make file and build the program in Windows
- Bash script can be executed to create the make file and build the program in Linux
- more to come ...
- g++ or any C++ compiler
- cmake
- make
Execute the following command
.\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
Execute the following command
./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