[May 5 - May 12]

C++ backend for Binary Trees and setting up the repo for building my code correctly


Getting started

This week was all about getting familiarized with Python-C API, the thing I will be using for my project in GSoC 2024. I started by reading some blogs about extending Python with C++, making a class object structure and referred to the documentation for examples, reference code and necessary functions.

I started writing some basic code for Binary Trees and got myself familiarized with the structure and logic followed in the Python implementation of the same. Moreover, this week’s work also involved knowing how to correctly build the library for development, writing scripts and placing code files at the perfect location.

Relevant PRs:

The following PR was merged: #553

This PR successfully solved and closed the issue: #552

I also worked on the PR: #556

I created a prototype for binary trees in this commit (which is intentionally changed in the PR later): Prototype commit for Binary Trees

As mentioned above, I made another commit to overwrite that commit. This commit aligns the structure with the Python implementation of Binary Trees: Binary Trees

Here is the progress tracker for the next few weeks: #554

This is going to be a long PR with a lot more work to do. In the coming week, I will add C++ backend for Classes like Node, TreeNode and ArrayForTrees.

Learnings/Difficulties

I learned how to extend Python with C++, which boosts the speed and functionality. Being a beginner in Python-C API, I understood how to manage references, allocate and deallocate memory for members and write good stuctured code following principles of object oriented programming.

I faced a few import errors while building (mostly because some script was missing or the code was not at the proper position), but in the end, all were successfully solved.


Thanks to my mentor: Gagandeep Singh, for helping me get started and guiding me.

See you next week with more progress! :)