Sunday, March 30, 2014

during this week, lectrues were about sorting algorithm. also in the lab, different sorting method run for sorting already sorted list, random list and sorted but reversed list.
   there are some very basic sorts: selection sort, insertion sort, bubble sort, merge sort, quick sort and bulit_in sort.we do have some touch down during 
 CSC108, we learned three O(n^2) algorithms: bubble sort, insertion sort and selection sort. then in CSC148, there are more effencient way of sortinbg quicksort(O(n log n)), merge sort(O(n log n)), count sort(O(n) but it has preconditions), Tim sort(O(n log n), used in Python built-in sorting method)


there is a cheat chart for helping remember
Big-Oh
MergesortQuicksortInsertionsortSelectionsortBubblesort
BestCase
O(nlgn)O(nlgn)O(n)O(n^2)O(n^2)
AverageCaseO(nlgn)O(nlgn)O(n^2)O(n^2)O(n^2)
WorstCaseO(nlgn)O(n^2)O(n^2)O(n^2)O(n^2)

Friday, February 28, 2014

    From week 4 till now, the class have been focused on recursion a lot. Most of the time we have been trying to understand and be able to use recursion.
    So, what is recursion?
    I'll provide a example:
    def re(s:lst):
        for i in s
            if i == []:
                return True
            elif i.isinstance(i,list):
                re(i)
            else:
                pass
        return False


this is a simple example of recursion. it checks if there is a empty list in the big list, and will return True if there is. if there is a list in the big list, it will rerun the function re again.

    Basically recursion is calling the function inside the function.

Sunday, February 2, 2014

Week four

In this week we focused on recursive functions. we traced through a couple recursive functions, one that found the level of nesting within a list and another that used turtles to draw fractalsalso in class we examined a program that used turtles to draw a simple fractal pattern we referred to as a tree burst. 
Also i want really wanna say thank you to my lab partner, he helped me with a lot of understanding of the material.


Wednesday, January 22, 2014

 object-oriented programming
 what is object-briented programming?
        
           I think basicly oop is a big idea of designing class. It allows to process imformations. We as user can use class and design different method to process data we stored.
         
          Class is like the big picture, the overall view of something big, and object is what the class is make off, its like paint for a picture. Or in other words, class is a company, object different department for th company, is what make up the company. Then there is method, method is how object work, or as a whole, how the class work.
          
          I think what we learned befor, is the basic skill of creating or desing method. It is like us, we are learning skills that is necessory for us to work in conpamy(class) in feature.

post for week 3 @ 20:01 jan/22/2014

Monday, January 20, 2014

A test post for csc 148
tmd tyw
date 2014/1/20
time 21:30
topic in class: class
the end