CST370 Design and Analysis of Algorithms Week 1

 This week I learn about general knowledge about algorithm. Basically an algorithm is a sequence of order/instruction for a solution of a problem. In the context of computer science it is best to use the least amount of instruction to achieve the output we desire. This doesn't happen all the time but it would be considered as the most efficient way. I also learn about Euclid's algorithm for GCD. This algorithm mainly solves or finds the greatest common divisor by doing gcd(m,n) = gcd(n, m mod n) where n is the smaller number while m is the bigger number. This algorithm will go on until one of the number is 0. We also tackle about other gcd calculations alternative solutions. Overall problems can be solve different ways and it is in our best interest to use the most efficient way to save time and memory depending on the algorithm.

We also learn about Pseudo-code and how to write it. Pseudocode is basically a high level description of algorithm. It is written for people to be able to read and understand what the algorithm does step by step which is why it omits some of the statements that machine needed to execute. Some notations that I learn is the assignment of value. In programming language we would often do the assignment by writing "variable = value" but in pseudocode we would write it as "variable <- value". That is just one sample that I learn but there are more notations when writing pseudocode. Overall, pseudocode can help engineers evaluate what the algorithm does and review if it will work. This can help developers find the most efficient solution in the problem.

We also learn about algorithm analysis. This analysis helps engineers determine whether an algorithm is efficient. Typically it is measure by time and memory complexity. How much memories and how long and how many steps it need to do before achieving the goal. Basic operation is used to measure for time analysis such as addition, subtraction, multiplication and division. These are just few basic operation and there are many more. Basic operations are usually found in innermost loop. Part of algorithm analysis is know the eight common efficiency classes such as constant time, logarithmic time, linear time, linearithmic time, quadratic time, cubic time, exponential time and factorial time. It is also important to learn how to calculate the efficiency of algorithm. Algorithm analysis is the process of identifying the category of an algorithm using the eight common efficiency categories.


 

Comments

Popular posts from this blog

Week 4

Week 5

Week 2