COMP9024: Data Structures and Algorithms

Slides:



Advertisements
Similar presentations
Graphs Chapter 12. Chapter Objectives  To become familiar with graph terminology and the different types of graphs  To study a Graph ADT and different.
Advertisements

Lecture 27. String Matching Algorithms 1. Floyd algorithm help to find the shortest path between every pair of vertices of a graph. Floyd graph may contain.
Chapter 3 The Greedy Method 3.
授課教授:李錫智 Data Structures -4 th exam-. 1.[10] Suppose we have a text and a pattern shown in Fig.1. You apply the brute-force pattern matching algorithm.
Graph Algorithms: Minimum Spanning Tree We are given a weighted, undirected graph G = (V, E), with weight function w:
Midterm 2 Overview Fawzi Emad Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
1 Assignment 2: (Due at 10:30 a.m on Friday of Week 10) Question 1 (Given in Tutorial 5) Question 2 (Given in Tutorial 7) If you do Question 1 only, you.
Chapter 9: Greedy Algorithms The Design and Analysis of Algorithms.
DAST 2005 Tirgul 11 (and more) sample questions. DAST 2005 Q.Let G = (V,E) be an undirected, connected graph with an edge weight function w : E→R. Let.
Graphs Chapter 12. Chapter 12: Graphs2 Chapter Objectives To become familiar with graph terminology and the different types of graphs To study a Graph.
Spring 2010CS 2251 Graphs Chapter 10. Spring 2010CS 2252 Chapter Objectives To become familiar with graph terminology and the different types of graphs.
CS 206 Introduction to Computer Science II 04 / 29 / 2009 Instructor: Michael Eckmann.
Fall 2007CS 2251 Graphs Chapter 12. Fall 2007CS 2252 Chapter Objectives To become familiar with graph terminology and the different types of graphs To.
Nirmalya Roy School of Electrical Engineering and Computer Science Washington State University Cpt S 223 – Advanced Data Structures Graph Algorithms: Minimum.
The greedy method Suppose that a problem can be solved by a sequence of decisions. The greedy method has that each decision is locally optimal. These.
Algorithmic Foundations COMP108 COMP108 Algorithmic Foundations Greedy methods Prudence Wong
Chapter 9 – Graphs A graph G=(V,E) – vertices and edges
Dijkstras Algorithm Named after its discoverer, Dutch computer scientist Edsger Dijkstra, is an algorithm that solves the single-source shortest path problem.
GRAPH THEORY.  A graph is a collection of vertices and edges.  An edge is a connection between two vertices (or nodes).  One can draw a graph by marking.
COMP108 Time Complexity of Pseudo Code. Example 1 sum = 0 for i = 1 to n do begin sum = sum + A[i] end output sum O(n)
Graph Theory Topics to be covered:
Dijkstra’s Algorithm. Announcements Assignment #2 Due Tonight Exams Graded Assignment #3 Posted.
Module 5 – Networks and Decision Mathematics Chapter 23 – Undirected Graphs.
CS Data Structures II Review & Final Exam. 2 Topics Review Final Exam.
Spanning Trees CSIT 402 Data Structures II 1. 2 Two Algorithms Prim: (build tree incrementally) – Pick lower cost edge connected to known (incomplete)
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.
Agenda Review: –Planar Graphs Lecture Content:  Concepts of Trees  Spanning Trees  Binary Trees Exercise.
Review for Final Exam – cs411/511 Definitions (5 questions, 2 points each) Algorithm Analysis (3 questions, 3 points each) General Questions (3 questions,
1 Prim’s algorithm. 2 Minimum Spanning Tree Given a weighted undirected graph G, find a tree T that spans all the vertices of G and minimizes the sum.
Graphs Chapter 12. Chapter 12: Graphs2 Chapter Objectives To become familiar with graph terminology and the different types of graphs To study a Graph.
CSCI2100 Data Structures Tutorial 12
Review for E&CE Find the minimal cost spanning tree for the graph below (where Values on edges represent the costs). 3 Ans. 18.
Prims Algorithm for finding a minimum spanning tree
1) Find and label the degree of each vertex in the graph.
Graphs Definition: a graph is an abstract representation of a set of objects where some pairs of the objects are connected by links. The interconnected.
1.[10] Suppose we have 14 integers: 10, 100, 30, 130, 80, 50, 140, 20, 60, 70, 120, 40, 90, 110. Please create a 2-3 tree by inserting one integer at a.
COMP9024: Data Structures and Algorithms Course Outline Hui Wu Session 1, 2016
Unit 11 Graphs (2) King Fahd University of Petroleum & Minerals College of Computer Science & Engineering Information & Computer Science Department.
COMP9024: Data Structures and Algorithms
CSE 373 Topological Sort Graph Traversals
Data Structures and Algorithms I
COMP108 Algorithmic Foundations Greedy methods
Minimum Spanning Tree Chapter 13.6.
COMP9024: Data Structures and Algorithms
Exam Hints.
Discrete Math 2 Weighted Graph Search Tree
Cinda Heeren / Geoffrey Tien
CISC 235: Topic 10 Graph Algorithms.
Strings: Tries, Suffix Trees
SINGLE-SOURCE SHORTEST PATHS IN DAGs
Unweighted Shortest Path Neil Tang 3/11/2010
CSE332: Data Abstractions About the Final
Short paths and spanning trees
More Graph Algorithms.
Graph Algorithm.
Graphs Graph transversals.
Elementary Graph Algorithms
CS 3343: Analysis of Algorithms
Connected Components Minimum Spanning Tree
Graph Representation (23.1/22.1)
Unit-4: Dynamic Programming
Chapter 11 Graphs.
Binary Trees: Motivation
ITEC 2620M Introduction to Data Structures
CSCI2100 Data Structures Tutorial
Strings: Tries, Suffix Trees
Graph Algorithms: Shortest Path
CSE 417: Algorithms and Computational Complexity
Richard Anderson Winter 2019 Lecture 6
Richard Anderson Autumn 2015 Lecture 6
Presentation transcript:

