Week 2

During the second week of my research internship I did more research on different algorithms. I watched videos and looked on several websites for more clarification. After my research I started on my first task: implementing a heap sort algorithm in a stencil provided by Professor Jenkins. The code I had to write had to sort randomly generated numbers from smallest to largest number. I started by looking up websites which showed and explained code where they implemented minheaps. By looking at the code they used I got an idea of what I had to do to get started. There was one website in particular which explained the minheap sort very well and I was able to use parts of that code with the right alterations. Some of the math parts I had to implement for the minheap took some time to fully understand. The minheap had two main functions: the minheap_insert and the minheap_extract function. The insert function was pretty straightforward except from the math part, but the extract part turned out to be a bit more of a challenge. For the extract function I had to add code add code to make the function extract the right to have the lowest number extracted first. This involved math and the math I found in the code online was hard to understand at first. After I familiarized myself with the math I had to shuffle some code around and after that my sort algorithm worked! It was very exciting to see something you coded actually work and do what you want it to do.

Another element that took some time to get used to was the language I needed to write my code in. The template provided was written in JavaScript, which I had never worked with before. I have had Java in my intro classes but that was about it. I watched some videos and read some of the basic principles of the language and after that it was pretty easy to get familiar with the language and the code in the template.

After I finished my minheap sorting algorith and showed it to my group in one of our daily meetings, I got started on working on the A-Star sorting algorithm. Professor Jenkins also provided a template for this code, only this one was much longer than the minheap stencil. I started by looking up A-star algorithms online and started to familiarize myself with the code. I also talked to some of the people in my group on how to get started, since some of the people did the stencil in Professor Jenkins’ class. They helped me on my way and I started to work through the stencil.

Written on June 10, 2020