COMP9024: Data Structures and Algorithms

Slides:



Advertisements
Similar presentations
授課教授:李錫智 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.
Advertisements

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.
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.
More Graph Algorithms Weiss ch Exercise: MST idea from yesterday Alternative minimum spanning tree algorithm idea Idea: Look at smallest edge not.
Huffman Codes Message consisting of five characters: a, b, c, d,e
Algorithmic Foundations COMP108 COMP108 Algorithmic Foundations Greedy methods Prudence Wong
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)
Binary Search From solving a problem to verifying an answer.
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)
Final Exam Tuesday, December 22nd 2:00 - 3:50pm room 102 Warren Weaver Hall.
COMP9024: Data Structures and Algorithms
COMP9024: Data Structures and Algorithms Course Outline Hui Wu Session 1, 2016
Algorithm homework help For More Detail help.aspx - Phone:-
CSCE 210 Data Structures and Algorithms
Data Structures Interview Questions.
COMP9024: Data Structures and Algorithms
CSCE 3110 Data Structures & Algorithm Analysis
CSCE 3110 Data Structures & Algorithm Analysis
Tries 07/28/16 11:04 Text Compression
Top 50 Data Structures Interview Questions
Tries 5/27/2018 3:08 AM Tries Tries.
CSE 373 Topological Sort Graph Traversals
Data Structures and Algorithms I
PROJECT -1 (4 points) Week before midterm, C++.
Minimum Spanning Tree Chapter 13.6.
Exam Hints.
Week 15 – Monday CS221.
Data Structures Review Session 2
The Greedy Method and Text Compression
Lecture 25 Splay Tree Chapter 10 of textbook
CC 215 Data Structures Graph Searching
Strings: Tries, Suffix Trees
SINGLE-SOURCE SHORTEST PATHS IN DAGs
Unweighted Shortest Path Neil Tang 3/11/2010
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.
CSE 326: Data Structures: Midterm Review
Short paths and spanning trees
More Graph Algorithms.
COMP2121: Microprocessors and Interfacing
Graph Algorithm.
Elementary Graph Algorithms
CS 3343: Analysis of Algorithms
Graph & BFS.
Dijkstra’s Algorithm We are given a directed weighted graph
CS 3343: Analysis of Algorithms
CIS16 Application Development and Programming using Visual Basic.net
CS 3343: Analysis of Algorithms
Data Structures Review Session
v z Chapter 10 AVL Trees Acknowledgement: These slides are adapted from slides provided with Data Structures and Algorithms in C++, Goodrich,
CSE 214 – Computer Science II B-Trees
Based on slides by Harry Zhou Read Sections 12, 13, 6, 18, 16.3
CS 3343: Analysis of Algorithms
CSE 373 Data Structures Lecture 16
Binary Trees: Motivation
ITEC 2620M Introduction to Data Structures
Tries 2/23/2019 8:29 AM Tries 2/23/2019 8:29 AM Tries.
Topic 5: Heap data structure heap sort Priority queue
Overview Analysis Notation Specific ADTs
Revision of C++.
Algorithms Searching in a Graph.
Strings: Tries, Suffix Trees
COP3530- Data Structures Introduction
Podcast Ch23d Title: Huffman Compression
Lecture 11 Graph Algorithms
Priority Queues Binary Heaps
Topic 10 Trees.
Presentation transcript:

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

Final Exam Time: 1:45 pm – 5:00pm Mon 27/06/2016 Venue: The Scientia - Leighton Hall 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/5) Consider the following algorithm. Use one sentence to describe what this algorithm does. What is its time complexity in big-O notation?

Sample Problems in Part 1 (2/5) Algorithm Unknown(A[]) Input: A[]: a one dimensional integer array of size n Output: to be determined { sum=0; Create an empty queue Q; for (i=0; i<n-1; n++) { if A[i] is an even number while (S is not empty) sum=sum+Q.dequeue(); else Q.enqueue(A[i]); } while (Q is not empty)

Sample Problems in Part 1 (3/5) What does a splay tree look like if its entries are accessed in increasing order of their keys?

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

Sample Problems in Part 1 (5/5) 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/3) 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/3) 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/3) 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.)