Day 95: Finally Got a Question Wrong! NO!!

Well I got a bit too cocky and made a simple mistake. I completed questions seven and eight with the correct answers. Unfortunately when I pushed on to try and solve question nine I stumbled. Luckily it was only a simple mistake that I completely understand so there will be no rabbit hole diving this time. I corrected the mistake and I can now move on.

TLDR;

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

  • Still reading through the book “Cracking the Coding Interview” by Gayle Laakmann McDowell. Still working on the practice problems. Completed questions seven, eight, and nine. Questions seven and eight were dealing with binary trees and were fairly straightforward. However question eight dealt with an algorithm for appending values to an array of integers. I had performed well up until the final tallying for the runtime. I ended up mistaking the sum for all the copying processing to be the cost for each iteration of the loop. This lead me to calculate a runtime cost of n^3 instead of the correct value of n^2 . It sucks that I finally got a question wrong but at least it was just a small mistake that I understood immediately and was able to correct. Eight out of nine is not a bad score. Hopefully I can bounce back with the remaining questions and get a near perfect score.

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!