It’s always the smallest things that can make your code not work!!
Today for me is was using less than
< instead of less than or equals
<=…as a result my binary search algorithm could only find its key in the top half of a sorted array, and returned
false if the sought value was in the bottom half. I’m glad I figured out that it was even working in any way–the original test failed–as this made it easier to narrow down what the problem was. In the end I got the function to search both halves correctly:
// If value is in an array return true, else return false
Next was writing a Game of 15 puzzle in C which can be played from the console. I hit so many brick walls I literally cannot write about or even think about this anymore! But I got it done : D
I came across a video of Mark Zuckerberg doing a Q&A at CS50 in 2005. It was interesting to hear him talk about what it was like building the first iterations of (The) Facebook–the data structures, size limitations, social concerns, etc. It’s long (one to watch on double time) but interesting!
The next CS50 lecture & homework set is all about working with memory, recovering data, etc. I know very little about this so interested to understand more.