Monday, September 6, 2010

Round Two

I was actually excited for a moment when I thought we had to post a sorting code for ASU101, as I've done it before and have some code saved from back then.  But no, I don't get to use some copy + paste for this post, and for that I am a slight sad.  Oh well.  So I think this post is supposed to be about whatever we want, right?  Just about stuff that's going on?  Alright, I can swing that.  So last night was pretty sweet; I went to a rush event for a frat with a friend, and there was a flowrider there.  At first I could not get it to work: I continuously fell hard on my ass (so many bruises), but after a while I began to understand, and toward the end I was standing up and flowridin' like a champion.  A few more runs on it and I could have gotten some tricks down, but time ran out so that didn't happen.  And now I have flowrider withdrawal.  Damn it.

2 comments:

  1. Hi Nick,

    I was hoping that you would give more reflections on the sorting algorithm, than flowrider.

    Please write a sorting algorithm. You can write it in words, best would be some sort of a pseudocode.

    -Aviral

    ReplyDelete
  2. I'm sorry, I was not properly following your blog posts at the time and had forgotten / misunderstood what the assignment was.

    In any case, here is the old sorting code (C++) I was alluding to in the original post:

    count = 1;
    while(count != 0)
    {
    count = 0;
    for(z=0; z<39; z++)
    {
    if(array_sorted[z] > array_sorted[z+1])
    {
    swap(array_sorted[z], array_sorted[z+1]);
    count++;
    }
    }
    }

    The code goes through the array, swaps any and all adjacent numbers out of ascending order, and if there was a swap done in the loop it is done again until there were no swaps performed.

    I'm inclined to think that this is code that has an upper bound of n! time to complete, so not too efficient, but it was my first attempt at sorting, and I still like it in concept.

    I hope this is sufficient for you, and sorry again about posting things that were irrelevant to the actual assignment.

    ReplyDelete