This week talked more about Big-O. We can compare performance of algorithms by observing its behaviour over a large input. From best to worst: constant (c), logarithmic (clogn), linear (cn), quadratic (cn^2), cubic (cn^3), exponential (c2^n), and the worst case (cn^n or cn!). Big-O is the upper-bound so the previous listed times are part of each other. We talked about sorting too. There are many different kinds of sorting and there are also good sorting methods and inefficient sorting methods. Some of the sorting kinds are selection, quick, and merge.
In lab 8, we had to write an inorder traversal and longest path functions. It was hard to make the LLNode not list all its parent nodes when I just wanted the current node. Some people are so good at coding. They finish a lot faster than I do. I get discouraged, then I remember what I read sometime ago. "You can't be the best. There always will be someone who is smarter than you." I think this is supposed to make me feel better and motivate me to try my best. Not sure if it does that or just make want to give up.
No comments:
Post a Comment