19
Algorithms Xiaojuan Cai [email protected] Fall semester 2015

Algorithms Xiaojuan Cai [email protected] Fall semester 2015

Embed Size (px)

Citation preview

Page 1: Algorithms Xiaojuan Cai cxj@sjtu.edu.cn Fall semester 2015

Algorithms

Xiaojuan Cai [email protected]

Fall semester 2015

Page 2: Algorithms Xiaojuan Cai cxj@sjtu.edu.cn Fall semester 2015

Course Overview

• Why study Algorithms• Outline of the course• Course Polices

04/22/23 Xiaojuan Cai 2

Page 3: Algorithms Xiaojuan Cai cxj@sjtu.edu.cn Fall semester 2015

Muḥammad ibn Mūsā al-Khwārizmī (780?-850?)

The word ‘algorithm’ is derived from the name of

a Muslim mathematician whose works introduced Arabic numerals and algebraic concepts to Western mathematics.

(American Heritage Dictionary)

What is Algorithm?

http://en.wikipedia.org/wiki/File:Abu_Abdullah_Muhammad_bin_Musa_al-Khwarizmi_edit.png

04/22/23 Xiaojuan Cai 3

Page 4: Algorithms Xiaojuan Cai cxj@sjtu.edu.cn Fall semester 2015

• An algorithm is a procedure that consists of – a finite set of instructions which, – given an input from some set of

possible inputs, – enables us to obtain an output

through a systematic execution of the instructions

– that terminates in a finite number of steps.

What is Algorithm?

04/22/23 Xiaojuan Cai 4

Page 5: Algorithms Xiaojuan Cai cxj@sjtu.edu.cn Fall semester 2015

Why study Algorithms?1. Their impact is broad and far-reaching.

Internet, Biology, Computers, Computer graphics, Security, Multimedia, Physics ......

“Computer Science is the study of algorithms.”

-- Donald E. Knuth

04/22/23 Xiaojuan Cai 5

Page 6: Algorithms Xiaojuan Cai cxj@sjtu.edu.cn Fall semester 2015

Why study Algorithms?

“ Algorithms + Data Structures = Programs. ”

-- Niklaus Wirth

“Bad programmers worry about the code. Good programmers worry about data structures and their relationships. ”

-- Linus Torvalds

2. to become a proficient programmer

04/22/23 Xiaojuan Cai 6

Page 7: Algorithms Xiaojuan Cai cxj@sjtu.edu.cn Fall semester 2015

“ 有人天生喜欢“遍历”,踏遍千山万水,遍享万种风情 ......

有人一生“贪婪”,眼界不宽,及时行乐;

有人注定适用“穷搜”,辛辛苦苦勤勤恳恳一辈子,付出很多,收获有限; 有人善用“时空权衡”,用最少的时间办最多的事情,的确精明; 有人会“分治”,再多的难题也能迎刃而解; 有人常“回溯”,错的太多,后悔太多; 有的人压根没有算法,于是盲目生活,盲目做事,最后所获无几;……”

--- 邹恒明 《算法之道》

Why study Algorithms?3. For intellectual stimulation, be a wise person

04/22/23 Xiaojuan Cai 7

Page 8: Algorithms Xiaojuan Cai cxj@sjtu.edu.cn Fall semester 2015

4. For profit

04/22/23 Xiaojuan Cai 8

Page 9: Algorithms Xiaojuan Cai cxj@sjtu.edu.cn Fall semester 2015

1. Their impact is broad and far-reaching.

2. to become a proficient programmer.

3. For intellectual stimulation, be a wise person

4. For profit

5. Old roots, new opportunities.

6.To solve problems that could not otherwise be addressed.

7.They may unlock the secrets of life and of the universe.

......

(Source from “Algorithms” by R. Sedgewick and K. Wayne)

Why study Algorithms?Why study anything else?

04/22/23 Xiaojuan Cai 9

Page 10: Algorithms Xiaojuan Cai cxj@sjtu.edu.cn Fall semester 2015

Where are we?

• Why study Algorithms• Outline of the course• Course Polices

04/22/23 Xiaojuan Cai 10

Page 11: Algorithms Xiaojuan Cai cxj@sjtu.edu.cn Fall semester 2015

References1. Algorithms: Design Techniques and Analysis, M.H. Alsuwaiyel

2. Introduction to Algorithms, T. H. Cormen, C. E. Leiserson, R. L. Rivest, C. Stein

3. Algorithms, S, Dasgupta, C. Papadimitriou, U. Vazirani

4. Algorithms, 4th edition, R. Sedgewick, K. Wayne

04/22/23 Xiaojuan Cai 11

Page 12: Algorithms Xiaojuan Cai cxj@sjtu.edu.cn Fall semester 2015

Course Overview

04/22/23 Xiaojuan Cai 12

Page 13: Algorithms Xiaojuan Cai cxj@sjtu.edu.cn Fall semester 2015

Course goals

• To become proficient in the application of fundamental algorithm design techniques

• To gain familiarity with the main theoretical tools used in the analysis of algorithms

• To study and analyze different algorithms for many of “standard” algorithmic problems

• To introduce students to some of the prominent subfields of algorithmic study in which they may wish to pursue further study

04/22/23 Xiaojuan Cai 13

Page 14: Algorithms Xiaojuan Cai cxj@sjtu.edu.cn Fall semester 2015

• Why study Algorithms• Outline of the course• Course Polices

Where are we?

04/22/23 Xiaojuan Cai 14

Page 15: Algorithms Xiaojuan Cai cxj@sjtu.edu.cn Fall semester 2015

Grading Policy

• Homework 25%– Distributed on course website after every

lecture– Submit every Tuesday

• Programming assignment 15%– LeetCode (http://leetcode.com)

• Final exam 60%

04/22/23 Xiaojuan Cai 15

Page 16: Algorithms Xiaojuan Cai cxj@sjtu.edu.cn Fall semester 2015

TAs

• TAs‣  Bingbing Fang ( 方冰冰 ),

[email protected]‣ Wenbo Zhang ( 张文博 ),

[email protected]

• Homepage: http://basics.sjtu.edu.cn/~xiaojuan/algo15/

04/22/23 Xiaojuan Cai 16

Page 17: Algorithms Xiaojuan Cai cxj@sjtu.edu.cn Fall semester 2015

More on LeetCode• Submission:

• Due on every Saturday night: 23:59• One student will be selected (randomly) to be report

your solution ( in 5 minutes) on Tuesday.

04/22/23 Xiaojuan Cai 17

Page 18: Algorithms Xiaojuan Cai cxj@sjtu.edu.cn Fall semester 2015

Teaching techniques

• One-minute paper• Group teaching– Final score = score + 3

(bonus)

04/22/23 Xiaojuan Cai 18

Page 19: Algorithms Xiaojuan Cai cxj@sjtu.edu.cn Fall semester 2015

Voices from senior students

• 算法是用来娱乐身心、课余刷题、公司面试、学会使用编程思想来看待各种问题的课程

• 用心学算法,很有意思的,这是程序员的内力修为,别太在意考试面试

• 坚持到期末• 算法无论从哪个次元来看都是程序员的基础。• 好好听课,不然会对自己失去信心。• 这是我在软院上过最有意思最有收获的一门课。• 算法很重要,但更重要的是思想。或许将来我们不会用到今天

学习的算法,但是某个算法的思想会帮我们解决很多实际问题。• 大神们请低调,给学渣们活路啊!• 冬天还是从被窝里爬起来吧,对找工作还是很重要滴• …

04/22/23 Xiaojuan Cai 19