December 4, 20031 Algorithms and Data Structures Lecture XV Simonas Šaltenis Aalborg University

Slides:



Advertisements
Similar presentations
INTRODUCTION TO CS16 CS16: Introduction to Algorithms and Data Structures Tu/Th 10:30-11:50 Metcalf Auditorium David Laidlaw Thursday, January 23, 2014.
Advertisements

IKI 10100: Data Structures & Algorithms Ruli Manurung (acknowledgments to Denny & Ade Azurat) 1 Fasilkom UI Ruli Manurung (Fasilkom UI)IKI10100: Lecture10.
October 31, Algorithms and Data Structures Lecture XIII Simonas Šaltenis Nykredit Center for Database Research Aalborg University
November 14, Algorithms and Data Structures Lecture XIII Simonas Šaltenis Aalborg University
Lecture 12: Revision Lecture Dr John Levine Algorithms and Complexity March 27th 2006.
ITEC200 – Week 12 Graphs. 2 Chapter Objectives To become familiar with graph terminology and the different types of graphs To study.
Review. What to know You are responsible for all material covered in lecture, the readings, or the programming assignments There will also be some questions.
Jan Welcome to the Course of Advanced Algorithm Design (ACS-7101/3)
CSCE 210 Data Structures and Algorithms
UMass Lowell Computer Science Analysis of Algorithms Prof. Karen Daniels Fall, 2009 Lecture 1 Introduction/Overview Text: Chapters 1, 2 Th. 9/3/2009.
CS 311 Graph Algorithms. Definitions A Graph G = (V, E) where V is a set of vertices and E is a set of edges, An edge is a pair (u,v) where u,v  V. If.
TDDB57 DALG-C, DALG Exam Requirements Jan Maluszynski - HT 2006DALG-C.1 TDDB57 – DALG-C Examination Requirements.
CSIS-385: Analysis of Algorithms Dr. Eric Breimer.
Data Structures & Algorithms What The Course Is About s Data structures is concerned with the representation and manipulation of data. s All programs.
CSIS-385: Analysis of Algorithms Dr. Eric Breimer.
Spring 2010CS 2251 Graphs Chapter 10. Spring 2010CS 2252 Chapter Objectives To become familiar with graph terminology and the different types of graphs.
Course Review COMP171 Spring Hashing / Slide 2 Elementary Data Structures * Linked lists n Types: singular, doubly, circular n Operations: insert,
Chapter 10: Algorithm Design Techniques
UMass Lowell Computer Science Analysis of Algorithms Prof. Karen Daniels Fall, 2001 Lecture 1 Introduction/Overview Wed. 9/5/01.
UMass Lowell Computer Science Analysis of Algorithms Prof. Karen Daniels Fall, 2005 Lecture 1 Introduction/Overview Text: Chapters 1, 2 Wed. 9/7/05.
UMass Lowell Computer Science Analysis of Algorithms Prof. Karen Daniels Spring, 2007 Lecture 1 Introduction/Overview Text: Chapters 1, 2 Wed. 1/24/07.
Data Structures, Spring 2004 © L. Joskowicz 1 DAST – Final Lecture Summary and overview What we have learned. Why it is important. What next.
Instructor: Dr. Sahar Shabanah Fall Lectures ST, 9:30 pm-11:00 pm Text book: M. T. Goodrich and R. Tamassia, “Data Structures and Algorithms in.
Teaching Teaching Discrete Mathematics and Algorithms & Data Structures Online G.MirkowskaPJIIT.
CS223 Algorithms D-Term 2013 Instructor: Mohamed Eltabakh WPI, CS Introduction Slide 1.
CS112A1 Spring 2008 Practice Final. ASYMPTOTIC NOTATION: a)Show that log(n) and ln(n) are the same in terms of Big-Theta notation b)Show that log(n+1)
Chapter 9 – Graphs A graph G=(V,E) – vertices and edges
Lecture 12-2: Introduction to Computer Algorithms beyond Search & Sort.
SPANNING TREES Lecture 21 CS2110 – Spring
Chapter 2 Graph Algorithms.
October 21, Algorithms and Data Structures Lecture X Simonas Šaltenis Nykredit Center for Database Research Aalborg University
0 Course Outline n Introduction and Algorithm Analysis (Ch. 2) n Hash Tables: dictionary data structure (Ch. 5) n Heaps: priority queue data structures.
Sorting Sanghyun Park Fall 2002 CSE, POSTECH. Sorts To Consider Selection sort Bubble sort Insertion sort Merge sort Quick sort Why do we care about sorting?
ECE 250 Algorithms and Data Structures Douglas Wilhelm Harder, M.Math. LEL Department of Electrical and Computer Engineering University of Waterloo Waterloo,
10/20/20151 CS 3343: Analysis of Algorithms Review for final.
INTRODUCTION. What is an algorithm? What is a Problem?
CS Data Structures II Review & Final Exam. 2 Topics Review Final Exam.
+ David Kauchak cs312 Review. + Midterm Will be posted online this afternoon You will have 2 hours to take it watch your time! if you get stuck on a problem,
Graphs. Definitions A graph is two sets. A graph is two sets. –A set of nodes or vertices V –A set of edges E Edges connect nodes. Edges connect nodes.
Lecture 12: Algorithm Review. General Problem Solving Methods Divide & Conquer Greedy Method Dynamic Programming Graph & Tree Traversal Backtracking Branch.
CS223 Advanced Data Structures and Algorithms 1 Review for Final Neil Tang 04/27/2010.
1 BIM304: Algorithm Design Time: Friday 9-12am Location: B4 Instructor: Cuneyt Akinlar Grading –2 Midterms – 20% and 30% respectively –Final – 30% –Projects.
Runtime O(VE), for +/- edges, Detects existence of neg. loops
CSE 340: Review (at last!) Measuring The Complexity Complexity is a function of the size of the input O() Ω() Θ() Complexity Analysis “same order” Order.
CES 592 Theory of Software Systems B. Ravikumar (Ravi) Office: 124 Darwin Hall.
CS6045: Advanced Algorithms Sorting Algorithms. Heap Data Structure A heap (nearly complete binary tree) can be stored as an array A –Root of tree is.
Data Structures and Algorithms in Java AlaaEddin 2012.
Design and Analysis of Algorithms Introduction Instructors:1. B V Kiran Mayee, 2. A Madhavi
Algorithms Design and Analysis CS Course description / Algorithms Design and Analysis Course name and Number: Algorithms designs and analysis –
Course Review Fundamental Structures of Computer Science Margaret Reid-Miller 28 April 2005.
BITS Pilani Pilani Campus Data Structure and Algorithms Design Dr. Maheswari Karthikeyan Lecture1.
1 COMP9007 – Algorithms Course page: + Blackboard link Lecturer: M.Reza Hoseiny M.Reza Hoseiny Level.
CS16: Introduction to Algorithms and Data Structures
CSCE 210 Data Structures and Algorithms
Cse 373 June 2nd – Exam Review.
Data Structures and Algorithms
Lecture 1 Introduction/Overview Text: Chapters 1, 2 Wed. 1/28/04
Data Structures and Algorithms
CS 3343: Analysis of Algorithms
CS 3343: Analysis of Algorithms
Definition In simple terms, an algorithm is a series of instructions to solve a problem (complete a task) We focus on Deterministic Algorithms Under the.
CS 3343: Analysis of Algorithms
CS 3343: Analysis of Algorithms
CS 3343: Analysis of Algorithms
CS 3343: Analysis of Algorithms
INTRODUCTION TO ALOGORITHM DESIGN STRATEGIES
Department of Computer Science & Engineering
Review for Final Neil Tang 05/01/2008
COMP 122 – Design and Analysis of Algorithms
More Graphs Lecture 19 CS2110 – Fall 2009.
Presentation transcript:

