Wednesday, 25 March 2015

Lab 10, sorting

Today's post will not be about big O... which is what we learned in class. It will be more about sorting algorithms which is this week's lab.

I think the most interesting thing about this week's lab could be the intro to various sorting algorithms (more so than the big O). Diane talked about merge sort and maybe several other sorting algorithms were covered in the prerequisite course (csc108), but either I forgot or never learned so they are not very fresh in my mind. The labs have really interesting concepts, but it's too much boring work recently... so I end up getting the gist of doing them and just spending my time analyzing the implications. Anyhow, while "learning" about some of these, I came across a super cool visualization of various algorithms that instantly taught me about it in a sense.

overall in this lab, we should have seen that it's not just the number of loops you go through, but also what operations you do in it. I think this is somewhat trivial. When I code, I have been aware of this and even if it may save some lines, I often say A = function(), if I know I will need A more than once. An obvious implication of this that I hadn't considered before is the memory that I am using.

One cool thing was the profile_comparisons() method... It uses cProfile module to findout about all the function calls. Now... where might that come in handy??? I think anyone who read some of my previous posts would realize that this would solve (at least partly) the testing of pruning. Whether I will end up doing that instead of trying to make my own other "minimax improvements"... I'm not sure. At the moment, I have several ideas in mind that could potentially further improve the runtime. I will write about this in my next post, since I want to keep things somewhat organized...

I will update this post later ... (I ended up digressing and writing about minimax again -_-)

No comments:

Post a Comment