Presentation is loading. Please wait.

Presentation is loading. Please wait.

CSE 2320 Algorithms and Data Structures Dimitrios Kosmopoulos Introduction.

Similar presentations


Presentation on theme: "CSE 2320 Algorithms and Data Structures Dimitrios Kosmopoulos Introduction."— Presentation transcript:

1 CSE 2320 Algorithms and Data Structures Dimitrios Kosmopoulos Introduction

2 General info Dimitrios Kosmopoulos kosmopo@uta.edu Office: ERB644 (to change) Hours: TuTh 12:30pm-2:30pm GTA: 2B announced web page http://heracleia.uta.edu/~dkosmo/

3 General info Textbook: R. Sedgewick, Algorithms in Java, Parts 1-5, 3rd ed., Addison-Wesley, 2003. References: Al Aho and Jeff Ullman, Foundations of Computer Science, http://infolab.stanford.edu/~ullman/focs.html S. Baase and A. Van Gelder, Computer Algorithms: Introduction to Design and Analysis, 3rd ed., Addison-Wesley, 2000. Cormen, Leiserson, Rivest, Stein, Introduction to Algorithms, 2nd ed., MIT Press, 2001. J. Lewis and W. Loftus, Java Software Solutions: Foundations of Program Design, 6th ed., Pearson Education, 2009.

4 Prerequisites C programming (CSE 1320) Java programming (CSE 1325) (a) problem-> (b) algorithm-> (c) program-> (d) executable So far: (b)->(c)->(d) Here: (a)->(b)

5 Objectives To become capable of developing, applying, and evaluating algorithmic solutions. Intuition about particular algorithms and data structures that have wide applicability. Understanding of classic approaches to algorithm design – decomposition, dynamic programming, and greedy methods. Understanding of basic algorithm analysis concepts by applying math skills to worst-case and expected time using recurrences and asymptotic notation. Improved programming skills - especially data structures, recursion, and graphs.

6 Grading Based on the following weights: Exams: 65% divided evenly among 3 exams. Programs: 15% divided evenly among three assignments. Homework assignments: 10% Practice homeworks with answers, will be available on the course web page ABET Outcome B (Experimentation) Assessment Project: 10%

7 Grading (cont.) Students achieving a semester grade of C or better, but failing the experimentation assessment (below 60%) and documenting their circumstances will be assigned a semester grade of I (incomplete) and may re-attempt the assessment in the next semester. If the assessment is then passed, the semester grade will be changed from I to the achieved grade.

8 Policies (selection) Regular attendance expected Surprise quizzes an option, each quiz being 2% of the semester grade taken from the 65% allocated to exams Lecture notes and sample code for various algorithms are on the course web page http://heracleia.uta.edu/~dkosmo http://heracleia.uta.edu/~dkosmo Cheating - You Are Expected To Know University Policies

9 Policies (selection) Labs are due at 10:45 am on the due date, not midnight. Homeworks are due before class. After the due time, assistance will not be provided. Degree of lateness penalty –Up to 10:45 next day 10 pts –Up to 10:45 two days 30 pts –Up to 10:45 three days 60 pts Resubmissions before the due time are penalized 10 points each. No resubmissions after the due time.

10 Lab grading a. Output/Code 60% b. Internal Comments 6% c. Modularity 6% d. Structure 6% e. Names 6% f. Spacing 6% g. Generality 10%

11 Lab submission All programs must be written in Java to compile and execute using a recent version of the JDK. Details for program submission will be included with each assignment. You are responsible for correctly sending each programming assignment to the GTA as an attachment. (cc: yourself) No points will be awarded for programs that do not compile. Points for b-g will not be awarded to submissions that are not substantially complete.

12 Lecture structure Abstraction Data models Data structures Algorithms

13 Abstraction Computer science: The science of abstraction: creating the right model for thinking about a problem and devising the appropriate mechanizable solution to solve it Different degrees of complexity: Digital electronic circuit Behavior of robotic agent

14 Example 1 abstraction: directed graph Knowledge can be inferred through “formal logic” If Fluffy is a cat then Fluffy is an animal

15 Example 2 Exams scheduling: assignment to time slots, avoid conflict No student takes both exams => can have the same time slot Model: graph –Node<-course –edge<-student in common

16 Example 2 (cont.) Algorithm: a. Find the maximum set of courses with no common students (maximal independent set) b. Assign to first slot c. Continue until no courses are left Solution not optimal, but close to optimal, and simple More complex representations possible (e.g. constraints in number of student’s sequential exams)

17 Important concepts Data models: the abstractions to describe the real world or specific problems (e.g., a mathematical model) Data structures: programming language constructs used to represent data models (e.g., pointers, trees) Algorithms: the techniques to solve problems by manipulating data structures Program: the implementation of an algorithm in a programming language

18 How are these related to the course? New data structures How these can be used by various algorithms Typical applications

19 Data model- Data structure The data model has two aspects: The values that it can assume (properties) – static aspect The operations that can be executed on these data – dynamic aspect / behavior –Can be, e.g., the boolean algebra, the algebra of sets, or any other mathematical theory The data structure is the computer language-specific implementation

20 Example 1 AND- gate Data model: Static: the values 0,1 Operation: “and” as defined in the truth table Data structure: variables in java: boolean x, y, z; Operator “ && ”

21 Example 2 Data model List: (a 1,a 2,…,a n ) –Values: sets of integers in specific order –Operation: merge (a 1,a 2 )+(a 3 )=(a 1,a 2,a 3 ) Data structure class Node { int a; Node next; Node merge(Node node1, Node node2) { …}; }

22 Algorithm A problem solving method suitable for implementation as a computer program How are the algorithm related to the data structures? –They organize and generally use the data structures Algorithms and data structures go together

23

24

25 Greatest Common Divider Algorithm The GCD of two numbers is the largest number that divides both of them without leaving a remainder. The algorithm is based on the principle that the greatest common divisor of two numbers does not change if the smaller number is subtracted from the larger number. For example, 21 is the GCD of 252 and 105 (252 = 21 × 12; 105 = 21 × 5); since 252 − 105 = 147, the GCD of 147 and 105 is also 21. Since the larger of the two numbers is reduced, repeating this process gives successively smaller numbers until one of them is zero. When that occurs, the GCD is the remaining nonzero number.

26

27

28

29

30 Algorithmic problem Infinite number of input instances satisfying the specification e.g., a sorted non-decreasing sequence of integers of finite length -12, -5, -3, 15, 40, 56, 12454 -19, 2 Specification of input Specification of output as function of input ?

31 Algorithmic problem Algorithm describes the processing of the input instances Many algorithms may solve the same problem in a different way -12, -5, -3, 15, 40, 56, 12454 -19, 2 Specification of input Specification of output as function of input Algorithm

32 What is a good algorithm? Efficient –Space –Time running Efficiency measured as function of input –Number of data elements

33 How do we measure efficiency? Write a program that implements the algorithm Run the program with input of various values and size Measure the time using system routines

34 What are the limitations? The algorithm has to be implemented Experiments can be done on a limited set of data The hardware/software configuration must be the same Generic analysis methodology will be discussed in this course


Download ppt "CSE 2320 Algorithms and Data Structures Dimitrios Kosmopoulos Introduction."

Similar presentations


Ads by Google