190 likes | 201 Views
Learn about complexity analysis, algorithms, and working with Java on Eclipse. Understand asymptotic notations and use command line arguments for Java programs.
E N D
Coen 352 – summer 2019 Tutorial Session 1
Session outline • Complexity analysis • Working with java on eclipse
What is Algorithms? What do we mean by Complexity ? How to measure Complexity ? Analysis and Complexity of Algorithms:
Algorithm is a sequence of computational steps that transform the input into the output. To analyze an algorithm is to determine the amount of resources (such as time and storage) necessary to execute it. The complexity of an algorithm is the cost, measured in running time, or storage, or whatever units are relevant, of using the algorithm to solve one of those problems. Analysis and Complexity of Algorithms
To compute the sum of all integers from i to n: Properties of: LogarithmsExponentials Important reviews:
Command line argument • Can use the terminal: but we need to compile then run the code: • To compile : javacmyfile.java • To run : java myfile arg1 arg2 ...argn • Can also use eclipse command line mode: what we will see.
Write a function that takes an array as input and computes the sum of all its term. Print the sum after you compute it. You should use the command line arguments to provide the list of values of your array. Exercise
further studies • https://www.youtube.com/watch?v=JPyuH4qXLZ0 • Limit to show big oh notations: http://web.mit.edu/broder/Public/asymptotics-cheatsheet.pdf