COMP 251 Winter 2017 Online quizzes with answers

Size: px
Start display at page:

Download "COMP 251 Winter 2017 Online quizzes with answers"

Transcription

1 COMP 251 Winter 2017 Online quizzes with answers Open Addressing (2) Which of the following assertions are true about open address tables? A. You cannot store more records than the total number of slots in the table. B. There are no collisions. C. We cannot delete elements in open address tables. D. Families of hash functions must allow a full permutation of the index of the table. Load Factor (2) Let n be the number of keys and m the number of slots in a hash tables where collisions are resolved by chaining. The load factor n/m is: A. The average number of slots used to store the keys. B. The maximal number of collisions. C. The average length of a list. Search Time (2) Assuming we can compute the hash value of a key k in O(1) time, the search time in an hash table where collisions are resolved by chaining is: A. Always executed in constant time O(1). B. Determined by the load factor. C. O(1) if and only if there are no collisions. Running Time of Heapify (3) What is the recursive equation giving the best case running time of the function heapify on a heap of size n (i.e. when n nodes are stored in the heap)? A. T(n) = O(1) B. T(n) = T( n/3 ) + O(1) C. T(n) = T( 2*n/3 ) + O(1) Heapsort (3) We want to modify Heapsort algorithm seen in class, to sort integers in decreasing order. What should you do? A. After heapify, extract directly the last element of the heap (instead of the first one). B. After heapify, swap the root with the largest of its two children. C. Replace Max-Heaps by Min-Heaps. Heaps as Trees (3) 1

2 How many leaves has a heap containing n elements? A. floor( n / 4 ) B. ceil( n / 2 ) C. ceil( n / 3 ) Binary Trees as Arrays (3) Let i be the index of a node n in a binary tree represented as an array. What is the index of the right child of the left child of n? A. 2i+1 B. 4i+1 C. 4i Insertion in BST Trees (4) The worst case running time of insertions in BST trees with n nodes is: A. Ω(logn) B. O(n) C. Θ(logn) D. Θ(n) E. O(logn) Rotations (4) Which assertion(s) are true? A. AVL properties can be restored using rotations. B. Rotations preserve BST properties. C. Rotations preserve AVL tree properties. D. In the worst case, a rotation has a O( log n ) running time. BST Sort (4) How should we modify BST sort to sort numbers in decreasing order? A. Use post-order traversal. B. Use an AVL tree instead of a BST. C. Reverse the order of recursive calls in in-order traversal. Properties of RB Trees (5) Let T be a red-black tree and x a node of this tree. Which of the following assertions are true? A. A leaf can be red if and only if its parent node is black. B. Half of the nodes on any path from x down to a leaf are black. C. If the left child of x is red, then its right child is red too. 2

3 D. The black height of the left and right sub-tree of x are identical. RB Tree Insert (5) In RB tree insert, we assign the red color to the new node N being inserted. This allows to: A. Preserve the black height of the paths traversing N. B. It does not matter. We can assign a black color instead and keep the same algorithm. C. Avoid two consecutive black nodes. Rotations I (5) Consider the tree shown above and the node x and y. Which operations are allowed around the edge (x,y)? A. One right rotation B. One right rotation followed by another right rotation. C. One right rotation followed by left rotation. D. One left rotation. Rotations II (5) Assume the tree above is a BST. We note h(a) (resp. h(b) and h(c)) the height of the subtree A (resp. B and C). We left rotate this tree at the level of x. After this rotation we have: A. h(x) = max( h(a), h(b) ) B. h(a) = h(b) C. h(y) = h(x) + 1 D. h(y) = h(a) + 2 Find (6) Disjoint sets are represented with an array rep[], that stores the representative rep[i] for each element i. The running time of the function find(i) that returns the representative of the set containing i is: A. Ω (1) B. Θ (logn) C. O (logn) Union (6) Let h(a) (resp. h(b)) be the height of the tree A (resp. B) rooted at x (resp. y). We assume that h(b) <= h(a)+1. After union(x,y), which assertion are true? A. h(y) = h(b) B. h(b) < h(y) C. h(y) = h(a) + 1 D. h(y) = max(h(a)+1, h(b)) 3

4 Greedy Choice (7) The greedy choice is a property that enable us to make a locally optimal choice at each step of the algorithm. Which of the following assertions are true? A. It requires to define optimal sub-structures. B. The algorithm is usually fast. C. It always guarantees to return an optimal solution for any problem where it is applied. Scheduling Problem (7) Consider the scheduling problem represented in the figure above. What will be the solution returned by the greedy algorithm introduced in class? A. a4, a1, a8, a9, a3 B. a4, a5, a2, a9, a6 C. None of these solutions. D. a4, a5, a6 E. a7, a5, a2, a9, a3 Representation of Graphs (8) We prefer to use an adjacency matrix vs a adjacency list to represent a graph when: A. The graph is sparse. B. The graph is a weighted graph. C. The graph is dense. D. The graph is directed. BFS Algorithms (8) Let G be a directed graph. We explore G using the BFS algorithm. Which of the following assertions are true? A. All vertices of G are visited even if G has disconnected components. B. The source s can be any vertex of G. C. All vertices at distance d from the source s are visited before vertices at distance d+1. D. The best case running time of BFS is Ω(V+E). Edge Classification (9) Let G be a directed graph. After DFS, we found that G has a back edge. A. G is connected. B. G is a tree. C. G has one cycle. D. G is an direct acyclic graph (DAG). Topological Sort (9) 4

5 Let G be a DAG. Let u and v be two vertices of G, such that there is a path from u to v in G. During the execution of topological sort algorithm, we discover u before v. Which following assertion is true? A. v appears before u in the total order. B. v appears after u in the total order. C. We cannot say anything about the order of u and v. Minimum Spanning Trees (10) Which assertions are true? A. A light edge crosses the cut. B. A MST is unique. C. A graph that respects the cut has no light edge. D. A light edge is unique. Kruskal's Algorithm (10) How do we decide if an edge (i,j) belongs to a MST during the execution of the Kruskal's algorithm? A. When the vertices i and j have not been used in the solution under construction (i.e. sub set of the MST). B. When the weight of (i,j) is the lowest among all candidate edges. C. When this edge connects two sets vertices that are not connected. Prim s Algorithm (10) Let G=(V,E) be a connected undirected weighted graph on which we run the Prim's algorithm to compute a MST. How many iterations the main loop of the algorithm (i.e. while loop in the slides used in class) will do? A. V ^ 2 B. E C. V - 1 D. E + V Edge Relaxation (11) In the figure above, what will be the value of d[v] after relaxation of the edge (u,v)? A. None of the values proposed B. 12 C. 17 D. 9 E. 7 Negative Weight Edges (11) We want to calculate the shortest paths from s in a DAG with negative weight edges. Is it ok? 5

