Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS 330 Algorithms: Lecture 1 Shang-Hua Teng Department of Computer Science, Boston University.

Similar presentations


Presentation on theme: "CS 330 Algorithms: Lecture 1 Shang-Hua Teng Department of Computer Science, Boston University."— Presentation transcript:

1 CS 330 Algorithms: Lecture 1 Shang-Hua Teng Department of Computer Science, Boston University

2 Instructors Main Lectures: Professor Shang-Hua Teng TR 11:00am-12:30 Sections: TF Maosen Fang CAS CS330 A2 690566 Monday 1:00pm-2:00pm in KCB 201 CAS CS330 A3 690553 Wednesday 2:00pm-3:00pm in CAS 208

3 Office Hours Professor Shang-Hua Teng Email: steng@cs.bu.edu Office: MCS-276 Office Hours: Tuesday 12:30- 2:00pm, Thursday 1:30-3:00pm (or by appointment) Office Phone: 358-2596

4 Office Hours Teaching Fellow: Maosen Fang Email: heroes@cs.bu.edu Office: MCS-147 Office Hours: Monday 2:00- 3:30pm, Wednesday 5:00-6:3 (or by appointment) Office Phone: 358-2376

5 Important Dates: n Due day of each homework u See class webpage n Quiz: Tuesday, Feb. 25 (in class) n Midterm: Thursday, March 27 (in class) n Final: to be posted

6 Grading 40% - written assignments 15% - quiz 20% - midterm 25% - final

7 Homework n Write problems in order they are assigned and one problem per page, or just try to separate them clearly so one can see the end of one problem and the beginning of the next one. n The hard-copy (paper) submissions are preferred, so, please use the gsubmit option only if you cannot make it to the University on time. But if you do submit electronically: n Make sure to put your name in all electronically submitted files (even if you submit your file by email). n Make sure text file you submit can be printed out and it comes out properly. n Use a format that is well known and easy to open/read (just text format would do it).

8 n No late assignments will be accepted. n (Homework Box): If you come to CS building earlier, try submit the hws to the submission box up until 10:45am. I will be taking the hw's out from the submission box shortly after that time on my way to the class. If you do not make it to the box before 10:45am, bring the hw to the class. n (Classroom) I will also accept the hw's up until the class start. n I will stop accepting the hw's when the class starts. n If you cannot make it to the class on time, please make sure to submit the hw ahead of time. The late penalty will be exponential in the minutes it is late (2^m-1, where m is the number of minutes you are late - that's one way to learn about the perils of exponential growth ). The reason the penalty is so steep is that I want to discourage you from finishing at the last minute and coming late to class as the result.

9 Comments from the grader: The main issue is readability, so for example, if you need to draw something, it is better to do it by hand, than to mess with text formatting of drawing pictures in text files. Please, be sure that if you are hand-writing a hw, then your hand-writing is perfectly clear.

10 Policy n Regrading Policy: 1. If you submit the wrong file or a file with the wrong filename, this includes submission of an empty directory, submission of an executable, etc., then 50% will be taken off from your original grade. Note: In such cases you will be required to show a proof that your source file has a last modification date prior to the submission deadline. Note: attempts to cheat on this will be reported. See Academic Conduct.Academic Conduct

11 Policy n If you ask to re-grade your homework please write out the basis of your request. n If the grader finds no basis for your complaint, then 10 points will be taken off your original grade unless the grade is changed. n Note: This is not to say that we discourage you from disputing your grade, but rather we encourage you to read and understand the comments of the grader before complaining.

12 Policy n Under no circumstances should you be copying or using the work of others. It is fine to discuss problems (in general terms) with others, but the specifics of a solution and all of the writing should be done without any collaboration. (See also Academic Conduct)Academic Conduct

13 Algorithms in the “Real World” n How much impact modern algorithms has had on the Web and Internet today? u String matching u Indexing and Searching F Sorting and selection F Information clustering F Search trees F Matrix computations: eigenvalues and linear system

14 Algorithms in the “Real World” n How much impact modern algorithms has had on the Web and Internet today? u Internet Algorithms: F Networking routing Shortest path Congestion control F Multicasting F Caching F Streaming algorithms and video on demand u Encryption, decryption, and password hashing F Public key cryptography, RSA, testing primes, multiplication of large numbers F Random number generation u Authentication

15 Algorithms in the “Real World” n How much impact modern algorithms has had on the Web and Internet today? u Error correction, coding and decoding F Various error-detection and correction code u Data compression F Huffman codes, Lempel-Ziv code u Image, Audio, Video compression F Vector quantization F JPEG and MPEG F Fractal coding

16 Algorithms in the “Real World” n How much impact modern algorithms has had on the Web and Internet today? u Network Design and Optimization F Minimum-spanning tree F Nearest neighbors F Graph matching and maximum flow F Network connectivity u Mathematical Optimization F Linear Programming F Integer Programming

17 Algorithms in the “Real World” n Other Application u Computational Biology F String alignment F DNA sequencing u Scientific Simulation F Particle simulation (N-body simulation) F Linear system Ax = b  Eigenvalue Problem Ax = x F Triangulation and Finite Element method u VLSI circuit design F Various graph algorithm F Finite state machines

18 Sorting: getting organized n Input: Array A[1...n], of elements in arbitrary order; array size n Output: Array A[1...n] of the same elements, but in the non-decreasing order n Given name find telephone number n Given telephone number find name

19 Binary Search n Input: Array A[1...n] of the elements in the non-decreasing order, and an element k n Output: if k in A[1..n] then output j such that A[j] = k, otherwise, output 0 Algorithm: s = 1; e = n; while s < e { m = floor( (s+e)/2 ); if k <= A[m] then e = m else s = m } if A[s] = k then j = s else j = 0

20 Binary Search (II) n Input: Array A[1...n] of the elements in the non-decreasing order, and an element k n Output: if k in A[1..n] then output j such that A[j] = k, otherwise, output 0 Algorithm: s = 1; e = n; found = 0; while (s < e and found = 0) { m = floor( (s+e)/2 ); if k = A[m] then j = m; found = 1; else if k < A[m] then e = m-1 else s = m+1 } if found = 0 then j = 0


Download ppt "CS 330 Algorithms: Lecture 1 Shang-Hua Teng Department of Computer Science, Boston University."

Similar presentations


Ads by Google