CP4 Free Source Code Project (cpp/gnu++17, java/java8, py/python3, and ml/ocaml)
All code in this repo are mostly (reasonably good, hopefully :) implementation of well-known data structures and algorithms, so you are free to copy, adapt, use the code.
This license probably the most suitable: https://creativecommons.org/licenses/by/4.0/