6 A. Yes because there are no negative weight cycles. B. This is wrong! Negative weight edges are forbidden even in case of a DAG. C. Not a problem. Negative weight edges cannot be reached from the source. Dijkstra's Algorithm (11) Let u be a vertex extracted from the queue during the execution of the Dijkstra's algorithm. What would happen if we use a First-In-First-Out queue instead of a min priority queue? A. It does not matter. We can use a FIFO queue. B. We cannot guarantee that the shortest-path estimate of u is the shortest path from s to u. C. Relaxing the outgoing edges of u is useless (i.e. it will not change the shortest path estimates). Bipartite Decision (12) Which of the graphs (see Fig. 1) are bipartite? A. A B. B C. C Unstable edges (12) Consider the matching and the preferences shown in the figure (see Fig. 2). Which of the following statement is true? A. There are no unstable pairs. This is a stable matching. B. B-Z is an unstable pair. C. X-C is an unstable edge. D. Y-A is an unstable pair. Gale-Shapley Algorithm (12) Let A and B be two sets such that A = B =n. What is the best case running time for finding a stable match between A and B with the Gale-Shapley algorithm? A. Ω (n) B. Ω (n^2) C. O (1) D. O (n^2) 6

7 Capacity (13) What is the capacity c(e) of an edge e? A. The maximum value of the flow on that edge. B. The value of the flow on that edge. C. The maximal value of the flow out of the source. Residual Graph (13) Let (u,v) be an edge in G with a flow equal to 3 and a capacity of 5. What will be the residual capacities of the forward and backward edges? A. 5 for the forward and 3 for the backward B. 3 for the forward and 5 for the backward C. 3 for the forward and 2 for the backward D. 2 for the forward and 3 for the backward Augmenting Path (13) By how much can we increase the flow using the red path in the graph above? A. 0 B. 1 C. 2 D. 3 E. 4 F. 5 Capacity of Cuts (14) Let consider the flow network above. Each edge is annotated with its capacity. The blue oval shows a partition of the vertices. What is the capacity of this cut? A. 2 B. 6 C. 1 D. 5 Ford-Fulkerson Algorithm (14) Let G be a flow network, on which we ran the Ford-Fulkerson algorithm. At the end of its execution, which assertion are true? A. There are no augmenting paths in the residual graph. B. It exists at least one path from source s to the sink t in the residual graph. C. The value of the flow is equal to the sum of the capacities of the outgoing edges from s. D. The sum of the flow out of the source s is equal to the sum of the flow in the sink t. 7

8 Minimal Cut (14) Let consider the flow network above with a cut (shown in blue). All edges have a capacity of 1. Which assertion is true? A. This is cut but not a minimal cut. B. This is a minimal cut. C. This is not a cut. Sequence Alignment with Needleman-Wunsch (17) In the figure above, we use the Needleman-Wunsch algorithm to align 2 sequences. Which value will be stored in the cell colored in red? A. -1 B. 0 C. 1 Bellman-Ford (17) Given a graph G = ( V;E ) with positive edge weights, the Bellman-Ford algorithm and Dijkstra s algorithm can produce different shortest-path trees despite always producing the same shortest-path weights. A. True B. False Counting Alignments (17) We want to determine a recursion to calculate the number of sequence alignments c(m,n) between two sequences of size m and n, such that insertions are not not allowed. What is this recursion? A. c(m,n) = c(m-1,n-1) + c(m-1,n) B. c(m,n) = c(m-1,n) + c(m-1,n-1) + c(m,n-1) C. c(m,n) = c(m-1,n-1) D. c(m,n) = c(m-1,n) + c(m,n-1) Weighted interval scheduling (17) We use the backtracking technique to retrieve the sequence of activities with the maximal weight. The dynamic array is shown in the figure above. Activity 4 has just been selected. Which one will be selected next? A. a_1 B. a_2 C. a_3 D. a_5 8

9 Recurrences (18) We design an alternate version of Mergesort that divide an array of numbers into 3 sub-arrays instead of 2. What would be the recursion expressing its running time. A. T(n) = 3 * T(n/3) + Θ(n^2) B. T(n) = 2 * T(n/2) + Θ(n) C. T(n) = 2 * T(n/3) + Θ(n^2) D. T(n) = 3 * T(n/3) + Θ(n) Integer Multiplication I (18) A divide-and-conquer strategy to multiply two n-bytes integers is always more efficient (faster) than the brute force approach. A. True B. False Integer Multiplication II (18) The Karatsuba algorithm to multiply 2 integers is asymptotically optimal. A. True B. False Recursion Tree (19) Let T(n)=2*T(n/5)+n^3 be a recursive equation expressing the running time T(n) of a divide-andconquer algorithm. What is the height of the recursion tree? A. log_3 ( n ) B. log_2 ( n ) C. log_5 ( n ) Master Theorem I (19) Consider the recurrence T(n) = 3 * T(n/4) + n * log(n). Use the master theorem to determine its asymptotic behavior. A. Θ ( n * log^2 n ) B. Θ ( n^log_4(3) ) C. The master theorem cannot be applied D. Θ ( n * log n ) Master Theorem II (19) Consider the recurrence T(n) = 4 * T(n/2) + log(n). Use the master theorem to determine its asymptotic behavior. A. The master theorem cannot be applied 9

10 B. Θ ( n^2 ) C. Θ ( log^2 n ) D. Θ ( log n ) "Infinite" Binary Counter (20) We consider a binary counter that does not limit the number of bits used to represent numbers (i.e. we can use as many bits as we need). We now consider a sequence of n operation INCREMENT. What is the amortized cost of INCREMENT? A. O(log n) B. O(n) C. O(1) Accounting Method (20) We introduce a new function MULTIPUSH(k) that pushes k object in a stack. We now consider sequences of PUSH, POP, MULTIPUSH and MULTIPOP operations. Here, k is a fixed value. What would be the amortized cost of MULTIPUSH(k) in the accounting method? A. 2*k B. 2 C. k Global Min-Cut (21) The contraction algorithm guarantees to find the global min-cut after at most n^2 log(n) executions. A. True B. False Contraction Algorithm (21) An execution of the contraction algorithm will find the global min-cut if it never contracts an edge that crosses a global min-cut. A. True B. False 3-SAT (21) We consider an instance of 3-SAT: (!x OR y OR z) AND (x OR y OR!z), where x, y and z and are boolean variables and! the NOT operator. Which assignment(s) satisfy this instance? A. x=false, y=false, z=false B. x=false, y=false, z=true C. x=true, y=false, z=true D. x=false, y=true, z=true 10

