On the other side of the coin, binary search. The concept of binary search seems like it could be a very powerful tool in many situations, not just to combine elements of mathematical expressions. I would imagine the features that are tied into folders, that we take for granted, are tied into binary search. This weeks lab didn't go as smooth as I would normally expect. I assume it was due to the fact that my previous intuition of recursion is still lacking in some parts. One of the questions asked us to create a method called 'list_longest_path'. I had a hard time figuring out how the algorithm works since I repeatedly questioned how I would search two branches at the same time. and figure out which branch held the longest path. In the end, after asking the TA, I slowly applied an algorithm I assumed would work which lead to a common problem that I have with computer science, which is: 'My code works, but I have no idea why.' The methods afterwards were also challenging as there were many possible outcomes that had to be taken into account, which, again, took me a long time to figure out but in the end, the method only worked for the given example, and not all possibilities. I should probably revisit this lab specifically, again, on a later date.
No comments:
Post a Comment