CS252 Algorithms Monday, 25 March 2024 https://cs.carleton.edu/faculty/jondich/courses/cs252_s24/ + Hi! - Jeff, Olin 301A, jondich - Office Hours: 301A + Zoom see my Carleton-only Google doc w/ Zoom link that I mostly remember to turn on + Moodle & the course website: what's the deal? + Prefect: Kiri Salij + Where we're heading - Articulating computational problems clearly, precisely, formally - Devising algorithms to solve those problems and articulating the solutions clearly, precisely, formally - Analyzing algorithms runtime, memory use, correctness - Important classes of algorithms greedy, divide-and-conquer, dynamic programming... - (Not intractability--that's in CS254 Comp & Comp) + This is in part a writing class, with a specialized audience + What algorithms do you know by name? Linear search O(N) Binary search O(log N) Merge sort O(N log N) Quicksort O(N^2) -- typically this is the library sort() Insertion sort O(N^2) Selection sort O(N^2) Bubble sort O(N^2) Radix sort O(N) Bogo sort O(N!) Brute force [super generic] Dijkstra's Algorithm Regular expression matching Back propagation Floyd's Algorithm ... Paradigms: greedy, What data structures do you know by name? Heap Array Linked list Hash table Binary search tree Priority queue Stack Red-black tree Queue Graph Abstract data types: what is it? (data) what operations can you perform on it? (methods) + Articulating a computational problem - Pick a problem that is solved algorithmically in software/hardware that you use - What are the inputs? - What are the outputs, and what relationship do they bear to the inputs? - Internet search in: word(s) (the search term) all the web pages & other stuff available on the web everybody else's past searches & what they clicked on searcher's location searcher's chosen natural language searcher's past searches ... out: a bunch of URLs, sorted by "relevance" - The word game "ghost" (what problem are we solving?)(AI's optimal strategy) in: queue of letters stated so far the alphabet dictionary out: a letter (representing the AI's next move) (could output an error condition saying "not possible") (desire: if a non-word is possible, then the output makes one of those; if it's possible to force the opponent to lose, do that...) - YouTube recommendation in: out: - Google maps (route-finding) in: out: + General logistics - Website & Slack #announcements - Reading reactions - #readings channel - include specified hashtag - 1 point apiece; drop the lowest two scores - Problem sets - out on Friday (except #1, which is out on Monday) - checkpoint submission due 5PM Tuesday - final submission due 5PM Friday + This week - Getting our homework and communication system up and running - First problem set: review stuff from CS201, CS202/Math236 - Remembering how to use LaTeX - Review of computational complexity - O, Ω, ϴ - worst-case analysis - common complexity classes (e.g., O(n log n)) + Upcoming due dates - 5PM Tuesday 3/26: checkpoint for problem set #1 - 11:59PM Wednesday 3/27: reading reaction #1 - 5PM Friday 3/29: problem set #1 - 11:59PM Sunday 3/31: reading reaction #2