11 ANSWER SHEET Open Addressing A D Representations of G C Minimal Cut A Load Factor C BFS Algorithm B C D Neddleman-Wunsch B Search Time B Edge Classification C Bellman-Ford Algorithm A Running Time Heapify A Topological Sort B Counting Alignments A Heapsort C Minimum Span Trees A C Weighted Interval B Heaps as Trees B Kruskal s Algorithm C Recurrences D Binary Trees Arrays B Prim s Algorithm C Integer Multiplication I B Insertion BST Trees B Edge Relaxation D Integer Multiplication II B Rotations A B Negative Edges A Recursion Tree C BST Sort C Dijkstra s Algorithm B Master Theorem I D RB Tree Properties B Bipartite Decision A B Master Theorem II B RB Tree Insert A Unstable Edges C Infinite Binary Counter C Rotations I D Gale-Shapley Algo. A Accounting Method C Rotations II A Capacity A Global Min-Cut B Find B Residual Graph D Contraction Algorithm A Union C D Network Flow B 3-SAT A C D Greedy Choice A B C Capacity of Cuts D Scheduling Problem A Ford-Fulkerson Algo. A D 11

CSci 231 Final Review

CSci 231 Final Review CSci 231 Final Review Here is a list of topics for the final. Generally you are responsible for anything discussed in class (except topics that appear italicized), and anything appearing on the homeworks.

More information

CS521 \ Notes for the Final Exam

CS521 \ Notes for the Final Exam CS521 \ Notes for final exam 1 Ariel Stolerman Asymptotic Notations: CS521 \ Notes for the Final Exam Notation Definition Limit Big-O ( ) Small-o ( ) Big- ( ) Small- ( ) Big- ( ) Notes: ( ) ( ) ( ) ( )

More information

Department of Computer Applications. MCA 312: Design and Analysis of Algorithms. [Part I : Medium Answer Type Questions] UNIT I

Department of Computer Applications. MCA 312: Design and Analysis of Algorithms. [Part I : Medium Answer Type Questions] UNIT I MCA 312: Design and Analysis of Algorithms [Part I : Medium Answer Type Questions] UNIT I 1) What is an Algorithm? What is the need to study Algorithms? 2) Define: a) Time Efficiency b) Space Efficiency

More information

Course Review for Finals. Cpt S 223 Fall 2008

Course Review for Finals. Cpt S 223 Fall 2008 Course Review for Finals Cpt S 223 Fall 2008 1 Course Overview Introduction to advanced data structures Algorithmic asymptotic analysis Programming data structures Program design based on performance i.e.,

More information

Solutions to Exam Data structures (X and NV)

Solutions to Exam Data structures (X and NV) Solutions to Exam Data structures X and NV 2005102. 1. a Insert the keys 9, 6, 2,, 97, 1 into a binary search tree BST. Draw the final tree. See Figure 1. b Add NIL nodes to the tree of 1a and color it

More information

Direct Addressing Hash table: Collision resolution how handle collisions Hash Functions:

Direct Addressing Hash table: Collision resolution how handle collisions Hash Functions: Direct Addressing - key is index into array => O(1) lookup Hash table: -hash function maps key to index in table -if universe of keys > # table entries then hash functions collision are guaranteed => need

More information

& ( D. " mnp ' ( ) n 3. n 2. ( ) C. " n

& ( D.  mnp ' ( ) n 3. n 2. ( ) C.  n CSE Name Test Summer Last Digits of Mav ID # Multiple Choice. Write your answer to the LEFT of each problem. points each. The time to multiply two n " n matrices is: A. " n C. "% n B. " max( m,n, p). The

More information

Lecture Summary CSC 263H. August 5, 2016

Lecture Summary CSC 263H. August 5, 2016 Lecture Summary CSC 263H August 5, 2016 This document is a very brief overview of what we did in each lecture, it is by no means a replacement for attending lecture or doing the readings. 1. Week 1 2.

More information

Review of course COMP-251B winter 2010

Review of course COMP-251B winter 2010 Review of course COMP-251B winter 2010 Lecture 1. Book Section 15.2 : Chained matrix product Matrix product is associative Computing all possible ways of parenthesizing Recursive solution Worst-case running-time

More information

n 2 ( ) ( ) + n is in Θ n logn

n 2 ( ) ( ) + n is in Θ n logn CSE Test Spring Name Last Digits of Mav ID # Multiple Choice. Write your answer to the LEFT of each problem. points each. The time to multiply an m n matrix and a n p matrix is in: A. Θ( n) B. Θ( max(

More information

n 2 ( ) ( ) Ο f ( n) ( ) Ω B. n logn Ο

n 2 ( ) ( ) Ο f ( n) ( ) Ω B. n logn Ο CSE 220 Name Test Fall 20 Last 4 Digits of Mav ID # Multiple Choice. Write your answer to the LEFT of each problem. 4 points each. The time to compute the sum of the n elements of an integer array is in:

More information

( ). Which of ( ) ( ) " #& ( ) " # g( n) ( ) " # f ( n) Test 1

( ). Which of ( ) ( )  #& ( )  # g( n) ( )  # f ( n) Test 1 CSE 0 Name Test Summer 006 Last Digits of Student ID # Multiple Choice. Write your answer to the LEFT of each problem. points each. The time to multiply two n x n matrices is: A. "( n) B. "( nlogn) # C.

More information

D. Θ nlogn ( ) D. Ο. ). Which of the following is not necessarily true? . Which of the following cannot be shown as an improvement? D.

D. Θ nlogn ( ) D. Ο. ). Which of the following is not necessarily true? . Which of the following cannot be shown as an improvement? D. CSE 0 Name Test Fall 00 Last Digits of Mav ID # Multiple Choice. Write your answer to the LEFT of each problem. points each. The time to convert an array, with priorities stored at subscripts through n,

More information

Algorithm Design (8) Graph Algorithms 1/2

Algorithm Design (8) Graph Algorithms 1/2 Graph Algorithm Design (8) Graph Algorithms / Graph:, : A finite set of vertices (or nodes) : A finite set of edges (or arcs or branches) each of which connect two vertices Takashi Chikayama School of

More information

( ) + n. ( ) = n "1) + n. ( ) = T n 2. ( ) = 2T n 2. ( ) = T( n 2 ) +1

