Basic algorithms in Python, Javascript, and C++