COMP9024: Data Structures and Algorithms Final Exam Hui Wu Session 2, 2015 http://www.cse.unsw.edu.au/~cs9024

Final Exam Time: 8:45 am – 12:00 Fri 13/11/2015 Venue: The Scientia - Gallery Duration: 3 hours Closed book Two parts Part 1: Basic data structures and algorithms 8 problems (40 marks) Part 2: Design and analysis of algorithms 5 problems (60 marks) Descriptions of algorithms Use pseudo code

Topics Not Examinable Java Programming Language Red-Black Trees Amortized time complexity analysis Design and Analysis of randomized algorithms All the topics not in the textbook

Sample Problems in Part 1 (1/3) Summarize the time complexity of finding a path between two vertices u and v in an undirected graph.

Sample Problems in Part 1 (2/3) Draw the frequency array and Huffman tree for the following string: "dogs do not spot hot pots or cats"

Sample Problems in Part 1 (3/3) Given a (2,4) tree shown below, draw the resultant (2,4) trees after deleting key 12 and inserting key 30, and the intermediate tree after each step (splitting, or fusion or transfer). 10 15 24 v 2 8 12 18 27 32 35

Sample Problems in Part 2 (1/4) Design an algorithm with the time complexity O(n)for testing if a binary search tree with n entries is an AVL tree, and explain why your algorithm has O(n) time complexity.

Sample Problems in Part 2 (2/4) An edge-weighted DAG (directed acyclic graph)is the DAG where each edge has a weight. The path length of a path from a vertex u to a vertex v is the sum of all the edge weights of the path. A shortest path from a vertex u to a vertex v is the path with the minimum path length. Describe an efficient algorithm for finding a shorted path from a vertex u to a vertex v in a weighted DAG G, and analyze its time complexity in Big-O notation.

Sample Problems in Part 2 (3/4) Show how to modify the KPM pattern matching algorithm so as to find every occurrence of a pattern string P that appears as a substring in T, while still running in O(n+m) time. (Be sure to catch even those matches that overlap.)

Sample Problems in Part 2 (4/4) Show how to modify the KPM pattern matching algorithm so as to find every occurrence of a pattern string P that appears as a substring in T, while still running in O(n+m) time. (Be sure to catch even those matches that overlap.)