( ) + n. ( ) = n 1) + n. ( ) = T n 2. ( ) = 2T n 2. ( ) = T( n 2 ) +1 CSE 0 Name Test Summer 00 Last Digits of Student ID # Multiple Choice. Write your answer to the LEFT of each problem. points each. Suppose you are sorting millions of keys that consist of three decimal

More information

logn D. Θ C. Θ n 2 ( ) ( ) f n B. nlogn Ο n2 n 2 D. Ο & % ( C. Θ # ( D. Θ n ( ) Ω f ( n)

logn D. Θ C. Θ n 2 ( ) ( ) f n B. nlogn Ο n2 n 2 D. Ο & % ( C. Θ # ( D. Θ n ( ) Ω f ( n) CSE 0 Test Your name as it appears on your UTA ID Card Fall 0 Multiple Choice:. Write the letter of your answer on the line ) to the LEFT of each problem.. CIRCLED ANSWERS DO NOT COUNT.. points each. The

More information

Test 1 Last 4 Digits of Mav ID # Multiple Choice. Write your answer to the LEFT of each problem. 2 points each t 1

Test 1 Last 4 Digits of Mav ID # Multiple Choice. Write your answer to the LEFT of each problem. 2 points each t 1 CSE 0 Name Test Fall 00 Last Digits of Mav ID # Multiple Choice. Write your answer to the LEFT of each problem. points each t. What is the value of k? k=0 A. k B. t C. t+ D. t+ +. Suppose that you have

More information

Computer Science 302 Spring 2017 (Practice for) Final Examination, May 10, 2017

Computer Science 302 Spring 2017 (Practice for) Final Examination, May 10, 2017 Computer Science 302 Spring 2017 (Practice for) Final Examination, May 10, 2017 Name: The entire practice examination is 1005 points. 1. True or False. [5 points each] The time to heapsort an array of

More information

( ) D. Θ ( ) ( ) Ο f ( n) ( ) Ω. C. T n C. Θ. B. n logn Ο

( ) D. Θ ( ) ( ) Ο f ( n) ( ) Ω. C. T n C. Θ. B. n logn Ο CSE 0 Name Test Fall 0 Multiple Choice. Write your answer to the LEFT of each problem. points each. The expected time for insertion sort for n keys is in which set? (All n! input permutations are equally

More information

( ) n 3. n 2 ( ) D. Ο

( ) n 3. n 2 ( ) D. Ο CSE 0 Name Test Summer 0 Last Digits of Mav ID # Multiple Choice. Write your answer to the LEFT of each problem. points each. The time to multiply two n n matrices is: A. Θ( n) B. Θ( max( m,n, p) ) C.

More information

( ) 1 B. 1. Suppose f x

( ) 1 B. 1. Suppose f x CSE Name Test Spring Last Digits of Student ID Multiple Choice. Write your answer to the LEFT of each problem. points each is a monotonically increasing function. Which of the following approximates the

More information

Final Examination CSE 100 UCSD (Practice)

Final Examination CSE 100 UCSD (Practice) Final Examination UCSD (Practice) RULES: 1. Don t start the exam until the instructor says to. 2. This is a closed-book, closed-notes, no-calculator exam. Don t refer to any materials other than the exam

More information

9. The expected time for insertion sort for n keys is in which set? (All n! input permutations are equally likely.)

9. The expected time for insertion sort for n keys is in which set? (All n! input permutations are equally likely.) CSE 0 Name Test Spring 006 Last 4 Digits of Student ID # Multiple Choice. Write your answer to the LEFT of each problem. points each. Suppose f ( x) is a monotonically increasing function. Which of the

More information

Thomas H. Cormen Charles E. Leiserson Ronald L. Rivest. Introduction to Algorithms

Thomas H. Cormen Charles E. Leiserson Ronald L. Rivest. Introduction to Algorithms Thomas H. Cormen Charles E. Leiserson Ronald L. Rivest Introduction to Algorithms Preface xiii 1 Introduction 1 1.1 Algorithms 1 1.2 Analyzing algorithms 6 1.3 Designing algorithms 1 1 1.4 Summary 1 6

More information

Multiple Choice. Write your answer to the LEFT of each problem. 3 points each

Multiple Choice. Write your answer to the LEFT of each problem. 3 points each CSE 0-00 Test Spring 0 Name Last 4 Digits of Student ID # Multiple Choice. Write your answer to the LEFT of each problem. points each. Suppose f ( x) is a monotonically increasing function. Which of the

More information

Data Structure. A way to store and organize data in order to support efficient insertions, queries, searches, updates, and deletions.

Data Structure. A way to store and organize data in order to support efficient insertions, queries, searches, updates, and deletions. DATA STRUCTURES COMP 321 McGill University These slides are mainly compiled from the following resources. - Professor Jaehyun Park slides CS 97SI - Top-coder tutorials. - Programming Challenges book. Data

More information

Review for Midterm Exam

Review for Midterm Exam Review for Midterm Exam 1 Policies and Overview midterm exam policies overview of problems, algorithms, data structures overview of discrete mathematics 2 Sample Questions on the cost functions of algorithms

More information

( D. Θ n. ( ) f n ( ) D. Ο%

( D. Θ n. ( ) f n ( ) D. Ο% CSE 0 Name Test Spring 0 Multiple Choice. Write your answer to the LEFT of each problem. points each. The time to run the code below is in: for i=n; i>=; i--) for j=; j

More information

Data Structures Question Bank Multiple Choice

Data Structures Question Bank Multiple Choice Section 1. Fundamentals: Complexity, Algorthm Analysis 1. An algorithm solves A single problem or function Multiple problems or functions Has a single programming language implementation 2. A solution

More information

Lecture 3: Graphs and flows

Lecture 3: Graphs and flows Chapter 3 Lecture 3: Graphs and flows Graphs: a useful combinatorial structure. Definitions: graph, directed and undirected graph, edge as ordered pair, path, cycle, connected graph, strongly connected

More information

Module 2: Classical Algorithm Design Techniques

Module 2: Classical Algorithm Design Techniques Module 2: Classical Algorithm Design Techniques Dr. Natarajan Meghanathan Associate Professor of Computer Science Jackson State University Jackson, MS 39217 E-mail: natarajan.meghanathan@jsums.edu Module

More information

Algorithms and Data Structures (INF1) Lecture 15/15 Hua Lu

Algorithms and Data Structures (INF1) Lecture 15/15 Hua Lu Algorithms and Data Structures (INF1) Lecture 15/15 Hua Lu Department of Computer Science Aalborg University Fall 2007 This Lecture Minimum spanning trees Definitions Kruskal s algorithm Prim s algorithm

More information

CSE373: Data Structures & Algorithms Lecture 28: Final review and class wrap-up. Nicki Dell Spring 2014

CSE373: Data Structures & Algorithms Lecture 28: Final review and class wrap-up. Nicki Dell Spring 2014 CSE373: Data Structures & Algorithms Lecture 28: Final review and class wrap-up Nicki Dell Spring 2014 Final Exam As also indicated on the web page: Next Tuesday, 2:30-4:20 in this room Cumulative but

More information

CS 341: Algorithms. Douglas R. Stinson. David R. Cheriton School of Computer Science University of Waterloo. February 26, 2019

CS 341: Algorithms. Douglas R. Stinson. David R. Cheriton School of Computer Science University of Waterloo. February 26, 2019 CS 341: Algorithms Douglas R. Stinson David R. Cheriton School of Computer Science University of Waterloo February 26, 2019 D.R. Stinson (SCS) CS 341 February 26, 2019 1 / 296 1 Course Information 2 Introduction

More information

n 2 C. Θ n ( ) Ο f ( n) B. n 2 Ω( n logn)

n 2 C. Θ n ( ) Ο f ( n) B. n 2 Ω( n logn) CSE 0 Name Test Fall 0 Last Digits of Mav ID # Multiple Choice. Write your answer to the LEFT of each problem. points each. The time to find the maximum of the n elements of an integer array is in: A.

More information

Midterm solutions. n f 3 (n) = 3

Midterm solutions. n f 3 (n) = 3 Introduction to Computer Science 1, SE361 DGIST April 20, 2016 Professors Min-Soo Kim and Taesup Moon Midterm solutions Midterm solutions The midterm is a 1.5 hour exam (4:30pm 6:00pm). This is a closed

More information

Outline. Graphs. Divide and Conquer.

Outline. Graphs. Divide and Conquer. GRAPHS COMP 321 McGill University These slides are mainly compiled from the following resources. - Professor Jaehyun Park slides CS 97SI - Top-coder tutorials. - Programming Challenges books. Outline Graphs.

More information

A6-R3: DATA STRUCTURE THROUGH C LANGUAGE

A6-R3: DATA STRUCTURE THROUGH C LANGUAGE A6-R3: DATA STRUCTURE THROUGH C LANGUAGE NOTE: 1. There are TWO PARTS in this Module/Paper. PART ONE contains FOUR questions and PART TWO contains FIVE questions. 2. PART ONE is to be answered in the TEAR-OFF

More information

1. [1 pt] What is the solution to the recurrence T(n) = 2T(n-1) + 1, T(1) = 1

1. [1 pt] What is the solution to the recurrence T(n) = 2T(n-1) + 1, T(1) = 1 Asymptotics, Recurrence and Basic Algorithms 1. [1 pt] What is the solution to the recurrence T(n) = 2T(n-1) + 1, T(1) = 1 2. O(n) 2. [1 pt] What is the solution to the recurrence T(n) = T(n/2) + n, T(1)

More information

9. Which situation is true regarding a cascading cut that produces c trees for a Fibonacci heap?

9. Which situation is true regarding a cascading cut that produces c trees for a Fibonacci heap? 1 1 Name Test 1 - Closed Book Student ID # Multiple Choice. Write your answer to the LEFT of each problem. points each 1. During which operation on a leftist heap may subtree swaps be needed? A. DECREASE-KEY

More information

Final Exam. EECS 2011 Prof. J. Elder - 1 -

Final Exam. EECS 2011 Prof. J. Elder - 1 - Final Exam Ø Wed Apr 11 2pm 5pm Aviva Tennis Centre Ø Closed Book Ø Format similar to midterm Ø Will cover whole course, with emphasis on material after midterm (maps and hash tables, binary search, loop

More information

Introduction to Algorithms Third Edition

Introduction to Algorithms Third Edition Thomas H. Cormen Charles E. Leiserson Ronald L. Rivest Clifford Stein Introduction to Algorithms Third Edition The MIT Press Cambridge, Massachusetts London, England Preface xiü I Foundations Introduction

More information

Weighted Graphs and Greedy Algorithms

Weighted Graphs and Greedy Algorithms COMP 182 Algorithmic Thinking Weighted Graphs and Greedy Algorithms Luay Nakhleh Computer Science Rice University Reading Material Chapter 10, Section 6 Chapter 11, Sections 4, 5 Weighted Graphs In many

More information

Design and Analysis of Algorithms

Design and Analysis of Algorithms CSE 1, Winter 201 Design and Analysis of Algorithms Lecture 7: Bellman-Ford, SPs in DAGs, PQs Class URL: http://vlsicad.ucsd.edu/courses/cse1-w1/ Lec. Added after class Figure.: Single-Edge Extensions

More information

1. [1 pt] What is the solution to the recurrence T(n) = 2T(n-1) + 1, T(1) = 1

1. [1 pt] What is the solution to the recurrence T(n) = 2T(n-1) + 1, T(1) = 1 Asymptotics, Recurrence and Basic Algorithms 1. [1 pt] What is the solution to the recurrence T(n) = 2T(n-1) + 1, T(1) = 1 1. O(logn) 2. O(n) 3. O(nlogn) 4. O(n 2 ) 5. O(2 n ) 2. [1 pt] What is the solution

More information

) $ f ( n) " %( g( n)

) $ f ( n)  %( g( n) CSE 0 Name Test Spring 008 Last Digits of Mav ID # Multiple Choice. Write your answer to the LEFT of each problem. points each. The time to compute the sum of the n elements of an integer array is: # A.

More information

CSE 100: GRAPH ALGORITHMS

CSE 100: GRAPH ALGORITHMS CSE 100: GRAPH ALGORITHMS Dijkstra s Algorithm: Questions Initialize the graph: Give all vertices a dist of INFINITY, set all done flags to false Start at s; give s dist = 0 and set prev field to -1 Enqueue

More information

( ) ( ) C. " 1 n. ( ) $ f n. ( ) B. " log( n! ) ( ) and that you already know ( ) ( ) " % g( n) ( ) " #&

( ) ( ) C.  1 n. ( ) $ f n. ( ) B.  log( n! ) ( ) and that you already know ( ) ( )  % g( n) ( )  #& CSE 0 Name Test Summer 008 Last 4 Digits of Mav ID # Multiple Choice. Write your answer to the LEFT of each problem. points each. The time for the following code is in which set? for (i=0; i

More information

Lecture 7. Transform-and-Conquer

Lecture 7. Transform-and-Conquer Lecture 7 Transform-and-Conquer 6-1 Transform and Conquer This group of techniques solves a problem by a transformation to a simpler/more convenient instance of the same problem (instance simplification)

More information

E.G.S. PILLAY ENGINEERING COLLEGE (An Autonomous Institution, Affiliated to Anna University, Chennai) Nagore Post, Nagapattinam , Tamilnadu.

E.G.S. PILLAY ENGINEERING COLLEGE (An Autonomous Institution, Affiliated to Anna University, Chennai) Nagore Post, Nagapattinam , Tamilnadu. 17CA 104DATA STRUCTURES Academic Year : 018-019 Programme : MCA Year / Semester : I / I Question Bank Course Coordinator: Mrs. C.Mallika Course Objectives The student should be able to 1. To understand

More information

Design and Analysis of Algorithms - - Assessment

Design and Analysis of Algorithms - - Assessment X Courses» Design and Analysis of Algorithms Week 1 Quiz 1) In the code fragment below, start and end are integer values and prime(x) is a function that returns true if x is a prime number and false otherwise.

More information

ECE250: Algorithms and Data Structures Final Review Course

ECE250: Algorithms and Data Structures Final Review Course ECE250: Algorithms and Data Structures Final Review Course Ladan Tahvildari, PEng, SMIEEE Professor Software Technologies Applied Research (STAR) Group Dept. of Elect. & Comp. Eng. University of Waterloo

More information

1. To reduce the probability of having any collisions to < 0.5 when hashing n keys, the table should have at least this number of elements.

1. To reduce the probability of having any collisions to < 0.5 when hashing n keys, the table should have at least this number of elements. CSE 5311 Test 1 - Closed Book Spring 004 Name Student ID # Multiple Choice. Write your answer to the LEFT of each problem. 4 points each 1. To reduce the probability of having any collisions to < 0.5 when

More information

Fundamental Algorithms

Fundamental Algorithms Fundamental Algorithms Chapter 8: Graphs Jan Křetínský Winter 2017/18 Chapter 8: Graphs, Winter 2017/18 1 Graphs Definition (Graph) A graph G = (V, E) consists of a set V of vertices (nodes) and a set

More information

22 Elementary Graph Algorithms. There are two standard ways to represent a

22 Elementary Graph Algorithms. There are two standard ways to represent a VI Graph Algorithms Elementary Graph Algorithms Minimum Spanning Trees Single-Source Shortest Paths All-Pairs Shortest Paths 22 Elementary Graph Algorithms There are two standard ways to represent a graph

More information

( ) n 5. Test 1 - Closed Book

( ) n 5. Test 1 - Closed Book Name Test 1 - Closed Book Student ID # Multiple Choice. Write your answer to the LEFT of each problem. points each 1. During which operation on a leftist heap may subtree swaps be needed? A. DECREASE-KEY

More information

The ADT priority queue Orders its items by a priority value The first item removed is the one having the highest priority value

The ADT priority queue Orders its items by a priority value The first item removed is the one having the highest priority value The ADT priority queue Orders its items by a priority value The first item removed is the one having the highest priority value 1 Possible implementations Sorted linear implementations o Appropriate if

More information

Problem 1. Which of the following is true of functions =100 +log and = + log? Problem 2. Which of the following is true of functions = 2 and =3?

Problem 1. Which of the following is true of functions =100 +log and = + log? Problem 2. Which of the following is true of functions = 2 and =3? Multiple-choice Problems: Problem 1. Which of the following is true of functions =100+log and =+log? a) = b) =Ω c) =Θ d) All of the above e) None of the above Problem 2. Which of the following is true

