Wednesday 2 April 2014

Sorting and Efficiency

    This week we learned about sorting and efficiency. This involves many different solving algorithms as well as something called "the Big O", which I learned is basically a representation of a methods run time. Since no one computer runs at the same speed and thus will have different run times for the same method, it is important to have a different way to represent how long a function will take to compete its job. This is where Big O comes in. It is away of describing run time using functions.

basic functions of Big O:
    c < lg(n) < n < n^2 < n^3 < 2^n < n! < n^n
    (Note: lg(n) refers to log base 2 of n)

The basic idea is that the further left your representation is, the smaller your run time will be. 

Of all of the sort types that Danny showed us this week I only knew a few. From CSC108 I knew Quick sort. Here is a list of the names of the sorting algorithms and a description of the way they operate:

  • Quick sort:
    • Idea: choose a pivot; decide where the pivot goes with respect to the rest of the list, repeat on the partitions
    • Big O: n^2
  • Merge sort:
    • idea: divide the list in half, (merge) sort the halves, then merge sort the results.
    • Big O: lgn
  • Count sort:
    • Danny wrote this sort, I'm not sure
  • Tim sort:
    • This is the sorting algorithm used by python, I don't know how this one works either but its fast.
Out of all these sort types Tim sort was the fasted, then count sort, then merge, then quick.

Sorting is quite relevant to the the specialist I am choosing. I am going in to Geophysics, and writing a sorting algorithm to take data I pull out of the ground with my equipment is essential to being able to interpret it.

Sunday 23 February 2014

Reading Week

So my reading week was a lot of fun. I didn't get as much work as id hoped to get done, but that's life. Over the week I tried to do my best to study and review for the midterm coming up this Wednesday. I have yet to attempt the practice tests, that i'm leaving for tomorrow night. I reviewed the slides for the past month and a half (already that long?!) and made sure I had an in-depth understanding of objective code writing at the very least. not much else to report really. I hate explaining things over the internet or things like this, it just seems so feeble compared to in-person communication. 

On another note, still waiting for assignment 1 grades. I realized as always that marking takes time, but I always hated how teachers/profs give new assignments when they haven't handed the previous assignments back. Anyways I've read assignment 2 and plan on starting it soon. I don't want to make the same mistake I made for assignment 1, where I waited too long to get some solid hours of work into it, which resulted in me only being able to complete about 75% of it (excuse the run-ons). But since this one is broken in to parts i'm hoping that I will be much more successful. 


Anyways that's me, posting again in the next few days, maybe after the test so i can talk about that along with recursion.

SLOGLORD3000

Sunday 9 February 2014

Week 5: A lot of Stuff and Such

    Hello everyone! Sorry for the silence last (almost two ago) week! The midterm struggle is real. So not much really to talk about this week, other than the assignment 1.

    TOAHModel seems to be presenting a rowdy challenge, but over all i think will end well. My largest complaint about it is how its presented to us ( "us" being the students of CSC148). The way it seems to me the instructions are vague and to not pose much help. From my perspective actually, I would  almost be better of without the instructions Danny gave us. I understand the problem perfectly well (the big cheese not going on the small cheese, representing the stools either as dictionaries or as nested lists), it just seems as though there was a slice of hints, for lack of a better term, missing. I do understand that there needs to be a difficulty increase from the CSC108 assignments, but this just confused me. Either way after probably around 15 hours working on it with my partner, we figured some of it out. Still not done though.

    Anyways, I checked out my friends SLOG and i noticed she writes probably 6 small paragraphs. That seems a little excessive to me, but I guess I'm not a natural born SLOGGER (Contrary to the title of this slog, of course). Don't get me wrong, programming is very interesting to me and I know its going to be imperative to my future, but there are a few other things id rather be doing... like kickboxing, sleeping, and eating to name a few.

Finally, I'll say good bye! until next week! (just wait if I'm still up ill cut my losses and post one in 40 minutes haha)

Love,

SLOGLORD3000


Tuesday 21 January 2014

Week 3: Object-Oriented Programming

For starters, how are all of zero of my followers/readers/whatever you are? I hope your sitting in a comfy position, because everybody deserves a comfy position to sit in. The Boss-man says I need to talk about object-oriented programming today, so i shall. Exciting, I know. I guess I should start by admitting something: I was horrible at programming this way (I guess programming in general) about a week ago. But something magical happened over the weekend, which refreshed my memory, restoring those old archives I had forgotten about. I am of course talking about the revamp. Yes, I went to that and now I am fairly confident i can write a nice line of code, with much of the required laziness that Danny-boy was talking about. Hallelujah.

And with that short paragraph, I bid thee Adieu.

Love,

SLOGLORD3000