Presentation is loading. Please wait.

Presentation is loading. Please wait.

Course Review 15-211 Fundamental Structures of Computer Science Margaret Reid-Miller 28 April 2005.

Similar presentations


Presentation on theme: "Course Review 15-211 Fundamental Structures of Computer Science Margaret Reid-Miller 28 April 2005."— Presentation transcript:

1 Course Review 15-211 Fundamental Structures of Computer Science Margaret Reid-Miller 28 April 2005

2 What was this course about? How to solve computing problems. Problem analysis, to abstract away details and divide into smaller subproblems. Mathematical foundations for precise formulations of problems and solutions. Data structures and algorithms to solve problems correctly and efficiently. Java programming and modular software construction for good implementations.

3 Data Structures - Lists - Trees - Tries - Priority Queues - Hash Table Really not basic DS, more conceptual. - Graphs - Equiv. Relations - FSMs - Geometry - Polynomials

4 Algorithms - Searching - Hashing - Sorting - Compression - String Matching Complexity. Correctness. Applications. - Graph Algorithms - Dynamic Programming - Games - Polynomial Comp. - Comp. Geometry

5 Programming Object oriented programming. Correctness (loop invariants, induction). Time and space complexity. Debugging (test harness).

6 Studying for the Final Exam Review all material first Lectures, programs, quizzes Do sample finals – under time restrictions Old finals are in blackboard/assignments Types and difficulty of problems may be similar (some topics not covered)

7 Solving Recurrences, Asymptotics Solve T(n) = 3 T(n/3) + 1 Prove the correctness By induction Invariants  Hold initially  Preserved after each iteration of loop or method call Or other methods Big-Oh, little-oh, Big-Omega, Theta Master Theorem

8 Sorting and lower bounds

9 Insertion Sort Selection Sort Heapsort Mergesort Quicksort Radix Sort

10 Binary Trees 1.Traverse the tree inorder 2.Do exactly two rotations so that the tree is balanced 3. Consider a binary tree of height h a.What are the max and min number of nodes? b.What are the max and min number of leaves? 4. Perfect, full, complete trees

11 Balanced Binary Trees

12 Dictionaries

13 Hashing Describe why hashing a string to sum of its characters is not a good idea. Assume S = a 1 a 2 ….a n is a string Define H(S) =  a i 2 i-1 (i=1..n) Describe a way to efficiently calculate H(S)

14 Priority Queues and Heaps Suppose you implement a priority queue using following Unsorted array Linked list (smallest at front) Heap What is the complexity in each case for deleteMin insert

15 Binary heaps

16 Compression

17 LZW compression

18 Data Compression Encode “I AM SAM SAM I AM SAM SAM” using Huffman compression LZW In each case calculate the compression ratio Is it possible to apply Huffman after applying LZW? If so apply Huffman to output generated by LZW above

19 Graphs What is breadth first traversal? What is depth first traversal? What data structures can be used to implement each one? Reachability Connected components Topological sort

20 Graphs

21 Adjacency lists and matrices Traversal (DFS, BFS) Reachability (DFS, BFS, Warshall) Shortest Paths (Dijkstra, Bellman- Ford) MST (Prim, Kruskal)

22 Greedy Algorithms 100 5060 30 50 60 20 50 20 60 40 50 150 40 20 40 20 40 10 Find the Shortest Path from Node 1 to every other node

23 Dynamic Programming Dependent subproblems, recursive solutions, memoizing, explicit tables. Knapsack Longest Common Subsequence Matrix Multiplication Floyd-Warshall-Kleene

24 Dynamic Programming Consider a sequence of n numbers, A = {a 1, a 2, a 3,..., a n }. A subsequence of a given sequence is just the given sequence with 0 or more of the elements removed. Let's find an algorithm that finds the subsequence, A' = {a i1, a i2, a i3,...a ik } of A that maximizes a i1 - a i2 + a i3 -... +- a ik (i.e. the sign alternates).

25 Game trees

26 Games 2-person, deterministic, complete information,... Backtracking MiniMax Alpha-beta pruning Heuristics, iterative deepening, move order, tricks,...

27 Union-find

28 String matching

29 Polynomials Horner’s method Lagrange interpolants secret sharing Karatsuba Alg Integer & polynomial multiplication FFT method for polynomial multiplication Schwartz: Is polynomial identically zero?

30 Computational Geometry

31 Points, lines, rays, line segments Intersection, turns Membership in region Convex hull Divide-and-Conquer (QuickHull,...) Lower Bound

32 Final Exam Thursday, May 5, 8:30 –11:30 am McConomy (*not* in WeH 7500) Sugary stuff will be provided... Make sure not to be late.

33 Final Exam Closed book, no calculators, cell phones, pagers, IM, … You can bring 1 (one) page of notes. Bring fluids

34 Conclusion Review all material Do all sample quizzes and finals Good luck!!


Download ppt "Course Review 15-211 Fundamental Structures of Computer Science Margaret Reid-Miller 28 April 2005."

Similar presentations


Ads by Google