More information

managing an evolving set of connected components implementing a Union-Find data structure implementing Kruskal s algorithm

managing an evolving set of connected components implementing a Union-Find data structure implementing Kruskal s algorithm Spanning Trees 1 Spanning Trees the minimum spanning tree problem three greedy algorithms analysis of the algorithms 2 The Union-Find Data Structure managing an evolving set of connected components implementing

More information

END-TERM EXAMINATION

END-TERM EXAMINATION (Please Write your Exam Roll No. immediately) Exam. Roll No... END-TERM EXAMINATION Paper Code : MCA-205 DECEMBER 2006 Subject: Design and analysis of algorithm Time: 3 Hours Maximum Marks: 60 Note: Attempt

More information

CISC 320 Midterm Exam

CISC 320 Midterm Exam Name: CISC 320 Midterm Exam Wednesday, Mar 25, 2015 There are 19 questions. The first 15 questions count 4 points each. For the others, points are individually shown. The total is 100 points. Multiple

More information

COSC 2007 Data Structures II Final Exam. Part 1: multiple choice (1 mark each, total 30 marks, circle the correct answer)

COSC 2007 Data Structures II Final Exam. Part 1: multiple choice (1 mark each, total 30 marks, circle the correct answer) COSC 2007 Data Structures II Final Exam Thursday, April 13 th, 2006 This is a closed book and closed notes exam. There are total 3 parts. Please answer the questions in the provided space and use back

