1 / 19

Definition

Definition. Algorithm. input. output. Well defined sequence of computer instructions. In simple terms, an algorithm is a series of instructions to solve a problem (complete a task) We focus on Deterministic Algorithms Under the same input it must produce the same output.

Download Presentation

Definition

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. Definition Algorithm input output Well defined sequence of computer instructions • In simple terms, an algorithm is a series of instructions to solve a problem (complete a task) • We focus on Deterministic Algorithms • Under the same input it must produce the same output

  2. Two Key Properties Time CPU # of instructions Space Memory Storage • Correctness • An algorithm is correct if under all valid inputs, it produces the correct output • Efficiency • Same problem can have many ways (algorithms) to solve it • Which one is more efficient? • Efficiency means: • How long will it take? • How much storage will it need?

  3. CS223 AlgorithmsD-Term 2013 Representative Problems

  4. Problem Family I: Sorting The algorithm must know how to compare values (<, =, or >) • Input • A list of unsorted values • Output • The corresponding sorted list

  5. Problem Family II: Searching Search for 33? Search for C? Will it make a difference if the list is sorted ??? • Input • A list of values L, and a key (single value) K • Output • The position in L that contain K (if exists)

  6. Problem Family III: Trees Can you notice a certain order in this tree? Left  smaller than Right  greater than Binary Tree Binary Search Tree • Input • A tree of values • Different problems • Traverse the tree and list the values • Search for a value in the tree • Deletion from or insertion into the tree

  7. Problem Family IV: Graphs What is the shortest path from F to B? What is the shortest path from F to all other nodes? Find a minimum spanning tree? • Input • A graph of values G • Different problems • Traverse the graph • Searching for a value in the graph • Shortest path from one node to another

  8. Problem Family V: String Processing Search for sentence “algorithms are fun” Find the smallest difference between this document and another document • Input • One or multiple strings • Different problems • Search for one string in another • Edit distance between strings • String alignment

  9. Too Many Others Protein networks Scheduling problem Greatest Common Divisor (GCD) DNA sequence alignment Nearest neighbor (closest gas station to me) Matrix multiplication

  10. Course Outline (What You Will Learn) • Algorithmic Strategies and Methodologies • Tree and graph traversal, Greedy Algorithms, Dynamic Programming, Divide and Conquer • Problem Types/Families • Sorting, Searching, Graph and Tree Algorithms, Scheduling and Optimization, String Processing • Algorithms on Different Data Structures • Arrays, Trees, Queues, Graphs, Strings, Hash Tables, Linked Lists • Analysis and Evaluation • Coding and running algorithms, • Analytical analysis using big-O notation

  11. CS223 AlgorithmsD-Term 2015 Course Logistics

  12. Textbook • Required Introduction to Algorithms T.H. Cormen, C.E. Leiserson, R.L. Rivest, and C. Stein. Third Edition, MIT Press, 2009.

  13. Course Logistics • Website: http://web.cs.wpi.edu/~cs2223/d15 • Electronic WPI system: blackboard.wpi.edu • Lectures • MTRF (2:00pm - 2:50pm) • Grading • All assignments are done individually

  14. Scheduling • Scheduling for assignments, exams, and quizzes • Visit the website: http://web.cs.wpi.edu/~cs2223/d15

  15. Course Management • Course Webpage: • Web Page: http://web.cs.wpi.edu/~cs2223/d15 • Homework/Project submissions • Electronically on blackboard.wpi.edu (Required) • Viewing Grades • On blackboard.wpi.edu

  16. Office Hours Posted on the course web page Covers most days of the week Make use of them– they are there for YOU !

  17. Programming Language • In assignments, use Python • In lectures, I will use pseudocodecloser to Python

More Related