Started working on the practice problems and I’m two for two BABY!!! These two have been pretty easy problems but I’m just stoked that I got them right. There are twelve questions in total. So I hope I can keep the streak alive as the problems become more difficult.
TLDR;
Okay, so here are the highlights of what I did:
- Still reading through the book “Cracking the Coding Interview” by Gayle Laakmann McDowell. Started the practice problems for calculating Big O runtime values. I completed the first two questions out of the twelve. I got them both right. They were simple questions to be fair. The first question had a simple for loop that iterated for the same number of times as one of the parameters passed into the function. The process that occurred on each iteration performed at constant time so the function had a total runtime of
O(b)
. The second example dealt with a simple recursive function. It had the same runtimeO(b)
since it would recursively call itself for the same number of times as theb
parameter passed into it. All the other processes in the function ran at constant time so they could be ignored. The biggest positive for me was that I followed a clear process. I noted all the individual processing costs, then added them up, and finally, followed the Big O notation rules for simplification. I hope that, by following this process I will not make simple mistakes as I start to work on more challenging problems.
Conclusion
That’s all for today. If you are interested in the MIT course you can check out the video lecture I’m currently going through. The lecture is helpful but isn’t sufficient by itself. Anyways, until next time PEACE!