More information

End-Term Examination Second Semester [MCA] MAY-JUNE 2006

End-Term Examination Second Semester [MCA] MAY-JUNE 2006 (Please write your Roll No. immediately) Roll No. Paper Code: MCA-102 End-Term Examination Second Semester [MCA] MAY-JUNE 2006 Subject: Data Structure Time: 3 Hours Maximum Marks: 60 Note: Question 1.

More information

Minimum Spanning Trees Ch 23 Traversing graphs

Minimum Spanning Trees Ch 23 Traversing graphs Next: Graph Algorithms Graphs Ch 22 Graph representations adjacency list adjacency matrix Minimum Spanning Trees Ch 23 Traversing graphs Breadth-First Search Depth-First Search 11/30/17 CSE 3101 1 Graphs

More information

Data Structures Brett Bernstein

Data Structures Brett Bernstein Data Structures Brett Bernstein Final Review 1. Consider a binary tree of height k. (a) What is the maximum number of nodes? (b) What is the maximum number of leaves? (c) What is the minimum number of

More information

L.J. Institute of Engineering & Technology Semester: VIII (2016)

L.J. Institute of Engineering & Technology Semester: VIII (2016) Subject Name: Design & Analysis of Algorithm Subject Code:1810 Faculties: Mitesh Thakkar Sr. UNIT-1 Basics of Algorithms and Mathematics No 1 What is an algorithm? What do you mean by correct algorithm?

More information

CS2223: Algorithms Sorting Algorithms, Heap Sort, Linear-time sort, Median and Order Statistics

