Data Structures And Algorithms Studying in C++
Overview
This is just studying for coding interviews. It loosely follows "Cracking the
Coding Interview" by Gayle Laakmann McDowell. The code is structured by keeping
the implementations in the lib
directory and the study questions in the tests
directory. The build system, meson
, supports pulling down other projects and integrating them. CPPUTEST is pulled down with a wrap file.
Initialization
Toolchain
I use devbox
to handle the toolchain dependencies. If you have not installed
it, I have found it best to first install Nix via the Determinate Systems
installer and then use the Jetify Devbox installer:
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install
curl -fsSL https://get.jetify.com/devbox | bash
After that just run the following in a shell from this directory:
devbox shell
On the first run it will take a few minutes to install the required packages and their dependencies. On subsequent runs it should be pretty fast.
The Build System (Meson)
Initialize build directory and pull down the sub projects via the meson "wrap" feature:
meson setup build
Testing
To run the tests:
meson test -C build