December 4, Algorithms and Data Structures Lecture XV Simonas Šaltenis Aalborg University

December 4, Results of the questionnaire Problematic lectures:

December 4, This Lecture What have we learned? Summary-Pensum Solving exercises Recurrences Graph exercises ADT exercises Dvide and conquer algorithms

December 4, The Course – Pensum Toolbox of algorithmic techniques Divide and Conquer Merge sort, Quicksort, Binary search Dynamic programming Matrix chain multiplication, Longest Common Subsequence – not in exam pensum, except basic understanding of LCS Greedy algorithms Prim’s, Kruskal’s, Dijkstra’s Analysis of algorithms: Correctness of algorithms Loop invariants – not in exam pensum Asymptotic notations Recurrences

December 4, The Course – Pensum (2) Building algorithms - concept of ADT Toolbox of data structures: Simple data structures and ADTs array, all sorts of linked lists, stacks, queues, trees, heaps Dictionaries hash tables binary search trees (unbalanced) red-black trees

December 4, The Course – Pensum (3) Toolbox of algorithms: Sorting insertion sort, selection sort merge sort quick sort heap sort (priority queues) Graphs memory representation graph traversal breadth-first search depth-first search (topological sort) minimum spanning trees (Prim, Kruskal) shortest path (Dijkstra, Bellman-Ford)

December 4, The Exam The exam will be written, you will have three hours. Two parts: Multiple-choice, “quiz”-style part – tests basic knowledge, understanding of the core concepts “Creative exercises” – come up with algorithms, analyze them, argue for your solutions.

December 4, Preparation for the Exam To prepare for the exam: Concentrate on solving the exercises, not studying the textbook (although you have to know the concepts!) Solve exercises from last year exams When solving write your solutions down! On Jan 16, 13:00 come to B2-104 (here) and have your questions answered. Or pass by my office E1-215b! Good news: solutions to hand-in exercises will be posted on the web before Christmas!

December 4, Solving Recurrences Repeated substitution procedure: Substitute, expand, substitute, expand… Observe a pattern and write how your expression looks after the i-th substitution Find out what the value of i (e.g., lgn or n-1) should be to get the base case of the recurrence (e.g., T(1)) Insert the value of T(1) and the expression of i into your expression Compute your recurrence for small values and check if your general solution gives the same results!

December 4, Types of Recurrences Number of substitutions i : If T(n) = …T(n - 1)… and base case T(k) = … then i = n – k If T(n) = …T(n/b)… and base case T(k) = … then i = log b (n/k)

December 4, Types of recurrences II T(n) = aT(n – b) + c T(n) = aT(n/b) + cn + d Geometric series T(n)=T(n – b) + cn + d Arithmetic series Prove it yourself!

December 4, Graph Exercises Types of graph exercises: Decide what are the vertices and what are the edges Un-weighted graphs “Traverse and check(do) something” => use DFS or BFS Find shortest paths => use BFS Schedule or order dependent activities or processes => use Topological sorting

December 4, Graph Exercises Types of graph exercises: Weighted graphs Decide what are the weights Shortest paths, shortest times => use Dijkstra’s Minimum (maximum) spanning tree => use Prim’s or Kruskal’s Finding a critical path in a schedule (longest path in a DAG) => use Topological sorting on a DAG of activities

December 4, Do not forget: Write preconditions (INPUT) and postconditions (OUTPUT) of your algorithms You can only use the ADT operations provided in the exercise !!!