CS2223: Algorithms Sorting Algorithms, Heap Sort, Linear-time sort, Median and Order Statistics CS2223: Algorithms Sorting Algorithms, Heap Sort, Linear-time sort, Median and Order Statistics 1 Sorting 1.1 Problem Statement You are given a sequence of n numbers < a 1, a 2,..., a n >. You need to

More information

Module 5 Graph Algorithms

Module 5 Graph Algorithms Module 5 Graph lgorithms Dr. Natarajan Meghanathan Professor of Computer Science Jackson State University Jackson, MS 97 E-mail: natarajan.meghanathan@jsums.edu 5. Graph Traversal lgorithms Depth First

More information

Course goals. exposure to another language. knowledge of specific data structures. impact of DS design & implementation on program performance

Course goals. exposure to another language. knowledge of specific data structures. impact of DS design & implementation on program performance Course goals exposure to another language C++ Object-oriented principles knowledge of specific data structures lists, stacks & queues, priority queues, dynamic dictionaries, graphs impact of DS design

More information

CS 251, LE 2 Fall MIDTERM 2 Tuesday, November 1, 2016 Version 00 - KEY

CS 251, LE 2 Fall MIDTERM 2 Tuesday, November 1, 2016 Version 00 - KEY CS 251, LE 2 Fall 2016 MIDTERM 2 Tuesday, November 1, 2016 Version 00 - KEY W1.) (i) Show one possible valid 2-3 tree containing the nine elements: 1 3 4 5 6 8 9 10 12. (ii) Draw the final binary search

More information

Graphs and Network Flows ISE 411. Lecture 7. Dr. Ted Ralphs

Graphs and Network Flows ISE 411. Lecture 7. Dr. Ted Ralphs Graphs and Network Flows ISE 411 Lecture 7 Dr. Ted Ralphs ISE 411 Lecture 7 1 References for Today s Lecture Required reading Chapter 20 References AMO Chapter 13 CLRS Chapter 23 ISE 411 Lecture 7 2 Minimum

More information

Disclaimer. CS130A Winter 2008 Final Review. Information on the final exam. Suggestions

Disclaimer. CS130A Winter 2008 Final Review. Information on the final exam. Suggestions Disclaimer CS0 Winter 008 Final Review Shuo Wu Provided as is. Humanitarian purpose. Only served as a guideline/self-test for final preparation. Only a sketch/summary of important materials. You need to

More information

CSC Design and Analysis of Algorithms

CSC Design and Analysis of Algorithms CSC : Lecture 7 CSC - Design and Analysis of Algorithms Lecture 7 Transform and Conquer I Algorithm Design Technique CSC : Lecture 7 Transform and Conquer This group of techniques solves a problem by a

More information

2. Instance simplification Solve a problem s instance by transforming it into another simpler/easier instance of the same problem

2. Instance simplification Solve a problem s instance by transforming it into another simpler/easier instance of the same problem CmSc 20 Intro to Algorithms Chapter 6. Transform and Conquer Algorithms. Introduction This group of techniques solves a problem by a transformation to a simpler/more convenient instance of the same problem

More information

INDIAN STATISTICAL INSTITUTE

INDIAN STATISTICAL INSTITUTE INDIAN STATISTICAL INSTITUTE Mid Semestral Examination M. Tech (CS) - I Year, 2016-2017 (Semester - II) Design and Analysis of Algorithms Date : 21.02.2017 Maximum Marks : 60 Duration : 3.0 Hours Note:

More information

Part VI Graph algorithms. Chapter 22 Elementary Graph Algorithms Chapter 23 Minimum Spanning Trees Chapter 24 Single-source Shortest Paths

Part VI Graph algorithms. Chapter 22 Elementary Graph Algorithms Chapter 23 Minimum Spanning Trees Chapter 24 Single-source Shortest Paths Part VI Graph algorithms Chapter 22 Elementary Graph Algorithms Chapter 23 Minimum Spanning Trees Chapter 24 Single-source Shortest Paths 1 Chapter 22 Elementary Graph Algorithms Representations of graphs

More information

Recitation 9. Prelim Review

Recitation 9. Prelim Review Recitation 9 Prelim Review 1 Heaps 2 Review: Binary heap min heap 1 2 99 4 3 PriorityQueue Maintains max or min of collection (no duplicates) Follows heap order invariant at every level Always balanced!

More information

CSC Design and Analysis of Algorithms. Lecture 7. Transform and Conquer I Algorithm Design Technique. Transform and Conquer

CSC Design and Analysis of Algorithms. Lecture 7. Transform and Conquer I Algorithm Design Technique. Transform and Conquer // CSC - Design and Analysis of Algorithms Lecture 7 Transform and Conquer I Algorithm Design Technique Transform and Conquer This group of techniques solves a problem by a transformation to a simpler/more

More information

Practice Problems for the Final

Practice Problems for the Final ECE-250 Algorithms and Data Structures (Winter 2012) Practice Problems for the Final Disclaimer: Please do keep in mind that this problem set does not reflect the exact topics or the fractions of each

More information

Test 1 - Closed Book Last 4 Digits of Student ID # Multiple Choice. Write your answer to the LEFT of each problem. 3 points each

Test 1 - Closed Book Last 4 Digits of Student ID # Multiple Choice. Write your answer to the LEFT of each problem. 3 points each CSE 5311 Test 1 - Closed Book Summer 2009 Name Last 4 Digits of Student ID # Multiple Choice. Write your answer to the LEFT of each problem. 3 points each 1. Which of the following statements is true?

More information

4.1.2 Merge Sort Sorting Lower Bound Counting Sort Sorting in Practice Solving Problems by Sorting...

4.1.2 Merge Sort Sorting Lower Bound Counting Sort Sorting in Practice Solving Problems by Sorting... Contents 1 Introduction... 1 1.1 What is Competitive Programming?... 1 1.1.1 Programming Contests.... 2 1.1.2 Tips for Practicing.... 3 1.2 About This Book... 3 1.3 CSES Problem Set... 5 1.4 Other Resources...

More information

21# 33# 90# 91# 34# # 39# # # 31# 98# 0# 1# 2# 3# 4# 5# 6# 7# 8# 9# 10# #

21# 33# 90# 91# 34# # 39# # # 31# 98# 0# 1# 2# 3# 4# 5# 6# 7# 8# 9# 10# # 1. Prove that n log n n is Ω(n). York University EECS 11Z Winter 1 Problem Set 3 Instructor: James Elder Solutions log n n. Thus n log n n n n n log n n Ω(n).. Show that n is Ω (n log n). We seek a c >,

More information

CSE 373 MAY 10 TH SPANNING TREES AND UNION FIND

