1 / 21

CS 330 Algorithms: Lecture 1

CS 330 Algorithms: Lecture 1. Shang-Hua Teng Department of Computer Science, Boston University. Instructors. Main Lectures: Professor Shang-Hua Teng TR 3:30 – 5:00 Sections: TF Tao Wang CAS CS330 A2 878748 Wednesday 4:00pm-5:00pm in MCS B23 CAS CS330 A3 878735

Télécharger la présentation

CS 330 Algorithms: Lecture 1

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

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 3:30 – 5:00 Sections: TF Tao Wang CAS CS330 A2 878748 Wednesday 4:00pm-5:00pm in MCS B23 CAS CS330 A3 878735 Wednesday 5:00-6:00pm in MCS B23CAS CS330 A4 865436 Thursday 2:00-3:00pm in MCS B33

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

  4. Office Hours Teaching Fellow: Tao Wang Email: wtwang@cs.bu.eduOffice: Office Hours: (or by appointment)Office Phone:

  5. Important Dates: • Due day of each homework • See class webpage • Quiz 1: Thursday, Oct 16 (in class) • Midterm:Thursday, Nov 6 (in class) • Quiz 2: Tuesday, Nov 25 (in class) • Final: to be posted

  6. Grading 30% - written assignments10% - quiz 120% - midterm15% - quiz 2 25% - final

  7. Homework • 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. • 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: • Make sure to put your name in all electronically submitted files (even if you submit your file by email). • Make sure text file you submit can be printed out and it comes out properly. • Use a format that is well known and easy to open/read (just text format would do it).

  8. No late assignments will be accepted. • (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. • (Classroom) I will also accept the hw's up until the class start. • I will stop accepting the hw's when the class starts. • 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 • Regrading Policy: • 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.

  11. Policy • If you ask to re-grade your homework please write out the basis of your request. • If the grader finds no basis for your complaint, then 10 points will be taken off your original grade unless the grade is changed. • 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 • 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)

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

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

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

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

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

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

  19. Binary Search • Input:  Array A[1...n] of the elements in the non-decreasing order, and an element k • 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) • Input:  Array A[1...n] of the elements in the non-decreasing order, and an element k • 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

  21. Complexity of binary search • Input size • Number of comparisons

More Related