Week 1 CS 361: Advanced Data Structures and Algorithms

21
WEEK 1 CS 361: ADVANCED DATA STRUCTURES AND ALGORITHMS Dong Si Dept. of Computer Science 1

description

Week 1 CS 361: Advanced Data Structures and Algorithms. Dong Si Dept. of Computer Science. Welcome to CS 361. Instructor: Dong Si PhD candidate of Computer Science Joined ODU in 2009, probably this is my last semester - PowerPoint PPT Presentation

Transcript of Week 1 CS 361: Advanced Data Structures and Algorithms

Page 1: Week 1 CS 361: Advanced Data Structures and Algorithms

1

WEEK 1

CS 361: ADVANCED DATA STRUCTURES AND ALGORITHMS

Dong Si

Dept. of Computer Science

Page 2: Week 1 CS 361: Advanced Data Structures and Algorithms

2

Welcome to CS 361

• Instructor: Dong Si

• PhD candidate of Computer Science• Joined ODU in 2009, probably this is my last semester

• Research interests: 3D image processing, feature detection, pattern recognition, modeling & simulation, machine learning and bioinformatics

• Office: ECSB 3318 • E-mail: [email protected] • Office Hours: M&W, 11:00am-12:00pm or by appointment

• Textbook: Mark Allen Weiss , Data Structures and Algorithm Analysis in C++ (4th edition)

Page 3: Week 1 CS 361: Advanced Data Structures and Algorithms

3

Prerequisites

• CS 250, Problem Solving and Programming, or CS 333, Problem Solving and Programming in C++

• I will assume that you are familiar with the basics of C++ including:

the various C++ statements and control-flow constructs, the built-in data types, the use of arrays, vectors and linked lists, the use and writing of functions, and the basic use of structures and classes for implementing abstract data types.

Page 4: Week 1 CS 361: Advanced Data Structures and Algorithms

4

Alert from Blackboard system

Page 5: Week 1 CS 361: Advanced Data Structures and Algorithms

5

First things first

• Read the syllabus CAREFULLY and let me know if any question.

• Class materials will be distributed via Blackboard system and class homepage (http://www.cs.odu.edu/~dsi/teaching_stuff/CS361). Please check regularly for update.

• Read the readings list before each class. Slides will be posted before of the class time.

• Class attendance is mandatory. Although slides will be used occasionally to aid the lectures, the instructor will use the white board heavily. Therefore, class attendance and interaction are required. Please check the University’s rule of Absences.

Page 6: Week 1 CS 361: Advanced Data Structures and Algorithms

6

First things first (cont.)

• Setup your ODU ITS account (for BlackBoard), CS account (for access the CS dept. computing resource) and Get familiar with CS Dept’s Linux servers (all your work will be tested on

these machines) and g++ compiler.

http://www.cs.odu.edu/System Group : [email protected]

Page 7: Week 1 CS 361: Advanced Data Structures and Algorithms

7

Course policy

Page 8: Week 1 CS 361: Advanced Data Structures and Algorithms

8

Course policy

Please read the syllabus CAREFULLY and let me know if any question.

Page 9: Week 1 CS 361: Advanced Data Structures and Algorithms

9

Course overview

• You will learn Commonly used data structures and algorithms, Costs and benefits associated with each data structure, How to measure the effectiveness of a data structure or algorithm.

Page 10: Week 1 CS 361: Advanced Data Structures and Algorithms

10

Programming

• Program = Algorithm + Data Structure + Implementation

• Algorithm: a sequence of steps to perform certain tasks E.g., sorting, shortest path

• Data structures: systematic ways of organizing and accessing data E.g., arrays, linked list, trees, graph

• Efficient Program = Good algorithm + Good data structures

1. How do we design the steps so that we can solve the task effectively?

2. How do we organize data so that we can find, update, add, and delete portions of it efficiently?

Page 11: Week 1 CS 361: Advanced Data Structures and Algorithms

11

Example applications

1. How does Google quickly find web pages that contain a search term? Answer

2. How can a subsequence of DNA be quickly found within the genome? Answer

3. How does your operating system track which memory (disk or RAM) is free? Answer

4. How to generate a Maze game? Answer, Example implementation

5. Etc…

Page 12: Week 1 CS 361: Advanced Data Structures and Algorithms

12

Data structures

• We need to define How to store data in memory, What operations we can perform on that data, What changes in the data of the structure caused by the operation, What is the time/space efficiency for those operation.

• Ex. “vector” in C++ ADT: Objects are stored sequentially in memory Can access, change, insert or delete objects Operations for insert & delete will shift items as needed Space: O(n), Access/change = O(1), Insert/delete = O(n)

Abstract Data Types (ADT)

Page 13: Week 1 CS 361: Advanced Data Structures and Algorithms

13

Abstract Data Type (ADT)

• An abstract model that specifies the structure type used to store the data and the operations that support the data

• Abstract? Encapsulate data and functions that work with this data type, Implementation-independent view of the data structure, Interested in what the structure does and not how it does it,

• Operations? A process that can accept data values (arguments), execute

calculations, and return a value.

Page 14: Week 1 CS 361: Advanced Data Structures and Algorithms

14

ADT example

• “Dictionary” class:

Member functions

Call the member functions in main program

Page 15: Week 1 CS 361: Advanced Data Structures and Algorithms

15

My view of data structures and algorithms

Programming: Java, C/C++, OOP,

Class, etc.

Solving real-worldproblems

Data structures & algorithms

How to systematically manipulate the data to achieve your goal?

How to systematically organize your data to make operations on thedata efficient?

No single data structure works for all operations Which data structures are efficient for which situation?

Page 16: Week 1 CS 361: Advanced Data Structures and Algorithms

16

Software design overview

• A computer program begins with a problem that the client wants solved.

• The process of building the program starts with an analysis of the problem. It proceeds through a series of stages to produce a product that is

reliable and easy to maintain.

Page 17: Week 1 CS 361: Advanced Data Structures and Algorithms

17

Software development life cycle

• Programmers added code to software with little attention to its integration into the system.

• Over time systems deteriorated and became so difficult to update that programmers had to develop new software to replace them.

Page 18: Week 1 CS 361: Advanced Data Structures and Algorithms

18

Software Design Stages

• Request: Client perceives a need for a software system to solve a problem. A computer consultant undertakes a feasibility study for the project.

• Analysis: A systems analyst develops the requirements of the system and

creates a functional specification that includes a list of needs and special requirements.

• Design: Translate the functional specification into an abstract model of the

system. Identify the components of the system and develop algorithms

that will be used for implementation.

Page 19: Week 1 CS 361: Advanced Data Structures and Algorithms

19

Software Design Stages (cont.)

• Implementation: Use a programming language and the design specification to code

the different components of the system.

• Testing: Check the program for logical and runtime errors and verify that the

system meets the specifications of the client.

• Maintenance: Periodically update of the software to stay current and to respond to

changing needs of the client.

Page 20: Week 1 CS 361: Advanced Data Structures and Algorithms

20

Homework #1: Warming up

• Already assigned on BB, due on 9/3/2014, 11:59PM

• Make sure you have your computer accounts in working order

• Will not be graded, but if you do not submit, your homework grade (50 points) will be deducted by 5 points

Page 21: Week 1 CS 361: Advanced Data Structures and Algorithms

21

Reading & Next class

• Book Chapter 1: “Programming: A General Overview”

• Book Chapter 2: “Algorithm Analysis”

• Next class: Algorithm, Complexity and Big O Analysis

• Remember: No class this Wednesday due to my conference traveling.