Blog

What does Big-O Notation Sound Like?

Understanding time and space complexity is important when choosing between different algorithms. Time complexity is the amount of time an algorithm takes based on the length of the input. Space complexity is how much memory an algorithm requires based on the size of the input. Technically, there are worst case, average case, and best case scenarios for analyzing algorithms, but we typically consider the worst case scenarios. For worst case scenarios, we calculate the upper bound on the running time of an algorithm or the memory requirements. Big-O notation only considers the dominant term in the running time equation.

Read more

Listening to Running Sum of 1d Array

Running Sum of 1d Array

This is a Leetcode question that is asking users to create a running sum. Given an array of numbers, create a running sum of the array. For instance, if you have an array of nums = [1,2,3,4], then you would have a running_sum = [1,3,6,10] where you have [1, (1+2), (1+2+3), (1+2+3+4)].

I solved this problem by using a loop that takes each value in the array and adds it to the latest sum. It’s on the order of O(n) for time complexity and space complexity, in which I loop through each element of the array (n is the number of elements).

Read more

Arrays of Sounds

What are arrays?

Arrays are the most basic form of a data structure. There are actually two types of arrays, static and dynamic arrays. Python’s native array data structure is technically a dynamic array and is called a “list.” All that means is that we can keep adding to it without specifying ahead of time how large it should be. Elements stored in this list start with the index i , the position of the element in the list, of i =0, and the last position has index i =n -1, where n is the number of elements.

Read more

Creating a Substack on Music and Coding

man and woman sitting on chair in front of tablePhoto by Jess Zoerb on Unsplash

Subscribe now

A Tale of Two Passions

I am starting a substack out of the desire to finally merge my two passions: music and coding. In particular, I am a singer/songwriter and music producer as well as PhD statistician and data scientist. I have always studied music and math personally as long as I could remember and I have struggled to figure out how to make both work in my professional life. Now, I think I have figured it out with this substack.

Read more