Saturday, March 26, 2016

Algorithms and Assignment 2 [Week 10]

I recently got my midterm back and did pretty well. The only reasons I lost a couple points was for overlooking some syntax errors in my code and misreading one of the questions where I was supposed to take care of one of the cases when writing the linked-list function. Those were only minor errors I had my midterm since I knew how to write the solutions for all aspects of the midterm. Luckily, these skills will come in handy for the final exam since I'll need that to fix my dud in Assignment 2.
Speaking of Assignment 2, I did have some major trouble trying to implement the puzzle_tools.py functions. I could figure out how to traverse the puzzle nodes iteratively through both searches, but I couldn't figure out how to make a unique path from a puzzle configuration to a solution (if it exists). 


To put it in picture terms (image above), I know how to print the path process from A to C in this picture (ABDFEC for example in depth first search), but after traversing the tree, I don't know how to get the actual path (AC in this picture). For the extension functions, I also forgot to put cases where the puzzles that are already solved should return no extensions for the grid peg solitaire and the word ladder puzzle. I assume that's why when I tried to run the puzzle_tool functions on those classes, the programs did not terminate. I'll have to clarify those problems in the interview part of Assignment 2. From now on, I'm going to organize my time more when a similar assignment like this comes up.
Other than that, algorithms and big-O's were not very hard to understand since in CSC165, we have already had a lot of practice tracing code to evaluate the worst-case complexities. I'll have to see more examples next lecture to get a feel for how CSC148 treats algorithm complexities.

No comments:

Post a Comment