COP 3530: Data Structures, Algorithms, & Applications Instructor: Kristian Linn Damkjer

Download Report

Transcript COP 3530: Data Structures, Algorithms, & Applications Instructor: Kristian Linn Damkjer

COP 3530: Data Structures, Algorithms, & Applications

Instructor: Kristian Linn Damkjer

Course Overview

Syllabus Review

What The Course Is About

 Applications are developed to solve real world problems.

 All programs manipulate data.

 Programs must represent data in some way.

 Data structures focuses on data representation and manipulation.

 Data manipulation requires algorithms.

 Algorithms are the fundamental elements in application development.

Prerequisites

 Java™  CIS 3020 or CIS 3022 & CIS 3023  You should be proficient and self sufficient  You must be capable of writing programs without the aid of a compiler.

Prerequisites

 Asymptotic Complexity  COT 3100  We will use primarily

O

notation.

f(n) = O(g(n)) : Big Oh notation  f(n) is bounded above by g(n)  You should also be comfortable with Θ and Ω .

f(n) = Θ(g(n)) : Big Theta notation  f(n) is asymptotically equivalent to g(n)  f(n) = Ω(g(n)) : Big Omega notation  f(n) is bounded below by g(n)

Prerequisites

 Strong Mathematical Reasoning  Any of the various flavors of Calculus 2.

 At the very least you need to understand:  Sequences  Series  Summations  Integration  Differentiation  Matrices  Vectors

Web Sites

  http://www.cise.ufl.edu/~kdamkjer/courses/su05/cop3530/  Announcements  Syllabus   Handouts Exercise Solutions   Assignments TAs and Discussions http://www.cise.ufl.edu/~sahni/cop3530/  Text    Source Codes Past Exams Past Exam Solutions

Assignments

 Assignment guidelines  Submission procedures  Do Assignment 0 by Friday!

Source Codes

 Read download and use instructions.

 Read download and use instructions.

 Must have Java 1.2 or higher  Hopefully you have 1.4.2 or 1.5.0 (5.0)  Review the source code documentation 

ProgramIndex.html

AllNames.html

 Other HTML files produced by Javadoc

Discussion Sections

 Go to either one  TAs will answer your questions on lectures and assignments.

 TAs will cover exercises from the text.

 Web site lists topics and exercises for each discussion section.

Textbook

 It’s not rocket science (really)  It’s computer science  There are three sections to the textbook:  Background (Chapters 1-4)  Data Structures (Chapters 5-17)  Algorithms (Chapters 18-22)  What about Applications?

 We’ll cover applications throughout the entire semester along with general theory and other concepts.

 Assignments: 25%  Five Graded Projects  No drops permitted  Each worth 5%  Exams: 75%  Three Exams  No drops permitted  Each worth 25%

Grades

 Historic Cutoffs  A ≥ 83%  B+ ≥ 75%  B ≥ 70%  C+ ≥ 65%  C ≥ 60%  D+ ≥ 55%  D ≥ 50%

Grades

Classic Problem

Sorting

Classic Problem: Sorting

 Given a list of comparable elements: 

a

0 , a 1 , … ,a n−1  Rearrange the list into a specific order  Typically increasing or decreasing order.

Classic Problem: Sorting

 Given a list of comparable elements: 

a

0 , a 1 , … ,a n−1  Rearrange the list into a specific order  Typically increasing or decreasing order.

 Objective: 

a

0 ≤ a 1 ≤ … ≤ a n−1  Examples:  8, 6, 9, 4, 3  3, 4, 6, 8, 9  8, 3, 6, 2, 8, 10, 2  2, 2, 3, 6, 8, 8, 10

 Insertion  Bubble  Selection  Count  Shaker  Shell  Heap  Merge  Quick

Sorting Methods

 Insertion  Bubble  Selection  Count  Shaker  Shell  Heap  Merge  Quick

Sorting Methods

Inserting an Element

 Given a sorted list (sequence), insert a new element  Given 3, 6, 9, 14  Insert 5  Result 3, 5, 6, 9, 14

Inserting an Element

 Insert 5 into the list: 3, 6, 9, 14  Compare new element ( 5 ) and last element in list ( 14 )  Shift 14 right to get 3, 6, 9, , 14  Shift 9  Shift 6  Insert 5 right to get 3, 6, , 9, 14 right to get 3, , 6, 9, 14 to get 3, 5, 6, 9, 14

Inserting an Element

// insert t into a[0:i-1] int for j; (j = i – 1; j >= 0 && t < a[j]; j--) a[j + 1] = a[j]; a[j + 1] = t;

Next Time in COP 3530…

 Read Chapters 1–4 for review of topics covered today  Performance Analysis and Measurement  We will start the Data Structures portion of this course  Start thinking about different ways to represent data  Read Chapter 5.1–5.2

 Data Structure: Linear Lists