Day 10: I’m Not Afraid Anymore of Recursion

Made my second or third attempt at solving practice problem eleven. I was able to apply everything that I have learned thus far and I think I have the answer, BUT I still have one big question to answer. It is related to the generic formula for calculating time complexity for recursive algorithms and how that formula is constructed from a logical stand point.

TLDR;

Okay, so here are the highlights of what I did:

  • Still reading through the book “Cracking the Coding Interview” by Gayle Laakmann McDowell. Attempted to solve practice problem eleven again. I have already forgotten the answer so, although I am familiar with the code, I only vaguely remember what the answer is supposed to be. So far it actually isn’t that difficult of a problem but I am stuck trying to confirm the logical derivation for the generic algorithm O(branches^depth) for calculating time complexity for recursive functions. In the previous example the solution was more complicated than this simple formula. It’s in that difference that I have to ask what was the same. The logic should have been consistent between the two problems and that similarity lead to a different logical conclusion. The generic formula makes sense but I still feel like something is missing. Before I check my answer for problem eleven I need to know what is going on. To me this is like an algebra equation where we can just plug our solution back into the equation to see if we get a valid result. Likewise, if the logic is consistent with our process for deriving the answer we should be correct. Hopefully that makes sense. I could just be using “logic” as a placeholder for “magic” lol. Tomorrow is when I will find out if I am on to something or I am just talking nonsense.
  • Continued going through a YouTube video on Big O Notation from the G.O.A.T. freeCodeCamp. It’s a 2 hour video I might glean some new information from the video so I figure why not.

Conclusion

That’s all for today. This is my sixth round of the “#100daysofcode” challenge. I will be continuing my work from round five into round six. I am currently working through the book “Cracking the Coding Interview” by Gayle Laakmann McDowell. My goal is to become more familiar with algorithms and data structures. This goal was derived from my goal to better understand operating systems and key programs that I use in the terminal regularly e.g. Git. This goal was in term derived from my desire to better understand the fundamental tools used for coding outside of popular GUIs. This in turn was derived from my desire to be a better back-end developer.

I have no idea if my path is correct but I am walking down this road anyways. Worst case scenario I learn a whole bunch of stuff that will help me out on my own personal projects.