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

Size: px
Start display at page:

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

Transcription

1 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? What do you mean by instance of a problem? List out the criteria that all algorithms must satisfy. On what bases will you consider algorithm A is better than algorithm B? [May-201][LJIET] 2 What do you mean by Polynomial time complexity and Logarithmic time complexity? Which one is higher? What does O (1) mean? [May-201][LJIET] Marks 3 Arrange following functions n in increasing order: [May-201][LJIET] Define an algorithm. What features does one look for in a good computer algorithm? When an algorithm is said to be correct? When an algorithm is said to efficient? Can an abstract algorithm be directly implemented? If yes, how? If not, what is its use? [May-2012][LJIET] 5 Give an example where the choice of data structure has a bearing effect on the performance of the algorithm. Also give the circumstances where: (i) It is advantageous to use array instead of linked list (ii) It is advantageous to use linked list instead of array. [May-2012][LJIET] Define:Algorithm[DEC- 1 UNIT-2 Analysis of Algorithm: 1 Define Time Complexity and Space Complexity. Why we are generally concerned withtime Complexities than Space Complexities? What is a major contributor for inefficiency of a loop? What will be theta notation for: n3+5n+? [May-201][LJIET] 2 Explain why the statement, The running time of algorithm A is at least O (n2) is meaningless. Also explain what is the smallest value of n such that an algorithm whose running time is 100n2 runs faster than an algorithm whose running time is 2n on the same Design & Analysis of Algorithm (1810) 201 Page 1

2 machine? [May-201][LJIET] 3 What is Time Complexity? What is significance of Time Complexity in Algorithm Analysis? Provide methods and ways to measure the time complexity? What is significance of Time Complexity in algorithm analysis? Explain Limit rules for O, Ω, θ notations. Express the function n3/ n2-100n+3 in terms of Ө notation and prove that. [May- 201][LJIET] Write down the algorithm to find minimum of N numbers and find its complexity. Also derive the worst case complexity of searching a Key from a binary search tree (balanced) having n nodes. [May-201][LJIET] 5 Write an algorithm to find the maximum and minimum element in an array A storing n integers. What is the running time of this algorithm for computing the maximum Element in an array of integers? [May-201][LJIET] What do you mean by eventually non decreasing function? Give an example for the same[may-201][ljiet] What is optimal binary search tree problem? Explain in brief. [May-201][LJIET] 8 What is Space Complexity? How algorithms can be analyzed in terms of space complexity? Will it depend on type of Instance (input) or will change? [May-201][LJIET] 9 Solve the following recurrence equations. 1. T (n) = T (n/3)+ n T (n) = T (n/2)+ log n[may-201][ljiet] Is 3logn+loglogn is O (log10 n)? Is 3logn+loglogn is Ω (log10n)? [May-201][LJIET] 11 Check equalities(true/false): [May-201][LJIET] Design & Analysis of Algorithm (1810) 201 Page 2

3 12 Write the recurrence for solving Tower of Hanoi problem having n rings and 3 rods and solve the recurrence[may-201][ljiet] 13 Define: (1) Algorithm (2) Average case (3) Time complexity () Space complexity (5) Set () Function () Relation[Sep-2013][LJIET] 1 Write algorithms to find (1) Sum of integers from 1 to n. (2) Fibonacci sequence using recursion Calculate the time complexity for both on each case. [Sep-2013][LJIET] 15 Define: (1) O(n) (2) Ω(n) (3) Θ(n) () Barometer instruction.[sep-2013][ljiet] 1 Write an algorithm for selection sort. Calculate the time complexity for each case. [Sep-2013][LJIET] 1 How to compare the two algorithms? What do you mean by worst-case, average-case and best-case analysis of an algorithm? Is a Recursive algorithm less efficient compared to an Iterative one? Why or Why not? [May-2012][LJIET] 18 Define Time Complexity and Space Complexity. Why we are generally Concerned with Time Complexities than Space Complexities (Requirements)? What do you mean by Polynomial time complexity and Logarithmic time complexity? Which one is higher? What is a major contributor for inefficiency of a loop? [May-2012][LJIET] 19 Solve the following recurrence equations. [May-2012][LJIET] 1. T(n) = T(n-1) +2T(n-2) 2T(n-3) Design & Analysis of Algorithm (1810) 201 Page 3

4 2. T (n) = 2T(N/2) + n log n 20 Develop an algorithm and program (recursive function) to calculate the GCD of two integers using Top-Down Design. Analyze the algorithm. [May-2012][LJIET] 21 Write an efficient algorithm to find exponentiation X= an, where a and n are integers. Give the detailed analysis and worst case behavior for the same. [May-2012][LJIET] 22 Write a recursive algorithm to find Fibonacci numbers. Write recurrence equation for it. Solve the recurrence equation and find out the complexity. [May-2012][LJIET] 23 Give the algorithm to find the best way to multiply n matrices. Analyze the algorithm and give the timing analysis. [May-2012][LJIET] 2 What do you mean by performance analysis of an algorithm? Explain average case and worst case analysis with the help of suitable example. [May-2013][LJIET] 25 What is an Algorithm? What do you mean by linear inequalities and linear equation? Explain asymptotic notation with the help of example[may-2013][ljiet] 5 2 What are the elementary operations? Explain Amortized Analysis. [May-2013][LJIET] 2 Explain all asymptotic notations used in algorithm analysis. [Sep-201][LJIET] 28 Using step count method analyze the time complexity when two m*n matrices are added. [Sep-201][LJIET] 29 Sort the letter of the word EXAMPLE in alphabetical order using insertion sort. [Sep- 201][LJIET] 30 What is an amortized analysis? Explain potential method of amortized analysis using suitable example. [Sep-201][LJIET] 31 Explain the accounting method of amortized analysis using stack operations. [May- 32 Explain potential method of amortized analysis. [May- 33 Use master method to give tight asymptotic bounds for the following recurrence. [May- T(n) = 2n T(n/2) + nn T (n) = 3T (n/2)+ n2 T (n) = 1T (n/)+ n 3 1. Let f(n) = n + 3 and g(n) = n Is f(n) = Ω(g(n))? Design & Analysis of Algorithm (1810) 201 Page

5 2. Let f(n) = n2 and g(n) = n2 + 2 Is f(n) = Ω (g(n))? If yes, find n0 and c[may- 35 Explain Insertion sort algorithm. Derive the algorithmic complexity in Best case, worst case and Average case analysis. [DEC- 3 Explain master theorem and solve the following recurrence equation with master method [DEC- 1. T(n)= 8T(n/2) + n 2. T(n)= T(n/) + n2 logn 3 Give the properties of Heap Tree. Sort the following data with Heap Sort Method: 5, 5, 5, 55, 25, 30, 90, 5, 80. [DEC- UNIT-3 Divide and Conquer Algorithm: 1 Suppose we are comparing implementations of insertion sort and merge sort on the same machine. For input of size n, insertion sort runs in 8n2 steps, while merge sort runs in n lg n steps. For which values of n does insertion sort beat merge sort? [May-201][LJIET] 3 Write an algorithm for binary search. Calculate the time complexity for each case. [Sep-2013][LJIET] 5 3 Explain the multiplying large integer problem in detail. [Sep-2013][LJIET] Write an algorithm for merge sort with divide and conquer strategy. Analyze each case. [Sep-2013][LJIET] 5 Write an algorithm for quick sort with divide and conquer strategy. Analyze each case. [Sep-2013][LJIET] Derive the recurrence relation for quick sort in best case and find the complexity. [May-2012][LJIET] Justify the general statement that if a problem can be split using Divide and Conquer strategy in almost equal portions at each stage, then it is a good candidate for recursive implementation, but if it cannot be easily be so divided in equal portions, then it better be implemented iteratively. Explain with an example. [May-2012][LJIET] 8 Explain how to apply the divide and conquer strategy for sorting the elements using Merge sort. [May-2013][LJIET] Design & Analysis of Algorithm (1810) 201 Page 5

6 9 What is divide and conquer technique? Apply this method to find multiplication of integers 2101 and [Sep-201][LJIET] 10 Explain merge sort problem using divide and conquer technique. Give an example. [Sep-201][LJIET] 11 Write the Quick sort algorithm. Trace the same on data set: 5, 3,1,9,8,2,,. [Sep- 201][LJIET] 12 Write the case in which worst case behavior for quicksort occurs. Find out the worst case running time of quicksort. Write and explain randomized partition for QUICKSORT[May- 13 How MERGE-SORT can be done with Divide and Conquer strategy? Explain with example. [May- 1 What is divide and conquer technique? Apply this method to find multiplication of integers 395 and 122. [DEC- 15 Sort the following list using quick sort algorithm:<80,55,3,25,5,98,59,,15,31,8,9> Also discuss worst and best case of quick sort algorithm. [DEC- 1 Explain Binary search algorithm with divide and conquer strategy and use the recurrence tree to show that the solution to the binary search recurrence relation is Ѳ(logn). [DEC- 1 Define: minimax principle[dec- 1 UNIT- Greedy Algorithm: 1 There is a network given in the figure below as a highway map and the number recorded next to each arc as the maximum elevation encountered in traversing the arc. A traveler plans to drive from node 1 to 12 on this highway. The traveler dislikes high altitudes and so would like to find a path connecting node 1 to 12 that minimizes the maximum altitude. Find the best path for the traveler using a MST.(Graph do be drawn for Kruskal or Prims algorithm for minimum spanning tree) [May-201][LJIET] Design & Analysis of Algorithm (1810) 201 Page

7 2 Write down the general characteristics of greedy algorithm with respect to making change problem. [Sep-2013][LJIET] 3 Explain Kruskal s algorithm to find minimum spanning tree with an example. What is it s time complexity? [Sep-2013][LJIET] Explain Prim s algorithm to find minimum spanning tree with an example. What is it s time complexity? [Sep-2013][LJIET] 5 What is Knapsack problem (1)? Explain it. [Sep-2013][LJIET] Prove that Greedy Algorithms does not always give optimal solution. What are the general characteristics of Greedy Algorithms? Also compare Greedy Algorithms with Dynamic Programming and Divide and Conquer methods to find out major difference between them. [May-2012][LJIET] Give and explain Kruskal s Algorithm for Minimum Spanning Tree and Compare it with Prim s algorithm with an example. [May-2012][LJIET] 8 What do you mean by minimum spanning tree? Explain single source shortest path With the help of example. [May-2013][LJIET] 9 Solve the following Knapsack Problem using Greedy Algorithm The capacity of knapsack is 15 Design & Analysis of Algorithm (1810) 201 Page

8 Items Weight Value [May-2013][LJIET] 10 Give and explain Prim s Algorithm for Minimum Spanning Tree and Compare it with Kruskal s algorithm with an example. [May-2013][LJIET] 11 Devise an algorithm to make a change for 155 using the greedy strategy. The coins available are {1000, 500, 100, 50, 20, 10, 5}.[Sep-201][LJIET] 12 Using greedy algorithm find an optimal schedule for following jobs with n=5 profits: (P1,P2,P3,P,P5) = (3,5,18,20,38) and deadline :(d1,d2,d3,d,d5) = (1,3,3,,1) [Sep-201][LJIET] 13 Write Dijkstra s algorithm and apply the same to find single source shortest path problem for the following graph taking vertex a as a source. [Sep-201][LJIET] 1 Define terms: Greedy Algorithm[May Define terms: Minimum Spanning Tree (MST) [May Write Prim s algorithm and apply it on following graph. And find running time of the algorithm. [May- Design & Analysis of Algorithm (1810) 201 Page 8

9 1 Describe Dijkstra s algorithm for single source shortest path problem. Give a simple example of a directed graph with negative-weight edges for which Dijkstra s algorithm produces incorrect answers. [May- 18 Solve the following Knapsack Problem using Greedy Algorithm The capacity of knapsack is W=18 19 Using greedy algorithm find an optimal schedule for following jobs with n= profits: (P1,P2,P3,P,P5,P) = (,,20,25,8,18) and deadline :(d1,d2,d3,d,d5,d) = (1,3,3,,1,2) [DEC- 20 Write Dijkstra s algorithm and apply the same to find single source shortest path problem for the following graph taking vertex a as a source. [DEC- Design & Analysis of Algorithm (1810) 201 Page 9

10 21 Define: Principle of Optimality[DEC- 1 UNIT-5 Dynamic Programming: 1 Differentiate between Greedy, Dynamic Programming and Divide and Conquer method. [May-201][LJIET] 2 Given two sequences of characters: P=<MLNOM> & Q=<MNOM>. Obtain the longest common subsequence. [May-201][LJIET] 3 Given a knapsack having maximum weight capacity W=, and number of items available are three, such that S=3 wi=<1, 3, > vi=<3,, 5> 5 Fill the knapsack using dynamic programming such that knapsack should not exceed its maximum capacity and it should have maximum profit value. Is dynamic programming a Top-Down or a Bottom-Up technique? Why? [May-201][LJIET] Define principle of optimality. Explain Knapsack problem (2) in detail. [Sep-2013][LJIET] 5 Differentiate divide-and-conquer and dynamic programming. Write the recurrence for calculating binomial coefficient. [Sep-2013][LJIET] Explain chained matrix multiplication with example. [Sep-2013][LJIET] State Principle of optimality. Principle of optimality does not hold for all problems whose solutions can be viewed as a sequence of decisions. Find out such problem and show that it fails. [May-2012][LJIET] 8 Given a finite set of distinct coin types, say 50,20,10,5,2,1, and an integer constant C. Each type is available in unlimited quantity. Write an algorithm to find the exact change with minimum number of coins? Which strategy will you use? [May-2012][LJIET] 9 Write an algorithm to find binomial coefficients using recursion. Analyze it. [May- 2012][LJIET] 10 Give the algorithm with example to solve 0/1 Knapsack Problem using Dynamic Programming. [May-2012][LJIET] 5 Design & Analysis of Algorithm (1810) 201 Page 10

11 11 Differentiate the following: [May-2013][LJIET] 1. Divide and conquer & Dynamic Programming 2. Greedy Algorithm & Dynamic Programming 12 Compute Longest common subsequence for the strings, [May-2013][LJIET] A=<X,Y,Z,Y,T,X,Y>, B=<Y,T,Z,X,Y,X> 13 Solve the following Knapsack Problem using Dynamic Programming Method Write the equation for solving the problem. The capacity of knapsack is 5 Items Weight Value 3 5 [May-2013][LJIET] 1 Compute Matrix chain order for the following matrices, [May-2013][LJIET] A1 (5 X ), A2 ( X ), A3 ( X 2), A (2 X ) 15 Using algorithm determine a Longest Common Sequence of S1= abbacdcba S2= bcdbbcaac (use dynamic programming). [Sep-201][LJIET] 1 Solve the following knapsack problem with the given capacity W=5 using dynamic programming[sep-201][ljiet] 1 What kind of problems is solved by Bellman Ford algorithm? Run the bellman Ford algorithm on following graph. Find the running time[may- Design & Analysis of Algorithm (1810) 201 Page 11

12 18 UsGiven weight. Choose items with maximum total benefits but with at most W=10ml. [May- 19 Determine a Longest Common subsequence (LCS) of {1,0,0,1,0,1,01} and {0,1,0,1,1,0,1,1,0} with proper diagram[may- 20 Explain assembly line scheduling and how it can be done by dynamic programming? Write the procedure for computing the fastest times to get the assembly out of factory. [May- 21 Using dynamic programming find an optimal parenthesization of a matrix chain product whose sequence of dimension is 13,5,89,3,3 [DEC- 22 Using dynamic programming algorithm determine an Longest Common Sequence of S1= wxxwyzyx and S2= xyzxxywwz [DEC- 23 Describe an assembly line scheduling problem and give dynamic programming algorithm to solve it. [DEC- 2 Define: Optimal Substructure property[dec- 1 UNIT- Exploring Graphs 1 Explain depth-first-search and breadth-first-search with example. [Sep-2013][LJIET] 2 Prove/Give counter example: A graph with n nodes and more than n-1 edges must contain cycle. [May-2012][LJIET] 3 What is the main advantage of back-tracking? How does it achieve this? [May- 2012][LJIET] Depth First Search (DFS) algorithm can be used to find the connected components of an undirected graph. Justify the statement with reason. [May-2012][LJIET] 5 Define Graph. Explain types of graph and different ways of graph representations. [May-2013][LJIET] Give and explain Prim s Algorithm for Minimum Spanning Tree and Compare it with Kruskal s algorithm with an example. [May-2013][LJIET] 2 Design & Analysis of Algorithm (1810) 201 Page 12

13 What is an articulation point? Give applications of BFS and DFS. Generate at least 3 solutions for 5 queen s problem. [May-2013][LJIET] 8 Give the important properties of relation and also solve 8 queen s problem for a feasible sequence (,,, 1). [May-2013][LJIET] 9 Give the algorithm for Depth First Search of a Graph. Also define ArticulationPoint of the graph and explain how to find it. [Sep-201][LJIET] 10 What is the central principle of back tracking? Taking n-queens problem as an example, explain the solution process[sep-201][ljiet] 11 Explain with example how backtracking algorithm is useful in solving Hamilton cycle problem. [Sep-201][LJIET] 12 With an example, explain how the branch and bound technique is used to solve 0/1 knapsack problem. [Sep-201][LJIET] 13 Find the running time of breadth first search algorithm. [May- 1 Explain recursive algorithm of depth first search (DFS) for directed graph. [May- 15 Discuss how 8-queen problem can be solved using backtracking. [DEC- 1 Explain Backtracking with Knapsack problem. [DEC- 1 Explain use of Branch & Bound Technique for solving Assignment Problem[DEC- 18 Define: Articulation Point[DEC Define: Directed Acyclic Graph[DEC- 1 UNIT- String Matching 1 Define String-matching problem. Compare all string matching algorithms. [May- 201][LJIET] 2 What are the basic ideas behind string matching? Which are the two popular algorithms for string matching? Explain and analyze any one in brief. [May-2012][LJIET] Design & Analysis of Algorithm (1810) 201 Page 13

14 3 What is the need of matching the string? Explain Finite automata for string Matching. [May-2013][LJIET] Explain Rabin Karp method of string matching. [May-2013][LJIET] 5 Working modulo q=13, how many spurious hits does the Rabin Karp matcher encounter in text T= when looking for pattern P=3115[May- Explain finite automata for string matching. [DEC- UNIT-8 Introduction to NP-Completeness 1 Differentiate decision problem and optimization problem. Is P= NP? List out the problems which can solve in polynomial time. List out the problems which cannot solve in polynomial time. [May-201][LJIET] 2 Define : (1) P (2) NP (3) NP-complete () NP-hard[Sep-2013][LJIET] 3 Define the class P and class NP. Is there any NP-Hard problem, which is also NP? If yes, give an example, if no, why? [May-2012][LJIET] What is backtracking? Explain P, NP and NP complete problems. [May-2013][LJIET] 5 What is polynomially turing reducible problem? Explain with example how problem A can be polynomially Turing reduced to problem B. [Sep-201][LJIET] Define terms: Polynomial time algorithm[may- 2.5 Define terms: NP-Complete[May Prove that travelling salesman problem is NP-complete. [May- 9 Define: P and NP Problems[DEC- 1 Design & Analysis of Algorithm (1810) 201 Page 1

Sankalchand Patel College of Engineering - Visnagar Department of Computer Engineering and Information Technology. Assignment

Sankalchand Patel College of Engineering - Visnagar Department of Computer Engineering and Information Technology. Assignment Class: V - CE Sankalchand Patel College of Engineering - Visnagar Department of Computer Engineering and Information Technology Sub: Design and Analysis of Algorithms Analysis of Algorithm: Assignment

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

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

INSTITUTE OF AERONAUTICAL ENGINEERING

INSTITUTE OF AERONAUTICAL ENGINEERING INSTITUTE OF AERONAUTICAL ENGINEERING (Autonomous) Dundigal, Hyderabad -500 043 INFORMATION TECHNOLOGY TUTORIAL QUESTION BANK Course Name : DESIGN AND ANALYSIS OF ALGORITHMS Course Code : AIT001 Class

More information

CLASS: II YEAR / IV SEMESTER CSE CS 6402-DESIGN AND ANALYSIS OF ALGORITHM UNIT I INTRODUCTION

CLASS: II YEAR / IV SEMESTER CSE CS 6402-DESIGN AND ANALYSIS OF ALGORITHM UNIT I INTRODUCTION CLASS: II YEAR / IV SEMESTER CSE CS 6402-DESIGN AND ANALYSIS OF ALGORITHM UNIT I INTRODUCTION 1. What is performance measurement? 2. What is an algorithm? 3. How the algorithm is good? 4. What are the

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

5105 BHARATHIDASAN ENGINEERING COLLEGE

5105 BHARATHIDASAN ENGINEERING COLLEGE CS 6402 DESIGN AND ANALYSIS OF ALGORITHMS II CSE/IT /IV SEMESTER UNIT I PART A 1. Design an algorithm to compute the area and circumference of a circle?(dec 2016) 2. Define recurrence relation? (Dec 2016)

More information

D.K.M.COLLEGE FOR WOMEN (AUTONOMOUS), VELLORE-1.

D.K.M.COLLEGE FOR WOMEN (AUTONOMOUS), VELLORE-1. D.K.M.COLLEGE FOR WOMEN (AUTONOMOUS), VELLORE-1. DESIGN AND ANALYSIS OF ALGORITHM UNIT- I SECTION-A 2 MARKS 1. Define an algorithm? 2. Specify the criteria of algorithm? 3. What is Computational Procedure?

More information

R13 SET - 1. ''' '' ''' ' blog: anilkumarprathipati.wordpress.com. Code No: RT32054

R13 SET - 1. ''' '' ''' ' blog: anilkumarprathipati.wordpress.com. Code No: RT32054 R13 SET - 1 III B. Tech II Semester Regular Examinations, April - 2016 1 a) Distinguish between Algorithm and Psuedocode. [3M] b) Describe the Algorithm Analysis of Binary Search. [4M] c) State the Job

More information

Contents. 1 Introduction. 2 Searching and Traversal Techniques. Preface... (vii) Acknowledgements... (ix)

Contents. 1 Introduction. 2 Searching and Traversal Techniques. Preface... (vii) Acknowledgements... (ix) Contents Preface... (vii) Acknowledgements... (ix) 1 Introduction 1.1 Algorithm 1 1.2 Life Cycle of Design and Analysis of Algorithm 2 1.3 Pseudo-Code for Expressing Algorithms 5 1.4 Recursive Algorithms

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

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

15CS43: DESIGN AND ANALYSIS OF ALGORITHMS

15CS43: DESIGN AND ANALYSIS OF ALGORITHMS 15CS43: DESIGN AND ANALYSIS OF ALGORITHMS QUESTION BANK MODULE1 1. What is an algorithm? Write step by step procedure to write an algorithm. 2. What are the properties of an algorithm? Explain with an

More information

2. (a) Explain when the Quick sort is preferred to merge sort and vice-versa.

2. (a) Explain when the Quick sort is preferred to merge sort and vice-versa. Code No: RR210504 Set No. 1 1. (a) Order the following functions according to their order of growth (from the lowest to the highest). (n-2)!, 5 log (n+100) 10,2 2n, 0.001n 4 +3n 3 +1, ln 2 n, n 1/3, 3

More information

CSCE 321/3201 Analysis and Design of Algorithms. Prof. Amr Goneid. Fall 2016

CSCE 321/3201 Analysis and Design of Algorithms. Prof. Amr Goneid. Fall 2016 CSCE 321/3201 Analysis and Design of Algorithms Prof. Amr Goneid Fall 2016 CSCE 321/3201 Analysis and Design of Algorithms Prof. Amr Goneid Course Resources Instructor: Prof. Amr Goneid E-mail: goneid@aucegypt.edu

More information

CS6402 DESIGN AND ANALYSIS OF ALGORITHMS QUESTION BANK UNIT I

CS6402 DESIGN AND ANALYSIS OF ALGORITHMS QUESTION BANK UNIT I CS6402 DESIGN AND ANALYSIS OF ALGORITHMS QUESTION BANK UNIT I PART A(2MARKS) 1. What is an algorithm? 2. What is meant by open hashing? 3. Define Ω-notation 4.Define order of an algorithm. 5. Define O-notation

More information

DESIGN AND ANALYSIS OF ALGORITHMS

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

More information

Virtual University of Pakistan

Virtual University of Pakistan Virtual University of Pakistan Department of Computer Science Course Outline Course Instructor Dr. Sohail Aslam E mail Course Code Course Title Credit Hours 3 Prerequisites Objectives Learning Outcomes

More information

IV/IV B.Tech (Regular) DEGREE EXAMINATION. Design and Analysis of Algorithms (CS/IT 414) Scheme of Evaluation

IV/IV B.Tech (Regular) DEGREE EXAMINATION. Design and Analysis of Algorithms (CS/IT 414) Scheme of Evaluation IV/IV B.Tech (Regular) DEGREE EXAMINATION Design and Analysis of Algorithms (CS/IT 414) Scheme of Evaluation Maximum: 60 Marks 1. Write briefly about the following 1*12= 12 Marks a) Give the characteristics

More information

R13. II B. Tech I Semester Supplementary Examinations, May/June DATA STRUCTURES (Com. to ECE, CSE, EIE, IT, ECC)

R13. II B. Tech I Semester Supplementary Examinations, May/June DATA STRUCTURES (Com. to ECE, CSE, EIE, IT, ECC) SET - 1 II B. Tech I Semester Supplementary Examinations, May/June - 2016 PART A 1. a) Write a procedure for the Tower of Hanoi problem? b) What you mean by enqueue and dequeue operations in a queue? c)

More information

UNIT 1 BASICS OF AN ALGORITHM

UNIT 1 BASICS OF AN ALGORITHM UNIT 1 BASICS OF AN ALGORITHM Basics of an Algorithm Structure Page Nos. 1.0 Introduction 5 1.1 Objectives 6 1.2. Analysis and Complexity of Algorithms 6 1.3 Basic Technique for Design of Efficient Algorithms

More information

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

Your favorite blog : (popularly known as VIJAY JOTANI S BLOG..now in facebook.join ON FB VIJAY

Your favorite blog :  (popularly known as VIJAY JOTANI S BLOG..now in facebook.join ON FB VIJAY Course Code : BCS-042 Course Title : Introduction to Algorithm Design Assignment Number : BCA(IV)-042/Assign/14-15 Maximum Marks : 80 Weightage : 25% Last Date of Submission : 15th October, 2014 (For July

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

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

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

1. For the sieve technique we solve the problem, recursively mathematically precisely accurately 2. We do sorting to, keep elements in random positions keep the algorithm run in linear order keep the algorithm

More information

INTERNATIONAL INSTITUTE OF MANAGEMENT, ENGINEERING & TECHNOLOGY, JAIPUR (IIMET)

INTERNATIONAL INSTITUTE OF MANAGEMENT, ENGINEERING & TECHNOLOGY, JAIPUR (IIMET) INTERNATIONAL INSTITUTE OF MANAGEMENT, ENGINEERING & TECHNOLOGY, JAIPUR (IIMET) UNIT-1 Q.1 What is the significance of using notations in analysis of algorithm? Explain the various notations in brief?

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

PSD1A. DESIGN AND ANALYSIS OF ALGORITHMS Unit : I-V

PSD1A. DESIGN AND ANALYSIS OF ALGORITHMS Unit : I-V PSD1A DESIGN AND ANALYSIS OF ALGORITHMS Unit : I-V UNIT I -- Introduction -- Definition of Algorithm -- Pseudocode conventions -- Recursive algorithms -- Time and space complexity -- Big- o notation --

More information

CS6402-DESIGN AND ANALYSIS OF ALGORITHM. TWO MARK QUESTION WITH ANSWERS Unit-I. Introduction

CS6402-DESIGN AND ANALYSIS OF ALGORITHM. TWO MARK QUESTION WITH ANSWERS Unit-I. Introduction CS6402-DESIGN AND ANALYSIS OF ALGORITHM TWO MARK QUESTION WITH ANSWERS Unit-I Introduction Why is the need of studying algorithms? From a practical standpoint, a standard set of algorithms from different

More information

Ph.D. Comprehensive Examination Design and Analysis of Algorithms

Ph.D. Comprehensive Examination Design and Analysis of Algorithms Ph.D. Comprehensive Examination Design and Analysis of Algorithms Main Books 1. Cormen, Leiserton, Rivest, Introduction to Algorithms, MIT Press, 2001. Additional Books 1. Kenneth H. Rosen, Discrete mathematics

More information

Algorithm Analysis. (Algorithm Analysis ) Data Structures and Programming Spring / 48

Algorithm Analysis. (Algorithm Analysis ) Data Structures and Programming Spring / 48 Algorithm Analysis (Algorithm Analysis ) Data Structures and Programming Spring 2018 1 / 48 What is an Algorithm? An algorithm is a clearly specified set of instructions to be followed to solve a problem

More information

CS 6402 DESIGN AND ANALYSIS OF ALGORITHMS QUESTION BANK

CS 6402 DESIGN AND ANALYSIS OF ALGORITHMS QUESTION BANK CS 6402 DESIGN AND ANALYSIS OF ALGORITHMS QUESTION BANK Page 1 UNIT I INTRODUCTION 2 marks 1. Why is the need of studying algorithms? From a practical standpoint, a standard set of algorithms from different

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

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

Introduction to Data Structure

Introduction to Data Structure Introduction to Data Structure CONTENTS 1.1 Basic Terminology 1. Elementary data structure organization 2. Classification of data structure 1.2 Operations on data structures 1.3 Different Approaches to

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

DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING Question Bank Subject Name: CS6402- Design & Analysis of Algorithm Year/Sem : II/IV UNIT-I INTRODUCTION

DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING Question Bank Subject Name: CS6402- Design & Analysis of Algorithm Year/Sem : II/IV UNIT-I INTRODUCTION Chendu College of Engineering & Technology (Approved by AICTE, New Delhi and Affiliated to Anna University) Zamin Endathur, Madurantakam, Kancheepuram District 603311 +91-44-27540091/92 www.ccet.org.in

More information

R10 SET - 1. Code No: R II B. Tech I Semester, Supplementary Examinations, May

R10 SET - 1. Code No: R II B. Tech I Semester, Supplementary Examinations, May www.jwjobs.net R10 SET - 1 II B. Tech I Semester, Supplementary Examinations, May - 2012 (Com. to CSE, IT, ECC ) Time: 3 hours Max Marks: 75 *******-****** 1. a) Which of the given options provides the

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

COMP 251 Winter 2017 Online quizzes with answers

COMP 251 Winter 2017 Online quizzes with answers 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

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

( ) + 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

TOTAL CREDIT UNITS L T P/ S SW/F W. Course Title: Analysis & Design of Algorithm. Course Level: UG Course Code: CSE303 Credit Units: 5

TOTAL CREDIT UNITS L T P/ S SW/F W. Course Title: Analysis & Design of Algorithm. Course Level: UG Course Code: CSE303 Credit Units: 5 Course Title: Analysis & Design of Algorithm Course Level: UG Course Code: CSE303 Credit Units: 5 L T P/ S SW/F W TOTAL CREDIT UNITS 3 1 2-5 Course Objectives: The designing of algorithm is an important

More information

Multiple Choice Question. Unit-1 Introduction

Multiple Choice Question. Unit-1 Introduction Multiple Choice Question Unit-1 Introduction 1. In analysis of algorithm, approximate relationship between the size of the job and the amount of work required to do is expressed by using (a) Central tendency

More information

Model Answer. Section A Q.1 - (20 1=10) B.Tech. (Fifth Semester) Examination Analysis and Design of Algorithm (IT3105N) (Information Technology)

Model Answer. Section A Q.1 - (20 1=10) B.Tech. (Fifth Semester) Examination Analysis and Design of Algorithm (IT3105N) (Information Technology) B.Tech. (Fifth Semester) Examination 2013 Analysis and Design of Algorithm (IT3105N) (Information Technology) Model Answer. Section A Q.1 - (20 1=10) 1. Merge Sort uses approach to algorithm design. Ans:

More information

Introduction to Algorithms May 14, 2003 Massachusetts Institute of Technology Professors Erik Demaine and Shafi Goldwasser.

Introduction to Algorithms May 14, 2003 Massachusetts Institute of Technology Professors Erik Demaine and Shafi Goldwasser. Introduction to Algorithms May 14, 2003 Massachusetts Institute of Technology 6.046J/18.410J Professors Erik Demaine and Shafi Goldwasser Practice Final Practice Final Do not open this exam booklet until

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

Chapter 9 Graph Algorithms

Chapter 9 Graph Algorithms Chapter 9 Graph Algorithms 2 Introduction graph theory useful in practice represent many real-life problems can be if not careful with data structures 3 Definitions an undirected graph G = (V, E) is a

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

( ) 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

CS-6402 DESIGN AND ANALYSIS OF ALGORITHMS

CS-6402 DESIGN AND ANALYSIS OF ALGORITHMS CS-6402 DESIGN AND ANALYSIS OF ALGORITHMS 2 marks UNIT-I 1. Define Algorithm. An algorithm is a sequence of unambiguous instructions for solving a problem in a finite amount of time. 2.Write a short note

More information

CAD Algorithms. Categorizing Algorithms

CAD Algorithms. Categorizing Algorithms CAD Algorithms Categorizing Algorithms Mohammad Tehranipoor ECE Department 2 September 2008 1 Categorizing Algorithms Greedy Algorithms Prim s Algorithm (Minimum Spanning Tree) A subgraph that is a tree

More information

CS161 - Final Exam Computer Science Department, Stanford University August 16, 2008

CS161 - Final Exam Computer Science Department, Stanford University August 16, 2008 CS161 - Final Exam Computer Science Department, Stanford University August 16, 2008 Name: Honor Code 1. The Honor Code is an undertaking of the students, individually and collectively: a) that they will

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

Chapter 9 Graph Algorithms

Chapter 9 Graph Algorithms Chapter 9 Graph Algorithms 2 Introduction graph theory useful in practice represent many real-life problems can be slow if not careful with data structures 3 Definitions an undirected graph G = (V, E)

More information

4. Give the diagram representation of Notion of algorithm. [M 13]

4. Give the diagram representation of Notion of algorithm. [M 13] DHANALAKSHMI COLLEGE OF ENGINEERING, CHENNAI DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING CS 6402 DESIGN AND ANALYSIS OF ALGORITHMS UNIT 1: INTRODUCTION PART A (2 marks) 1. What is the need of studying

More information

11/22/2016. Chapter 9 Graph Algorithms. Introduction. Definitions. Definitions. Definitions. Definitions

11/22/2016. Chapter 9 Graph Algorithms. Introduction. Definitions. Definitions. Definitions. Definitions Introduction Chapter 9 Graph Algorithms graph theory useful in practice represent many real-life problems can be slow if not careful with data structures 2 Definitions an undirected graph G = (V, E) is

More information

DATA STRUCTURES AND ALGORITHMS

DATA STRUCTURES AND ALGORITHMS DATA STRUCTURES AND ALGORITHMS For COMPUTER SCIENCE DATA STRUCTURES &. ALGORITHMS SYLLABUS Programming and Data Structures: Programming in C. Recursion. Arrays, stacks, queues, linked lists, trees, binary

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

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

Anany Levitin 3RD EDITION. Arup Kumar Bhattacharjee. mmmmm Analysis of Algorithms. Soumen Mukherjee. Introduction to TllG DCSISFI &

Anany Levitin 3RD EDITION. Arup Kumar Bhattacharjee. mmmmm Analysis of Algorithms. Soumen Mukherjee. Introduction to TllG DCSISFI & Introduction to TllG DCSISFI & mmmmm Analysis of Algorithms 3RD EDITION Anany Levitin Villa nova University International Edition contributions by Soumen Mukherjee RCC Institute of Information Technology

More information

DESIGN AND ANALYSIS OF ALGORITHMS

DESIGN AND ANALYSIS OF ALGORITHMS DESIGN AND ANALYSIS OF ALGORITHMS K.PALRAJ M.E.,(Ph.d) Assistant Professor Department of Computer Science and Engineering Sri Vidya College of Engineering & Technology CS6402 DESIGN AND ANALYSIS OF ALGORITHMS

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

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

2. (a) Explain the concept of virtual functions in C++ with suitable examples. (b) Explain the concept of operator overloading in C++.

2. (a) Explain the concept of virtual functions in C++ with suitable examples. (b) Explain the concept of operator overloading in C++. Code No: R059211201 Set No. 1 1. (a) What is a friend function? Explain the advantages and disadvantages of it? (b) What is static member function? Explain it s limitations. [8+8] 2. (a) Explain the concept

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

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

Cs502 Solved MCQS MidTerm

Cs502 Solved MCQS MidTerm Cs502 Solved MCQS MidTerm Question # 1 Word Algorithm comes from the name of the Muslim author: Abu Ja far Mohammad ibn Musaal-Khowarizmi. (p7) May 2013 Question # 2 Al-Khwarizmi s work was written in

More information

SUGGESTION : read all the questions and their values before you start.

SUGGESTION : read all the questions and their values before you start. Faculty of Science Final Examination Computer Science 308-251B Examiner: Prof. Claude Crépeau Date: April 30, 2010 Associate Examiner: Prof. Patrick Hayden Time: 09:00 12:00 INSTRUCTIONS: This examination

More information

CS6402 Design and Analysis of Algorithm. 2 Marks Question & Answer UNIT I INTRODUCTION

CS6402 Design and Analysis of Algorithm. 2 Marks Question & Answer UNIT I INTRODUCTION CS6402 Design and Analysis of Algorithm 2 Marks Question & Answer UNIT I INTRODUCTION 1. What is performance measurement? Performance measurement is concerned with obtaining the space and the time requirements

More information

Problem Score Maximum MC 34 (25/17) = 50 Total 100

Problem Score Maximum MC 34 (25/17) = 50 Total 100 Stony Brook University Midterm 2 CSE 373 Analysis of Algorithms November 22, 2016 Midterm Exam Name: ID #: Signature: Circle one: GRAD / UNDERGRAD INSTRUCTIONS: This is a closed book, closed mouth exam.

More information

Total No. of Questions :09] [Total No. of Pages : 02

Total No. of Questions :09] [Total No. of Pages : 02 CS/IT 315 (CR) Total No. of Questions :09] [Total No. of Pages : 02 III/IV B.Tech. DEGREE EXAMINATIONS, NOV/DEC- 2016 First Semester CS/IT DESIGN ANALYSIS OF ALGORITHMS Time: Three Hours Answer Question

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

Chapter 9 Graph Algorithms

Chapter 9 Graph Algorithms Introduction graph theory useful in practice represent many real-life problems can be if not careful with data structures Chapter 9 Graph s 2 Definitions Definitions an undirected graph is a finite set

More information

University of the Western Cape Department of Computer Science

University of the Western Cape Department of Computer Science University of the Western Cape Department of Computer Science Algorithms and Complexity CSC212 Paper II Final Examination 13 November 2015 Time: 90 Minutes. Marks: 100. UWC number Surname, first name Mark

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

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

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

Chapter 9. Greedy Technique. Copyright 2007 Pearson Addison-Wesley. All rights reserved.

Chapter 9. Greedy Technique. Copyright 2007 Pearson Addison-Wesley. All rights reserved. Chapter 9 Greedy Technique Copyright 2007 Pearson Addison-Wesley. All rights reserved. Greedy Technique Constructs a solution to an optimization problem piece by piece through a sequence of choices that

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

Algorithms (IX) Guoqiang Li. School of Software, Shanghai Jiao Tong University

Algorithms (IX) Guoqiang Li. School of Software, Shanghai Jiao Tong University Algorithms (IX) Guoqiang Li School of Software, Shanghai Jiao Tong University Q: What we have learned in Algorithm? Algorithm Design Algorithm Design Basic methodologies: Algorithm Design Algorithm Design

More information

Algorithm Design Techniques part I

Algorithm Design Techniques part I Algorithm Design Techniques part I Divide-and-Conquer. Dynamic Programming DSA - lecture 8 - T.U.Cluj-Napoca - M. Joldos 1 Some Algorithm Design Techniques Top-Down Algorithms: Divide-and-Conquer Bottom-Up

More information

CS583 Lecture 01. Jana Kosecka. some materials here are based on Profs. E. Demaine, D. Luebke A.Shehu, J-M. Lien and Prof. Wang s past lecture notes

CS583 Lecture 01. Jana Kosecka. some materials here are based on Profs. E. Demaine, D. Luebke A.Shehu, J-M. Lien and Prof. Wang s past lecture notes CS583 Lecture 01 Jana Kosecka some materials here are based on Profs. E. Demaine, D. Luebke A.Shehu, J-M. Lien and Prof. Wang s past lecture notes Course Info course webpage: - from the syllabus on http://cs.gmu.edu/

More information

PROGRAM EFFICIENCY & COMPLEXITY ANALYSIS

PROGRAM EFFICIENCY & COMPLEXITY ANALYSIS Lecture 03-04 PROGRAM EFFICIENCY & COMPLEXITY ANALYSIS By: Dr. Zahoor Jan 1 ALGORITHM DEFINITION A finite set of statements that guarantees an optimal solution in finite interval of time 2 GOOD ALGORITHMS?

More information

Data Structures and Algorithm Analysis in C++

Data Structures and Algorithm Analysis in C++ INTERNATIONAL EDITION Data Structures and Algorithm Analysis in C++ FOURTH EDITION Mark A. Weiss Data Structures and Algorithm Analysis in C++, International Edition Table of Contents Cover Title Contents

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

Topic Analysis PART-A

Topic Analysis PART-A Govt. of Karnataka, Department of Technical Education Diploma in Information Science & Engineering Third Semester Subject: ANALYSIS AND DESIGN OF ALGORITHM Contact Hrs / week: Total hrs: 64 Topic Analysis

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

Overview of Data Structures, Algorithm Analysis

Overview of Data Structures, Algorithm Analysis SIDDHARTH GROUP OF INSTITUTIONS :: PUTTUR Siddharth Nagar, Narayanavanam Road 517583 QUESTION BANK (DESCRIPTIVE) Subject with Code : Advanced Data structures and Algorithms (16CS5804) Year & Sem: M.Tech

More information

CMPSCI 311: Introduction to Algorithms Practice Final Exam

CMPSCI 311: Introduction to Algorithms Practice Final Exam CMPSCI 311: Introduction to Algorithms Practice Final Exam Name: ID: Instructions: Answer the questions directly on the exam pages. Show all your work for each question. Providing more detail including

More information

Chapter 3 Dynamic programming

Chapter 3 Dynamic programming Chapter 3 Dynamic programming 1 Dynamic programming also solve a problem by combining the solutions to subproblems. But dynamic programming considers the situation that some subproblems will be called

More information

Total Score /1 /20 /41 /15 /23 Grader

Total Score /1 /20 /41 /15 /23 Grader NAME: NETID: CS2110 Spring 2015 Prelim 2 April 21, 2013 at 5:30 0 1 2 3 4 Total Score /1 /20 /41 /15 /23 Grader There are 5 questions numbered 0..4 on 8 pages. Check now that you have all the pages. Write

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

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

Department of Computer Science and Technology

Department of Computer Science and Technology UNIT : Stack & Queue Short Questions 1 1 1 1 1 1 1 1 20) 2 What is the difference between Data and Information? Define Data, Information, and Data Structure. List the primitive data structure. List the

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

[ 11.2, 11.3, 11.4] Analysis of Algorithms. Complexity of Algorithms. 400 lecture note # Overview

[ 11.2, 11.3, 11.4] Analysis of Algorithms. Complexity of Algorithms. 400 lecture note # Overview 400 lecture note #0 [.2,.3,.4] Analysis of Algorithms Complexity of Algorithms 0. Overview The complexity of an algorithm refers to the amount of time and/or space it requires to execute. The analysis

More information