CSE 373 MAY 10 TH SPANNING TREES AND UNION FIND CSE 373 MAY 0 TH SPANNING TREES AND UNION FIND COURSE LOGISTICS HW4 due tonight, if you want feedback by the weekend COURSE LOGISTICS HW4 due tonight, if you want feedback by the weekend HW5 out tomorrow

More information

Course Review. Cpt S 223 Fall 2009

Course Review. Cpt S 223 Fall 2009 Course Review Cpt S 223 Fall 2009 1 Final Exam When: Tuesday (12/15) 8-10am Where: in class Closed book, closed notes Comprehensive Material for preparation: Lecture slides & class notes Homeworks & program

More information

Index. stack-based, 400 A* algorithm, 325

Index. stack-based, 400 A* algorithm, 325 Index Abstract transitive closure, 174-175, 217-221 Active vertex, 411 Acyclic graph. See Digraph; Directed acyclic graph (DAG) Acyclic network, 313-321, 334-335 maxflow, 427-429 Adjacency-lists representation,

More information

Minimum Spanning Trees

Minimum Spanning Trees Minimum Spanning Trees Problem A town has a set of houses and a set of roads. A road connects 2 and only 2 houses. A road connecting houses u and v has a repair cost w(u, v). Goal: Repair enough (and no

More information

4/8/11. Single-Source Shortest Path. Shortest Paths. Shortest Paths. Chapter 24

4/8/11. Single-Source Shortest Path. Shortest Paths. Shortest Paths. Chapter 24 /8/11 Single-Source Shortest Path Chapter 1 Shortest Paths Finding the shortest path between two nodes comes up in many applications o Transportation problems o Motion planning o Communication problems

More information

CSE 373 Data Structures & Algorithms

CSE 373 Data Structures & Algorithms CSE 373 Data Structures & Algorithms Lectures 24 Final Review 1 Third Midterm (a.k.a. Final) Friday, 12:30 1:30, here in class Logistics: Closed Book Comprehensive Everything up to and including Network

More information

ROOT A node which doesn t have a parent. In the above tree. The Root is A. LEAF A node which doesn t have children is called leaf or Terminal node.

ROOT A node which doesn t have a parent. In the above tree. The Root is A. LEAF A node which doesn t have children is called leaf or Terminal node. UNIT III : DYNAMIC STORAGE MANAGEMENT Trees: Binary tree, Terminology, Representation, Traversals, Applications. Graph: Terminology, Representation, Traversals Applications - spanning trees, shortest path.

More information

Graph Representation DFS BFS Dijkstra A* Search Bellman-Ford Floyd-Warshall Iterative? Non-iterative? MST Flow Edmond-Karp

Graph Representation DFS BFS Dijkstra A* Search Bellman-Ford Floyd-Warshall Iterative? Non-iterative? MST Flow Edmond-Karp Charles Lin Graph Representation DFS BFS Dijkstra A* Search Bellman-Ford Floyd-Warshall Iterative? Non-iterative? MST Flow Edmond-Karp Adjacency Matrix bool way[100][100]; cin >> i >> j; way[i][j] = true;

More information

Tutorial. Question There are no forward edges. 4. For each back edge u, v, we have 0 d[v] d[u].

Tutorial. Question There are no forward edges. 4. For each back edge u, v, we have 0 d[v] d[u]. Tutorial Question 1 A depth-first forest classifies the edges of a graph into tree, back, forward, and cross edges. A breadth-first tree can also be used to classify the edges reachable from the source

More information

DESIGN AND ANALYSIS OF ALGORITHMS

DESIGN AND ANALYSIS OF ALGORITHMS DESIGN AND ANALYSIS OF ALGORITHMS QUESTION BANK Module 1 OBJECTIVE: Algorithms play the central role in both the science and the practice of computing. There are compelling reasons to study algorithms.

More information

Minimum-Spanning-Tree problem. Minimum Spanning Trees (Forests) Minimum-Spanning-Tree problem

Minimum-Spanning-Tree problem. Minimum Spanning Trees (Forests) Minimum-Spanning-Tree problem Minimum Spanning Trees (Forests) Given an undirected graph G=(V,E) with each edge e having a weight w(e) : Find a subgraph T of G of minimum total weight s.t. every pair of vertices connected in G are

More information

Analysis of Algorithms

Analysis of Algorithms Analysis of Algorithms Concept Exam Code: 16 All questions are weighted equally. Assume worst case behavior and sufficiently large input sizes unless otherwise specified. Strong induction Consider this

More information

2. True or false: even though BFS and DFS have the same space complexity, they do not always have the same worst case asymptotic time complexity.

2. True or false: even though BFS and DFS have the same space complexity, they do not always have the same worst case asymptotic time complexity. 1. T F: Consider a directed graph G = (V, E) and a vertex s V. Suppose that for all v V, there exists a directed path in G from s to v. Suppose that a DFS is run on G, starting from s. Then, true or false:

More information

Decreasing a key FIB-HEAP-DECREASE-KEY(,, ) 3.. NIL. 2. error new key is greater than current key 6. CASCADING-CUT(, )

Decreasing a key FIB-HEAP-DECREASE-KEY(,, ) 3.. NIL. 2. error new key is greater than current key 6. CASCADING-CUT(, ) Decreasing a key FIB-HEAP-DECREASE-KEY(,, ) 1. if >. 2. error new key is greater than current key 3.. 4.. 5. if NIL and.

More information

Suggested Study Strategy

Suggested Study Strategy Final Exam Thursday, 7 August 2014,19:00 22:00 Closed Book Will cover whole course, with emphasis on material after midterm (hash tables, binary search trees, sorting, graphs) Suggested Study Strategy

More information

Analysis of Algorithms

Analysis of Algorithms Second Edition Design and Analysis of Algorithms Prabhakar Gupta Vineet Agarwal Manish Varshney Design and Analysis of ALGORITHMS SECOND EDITION PRABHAKAR GUPTA Professor, Computer Science and Engineering

More information

Reference Sheet for CO142.2 Discrete Mathematics II

Reference Sheet for CO142.2 Discrete Mathematics II Reference Sheet for CO14. Discrete Mathematics II Spring 017 1 Graphs Defintions 1. Graph: set of N nodes and A arcs such that each a A is associated with an unordered pair of nodes.. Simple graph: no

More information

Question Bank Subject: Advanced Data Structures Class: SE Computer

Question Bank Subject: Advanced Data Structures Class: SE Computer Question Bank Subject: Advanced Data Structures Class: SE Computer Question1: Write a non recursive pseudo code for post order traversal of binary tree Answer: Pseudo Code: 1. Push root into Stack_One.

More information