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

Size: px
Start display at page:

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

Transcription

1 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 of an Algorithm? 1. Input, 2. Output, 3. Finiteness, 4. Definiteness, 5. Effectiveness. b) Give the control abstraction of Divide and Conquer. 1. Divide: The problem split into number of sub problems. 2. Conquer: The sub problems by solving recursively. 3. Combine: The solutions to the sub problems into the solution for the original problem. c) Define Adjacency List. A list from the graph, it indicates the adjacency nodes. d) Differentiate Greedy and Dynamic Programming. The main difference is in greedy the problem gets optimal solution, but in the dynamic each sub problem gets optimal solution. e) What is Articulation Point? If we are going to delete a point (or node) in the graph, then it is divided one graph into 2 or more sub graphs. The point is called Articulation Point. f) Give two applications of DFS. Finding strongly connected components, detecting cycles in the graph. g) Define E-node and live node. A node which has generated and all of whose children have not at been generated is called live node. The live node whose children are currently being generated is called E-node. h) Define cycle in the graph. The single path of length at least one that begins and ends at the same point. It s exits in the directed graph. i) What is reliability and how reliability of a system increases? Reliability of a product is defined as the probability that the product will not fail throughout a prescribed operating period. Reliability increases if the number of components decreases. j) State sum of subsets problem. Finding sum of different combinations(from the set) of those elements in the given set is equal to the m(bag size).

2 k) Define Brach and bound. The branch is going to happen with the satisfactory of the bound. (or) The term Branch and Bound refers to all state space methods in which all the children of the e-node are generated before any live node becomes the e-node. l) Define NP-hard problem. A problem is NP-hard if an algorithm for solving it can be translated into one for solving any NPproblem (nondeterministic polynomial time) problem. NP-hard therefore means at least as hard as any NPhard problem. UNIT- I 2. a) Define terms Time complexity and Space complexity of algorithms. Give a notation for expressing such a complexity and explain the features of such a notation. Time complexity: Mark The time complexity of an algorithm is the amount of computer time it needs to run to completion. Space complexity: Mark The space complexity of an algorithm is the amount of memory it needs to run to completion. Any one of Big-Oh, Omega and Theta notation with definition and example Marks Big-Oh: The function f(n) =O(g(n)) iff there exist positive constants C & n 0 such that f(n) C * g(n) for all n, n n 0. Omega: The function f(n) = Ω (g(n)) iff there exist positive constants C & n 0 such that f(n) C * g(n) for all n, n n 0. Theta: The function f(n) = Ө(g(n)) iff there exist positive constants C 1, C 2 & n 0 such that C 1 g(n) f(n) C 2 g(n) for all n, n n 0. (Show as like for Big-Oh and Omega also)

3 2. b) Briefly explain Quick Sort Algorithm with suitable example and Derive its Time Complexity. Algorithm Qsort ( A,m,n) Marks integer i,j,k,t: if (m < n) i m; j n; k A(m) do do i i+1; } while (A[i] <k) do j j-1; } while ( A[j] >k) if ( i<j) t A[i]; A[i] A[j]; A[j] t; } } while (i>j) t A[m]; A[m] A[j]; A[j] t; Qsort ( A, m, j-1); Qsort (A, j+1, n); } } Time complexity:---2 Marks T(n) = 2T(n/2) + αn = 2(2T (n/4) + αn/2) + αn = 2 2 T (n/4) + 2αn (By simplifying and grouping terms together). = 2 2 (2T (n/8) + αn/4) + 2αn = 2 3 T (n/8) + 3αn = 2 k T (n/2 k) + kαn (Continuing likewise till the k th step) Notice that this recurrence will continue only until n = 2 k (otherwise we have n/2 k < 1), i.e. until k = log n. Thus, by putting k = log n, we have the following equation: T(n) = nt(1) + αn log n, which is O(n log n). Example Marks

4 3. a) Explain the pseudo code conventions for writing an algorithm. 1. Comments begin with // and continue until end of the line. 2. Blocks are indicated with matching braces & }. A compound statement can be represented as a block. The body of s procedure alo forms a block. Statements are delimited by ;. 3. An identifier begins with a letter. The data types of variables are not explicitly declared. The types will be clear from the context. Whether a variable is global or local to procedure will also be evident from the context. We assume simple data types such as integer, char, float,.. Compound data types can be formed with records. 4. Assignment of values to variable is done using assignment statement. <var>:= <expression>; 5. There are two Boolean values true & false. In order to produce these values, the logical operators and, or, not and the relational operators <,, =,,, > are provided. 6. Elements of multi dimensional arrays are accessed using [ and ]. 7. The following looping statements are employed for, while, and repeat- until. 8. A conditional statement has following forms if(condition ) then <statement> if(condition) then <statement-1> else <statement-2> 9. Input and output are done using the statements read and write. No format is used to specify the size of i/p or o/p quantities. 10. There is only one type of procedure: Algorithm. An algorithm consists of a heading and body. The heading takes the form: Algorithm <name of algorithm>(<parameters list>) Marks 3. b) Explain strassen s matrix multiplication with an example. Formulas:----3 Marks P= (a11+ a12) (b11+b22) Q= (a21+a22) b11 R= a11 (b12-b22) S= a22 (b21-b11) T= (a11+a12) b22 U= (a21-a11) (b11+b12) V= (a12-a22) (b21-b22) C11= P+S-T+V C12= R+T C21= Q+S C22= P+R-Q+U Example----3 Marks

5 UNIT - II 4. a) Define minimum cost spanning tree. State and explain Prim s Minimum cost Spanning tree algorithm with an example. Let G = (V, E) be an undirected connected weightage graph. A sub graph t= (V, E ) of G is a minimum total length spanning tree of G iff t is a tree Mark Marks Example----3 Marks 4. b) What is Travelling Salesman Problem? Apply Dynamic Programming to solve Travelling Salesman Problem. The travelling salesman problem is to find a tour of minimum cost Mark Example: Marks. Input is as like Graph or Adjacency Matrix to relate a graph. 5. a) Explain single source shortest path problem and give the Dijkstra s algorithm to solve single source shortest path problem. To determine the lengths of the shortest paths from one vertex V to each all other vertices in graph G Mark Example: Marks The example is a directed weightage graph with connectivity from one vertex to all each other vertices. 5. b) Explain Longest Common Subsequence Problem with an example? In the given sequences x=x1, x2,,xn., y= y1, y2,.,yn another sequence z=z1, z2,,zn is a subsequence of x and y. Here z is a Longest Common Subsequence. To Obtain LCS the given rules can follow: Marks

6 Rule1: 0 if i=0, j=0 C[i.j]= C[i-1, j-1] if i, j= 0 & xi=yj Max (C[i, j-1], C[i-1, j]) if i, j 0 & xi yj Rule2: Xi=yj Then B[i,j]= if C[i-1, j] C[i, j-1] then B[i, j]= else B[i,j]= Example Marks UNIT - III 6. a) Give the Algorithm for DFS and Explain with an example Marks Example Marks 6. b) Write an Algorithm for N- Queens problem and solve the 4-Queens problem by using state space tree. Mainly N queens must place in the n x n chess board without attack each other. No two queens are on the same column, same row and same diagonal.

7 Marks Example: solution table Mark State Space Tree Marks 7. a) Explain with the help of an algorithm, the mechanism of identifying articulation points and Bi-Connected components in a graph Marks

8 Example Marks i) Find DFS for the graph. ii) Assign Depth First Numbers to The Depth First Spanning Tree. iii) Find Least Depth First Numbers to the nodes in the DFS. iv) Identify Articulation Points. 7. b) What is Backtracking? Explain how the knapsack problem is solved using backtracking. Backtracking is a general algorithm for finding all(or one) solutions to some computational problems, notably constraint satisfaction problems, that incrementally builds candidates to the solution and abandons each partial candidate c(backtrack) as soon as it determines that c cannot possibly be completed to a valid solution. (or) To apply backtracking method the desired solution must be expressable as an n-tuples. (x 1, x 2,,x n ) where x i are chosen from some finite set s i. The problem to be solved requires finding one vector which maximizes/ minimizes or satisfies a criteria function Marks The problems which are solved by backtracking method require that the solution satisfy a complex set of constraints. These constraints are divided in two classes 1. Implicit: Exact solution for the problem 2. Explicit: The solution space for the problem Example of knapsack problem Marks UNIT - IV 8. a) Draw the portion of the state space tree generated by LC Branch and Bound for the following knapsack problem: n=5 profits=(10, 15, 6, 8, 4) and corresponding weights=(4, 6, 3, 4, 2) and m=12. Solution with state space tree Marks Find the profit of the knapsack bag fill with fraction (upper bound value) and without fraction (lower bound value) at each node of the state space tree. 8. b) Explain the principles of Control Abstractions for LC- search. For speeding up the search process here need to intelligent ranking function for live nodes. Each time, the next E-node is selected on the basis of this ranking function. For this ranking function additional computation (normally cost) is needed to reach the answer node from the live node. LC-search is a kind of search in which least cost involved for reaching to answer node. At each E-node the probability of being an answer node is checked. BFS and D-search are special cases of LC search. An LC search with bounding functions in known as LC Branch and Bound search. The applications of LC Branch and Bound are 0/1 Knapsack problem and Travelling salesman problem. The search mainly based on the state space tree. To find upper bound value and lower bound value at the each node to get the ranking value to identify which node is least cost Marks 9. a) Find an optimal solution for a travelling sales person problem using branch & bound technique by choosing an example. To get the solution for the TSP have to follow: Marks Step1: Find out the reduced cost matrix from a given cost matrix. This can be obtained as follows: 1. Row reduction: Get minimum element from the each row and subtract with each element include which element get, do it all rows in the cost matrix. After applying subtraction add all of the minimum elements, then gets row wise reduction sum.

9 2. Column reduction: As like row reduction get minimum element from each column and subtract to each element and do it all columns. Add all of the elements, then gets column wise reduction sum. Cumulative Reduction Sum (r) = row wise reduction sum + column wise reduction sum Step2: For starting node, cumulative reduction sum is as lower bound value and is upper bound value a) If path of i, j is considered then change all entries in row I and column j of matrix A to. b) Set A(j, 1) to.(assume starting node as 1) c) Apply row reduction and column reduction except for rows and columns containing, and find cumulative reduction sum (r). And find the lower bound value with Ĉ(S)= Ĉ(R) + A(i, j) + r Here Ĉ(R) is indicates lower bound of i th node in (i, j) path Ĉ(S) is indicates lower bound of jth node in (i, j) path r is cumulative reduction sum of the cost matrix in the (i, j) path. Example Marks 9. b) Explain the principles of FIFO Branch and Bound. FIFO stands or First In First Out, is follows the BFS technique. As like BFS, In this FIFO Branch and Bound reach a node to find upper bound and lower bound values and next it reaches another node in the same level of state space tree. And next reaches the node which is presented in the queue. FIFO Branch and Bound applications are knapsack problem and travelling salesman problem. This FIFO is one of the techniques of LC search. When implementing a FIFO branch and bound algorithm, here reach each and every node in the state space tree. Here can find out more than one solution for the problem, if the problem has the multiple paths of solution. Unlike LCBB, The FIFO BB needs more memory to show each node in the state space tree. The main principle of the FIFO is reaching every node which is generated by solution process in the state space tree Marks Scheme prepared by Signature of the HOD, IT Dept. Paper Evaluators: S.No Name Of the College Name of the Faculty Signature

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

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

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

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

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

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

UNIT 4 Branch and Bound

UNIT 4 Branch and Bound UNIT 4 Branch and Bound General method: Branch and Bound is another method to systematically search a solution space. Just like backtracking, we will use bounding functions to avoid generating subtrees

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. 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

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

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

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

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

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

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

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

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

Chapter-6 Backtracking

Chapter-6 Backtracking Chapter-6 Backtracking 6.1 Background Suppose, if you have to make a series of decisions, among various choices, where you don t have enough information to know what to choose. Each decision leads to a

More information

Branch and Bound. Live-node: A node that has not been expanded. It is similar to backtracking technique but uses BFS-like search.

Branch and Bound. Live-node: A node that has not been expanded. It is similar to backtracking technique but uses BFS-like search. Branch and Bound Definitions: Branch and Bound is a state space search method in which all the children of a node are generated before expanding any of its children. Live-node: A node that has not been

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

Backtracking and Branch-and-Bound

Backtracking and Branch-and-Bound Backtracking and Branch-and-Bound Usually for problems with high complexity Exhaustive Search is too time consuming Cut down on some search using special methods Idea: Construct partial solutions and extend

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

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

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

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

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

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

INTRODUCTION TO ALGORITHMS

INTRODUCTION TO ALGORITHMS UNIT- Introduction: Algorithm: The word algorithm came from the name of a Persian mathematician Abu Jafar Mohammed Ibn Musa Al Khowarizmi (ninth century) An algorithm is simply s set of rules used to perform

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

INTRODUCTION. An easy way to express the idea of an algorithm (very much like C/C++, Java, Pascal, Ada, )

INTRODUCTION. An easy way to express the idea of an algorithm (very much like C/C++, Java, Pascal, Ada, ) INTRODUCTION Objective: - Algorithms - Techniques - Analysis. Algorithms: Definition: Pseudocode: An algorithm is a sequence of computational steps that tae some value, or set of values, as input and produce

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

Coping with the Limitations of Algorithm Power Exact Solution Strategies Backtracking Backtracking : A Scenario

Coping with the Limitations of Algorithm Power Exact Solution Strategies Backtracking Backtracking : A Scenario Coping with the Limitations of Algorithm Power Tackling Difficult Combinatorial Problems There are two principal approaches to tackling difficult combinatorial problems (NP-hard problems): Use a strategy

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

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

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

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

Assignment No 2 (Group B)

Assignment No 2 (Group B) Assignment No 2 (Group B) 1 Problem Statement : Concurrent Implementation of Travelling Salesman Problem. 2 Objective : To develop problem solving abilities using Mathematical Modeling. To apply algorithmic

More information

Chapter 6 Backtracking Algorithms. Backtracking algorithms Branch-and-bound algorithms

Chapter 6 Backtracking Algorithms. Backtracking algorithms Branch-and-bound algorithms Chapter 6 Backtracking Algorithms Backtracking algorithms Branch-and-bound algorithms 1 Backtracking Algorithm The task is to determine algorithm for finding solutions to specific problems not by following

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

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

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

NP-complete Reductions

NP-complete Reductions NP-complete Reductions 1. Prove that 3SAT P DOUBLE-SAT, i.e., show DOUBLE-SAT is NP-complete by reduction from 3SAT. The 3-SAT problem consists of a conjunction of clauses over n Boolean variables, where

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

DESIGN AND ANALYSIS OF ALGORITHMS GREEDY METHOD

DESIGN AND ANALYSIS OF ALGORITHMS GREEDY METHOD 1 DESIGN AND ANALYSIS OF ALGORITHMS UNIT II Objectives GREEDY METHOD Explain and detail about greedy method Explain the concept of knapsack problem and solve the problems in knapsack Discuss the applications

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

Lecture 3. Brute Force

Lecture 3. Brute Force Lecture 3 Brute Force 1 Lecture Contents 1. Selection Sort and Bubble Sort 2. Sequential Search and Brute-Force String Matching 3. Closest-Pair and Convex-Hull Problems by Brute Force 4. Exhaustive Search

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

Sai Nath University. Assignment For B.tech in CS 8 st Sem.

Sai Nath University. Assignment For B.tech in CS 8 st Sem. Sai Nath University Assignment For B.tech in CS 8 st Sem. The Assignment will consist of two parts, A and B. Part A will have 5 short answer questions(40-60 words) of 4 marks each. Part B will have 4 long

More information

Attendance (2) Performance (3) Oral (5) Total (10) Dated Sign of Subject Teacher

Attendance (2) Performance (3) Oral (5) Total (10) Dated Sign of Subject Teacher Attendance (2) Performance (3) Oral (5) Total (10) Dated Sign of Subject Teacher Date of Performance:... Actual Date of Completion:... Expected Date of Completion:... ----------------------------------------------------------------------------------------------------------------

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

DATA STRUCTURE : A MCQ QUESTION SET Code : RBMCQ0305

DATA STRUCTURE : A MCQ QUESTION SET Code : RBMCQ0305 Q.1 If h is any hashing function and is used to hash n keys in to a table of size m, where n

More information

Search means finding a path or traversal between a start node and one of a set of goal nodes. Search is a study of states and their transitions.

Search means finding a path or traversal between a start node and one of a set of goal nodes. Search is a study of states and their transitions. UNIT 3 BASIC TRAVERSAL AND SEARCH TECHNIQUES Search means finding a path or traversal between a start node and one of a set of goal nodes. Search is a study of states and their transitions. Search involves

More information

INTRODUCTION. Analysis: Determination of time and space requirements of the algorithm

INTRODUCTION. Analysis: Determination of time and space requirements of the algorithm INTRODUCTION A. Preliminaries: Purpose: Learn the design and analysis of algorithms Definition of Algorithm: o A precise statement to solve a problem on a computer o A sequence of definite instructions

More information

Final. Name: TA: Section Time: Course Login: Person on Left: Person on Right: U.C. Berkeley CS170 : Algorithms, Fall 2013

Final. Name: TA: Section Time: Course Login: Person on Left: Person on Right: U.C. Berkeley CS170 : Algorithms, Fall 2013 U.C. Berkeley CS170 : Algorithms, Fall 2013 Final Professor: Satish Rao December 16, 2013 Name: Final TA: Section Time: Course Login: Person on Left: Person on Right: Answer all questions. Read them carefully

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

CSC 8301 Design and Analysis of Algorithms: Exhaustive Search

CSC 8301 Design and Analysis of Algorithms: Exhaustive Search CSC 8301 Design and Analysis of Algorithms: Exhaustive Search Professor Henry Carter Fall 2016 Recap Brute force is the use of iterative checking or solving a problem by its definition The straightforward

More information

INTRODUCTION. Objective: - Algorithms - Techniques - Analysis. Algorithms:

INTRODUCTION. Objective: - Algorithms - Techniques - Analysis. Algorithms: INTRODUCTION Objective: - Algorithms - Techniques - Analysis. Algorithms: Definition: Pseudocode: An algorithm is a sequence of computational steps that tae some value, or set of values, as input and produce

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

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

DATA STRUCTURES AND ALGORITHMS

DATA STRUCTURES AND ALGORITHMS DATA STRUCTURES AND ALGORITHMS UNIT 1 - LINEAR DATASTRUCTURES 1. Write down the definition of data structures? A data structure is a mathematical or logical way of organizing data in the memory that consider

More information

UCS-406 (Data Structure) Lab Assignment-1 (2 weeks)

UCS-406 (Data Structure) Lab Assignment-1 (2 weeks) UCS-40 (Data Structure) Lab Assignment- (2 weeks) Implement the following programs in C/C++/Python/Java using functions a) Insertion Sort b) Bubble Sort c) Selection Sort d) Linear Search e) Binary Search

More information

Search Algorithms. IE 496 Lecture 17

Search Algorithms. IE 496 Lecture 17 Search Algorithms IE 496 Lecture 17 Reading for This Lecture Primary Horowitz and Sahni, Chapter 8 Basic Search Algorithms Search Algorithms Search algorithms are fundamental techniques applied to solve

More information

Computer Science 385 Design and Analysis of Algorithms Siena College Spring Topic Notes: Brute-Force Algorithms

Computer Science 385 Design and Analysis of Algorithms Siena College Spring Topic Notes: Brute-Force Algorithms Computer Science 385 Design and Analysis of Algorithms Siena College Spring 2019 Topic Notes: Brute-Force Algorithms Our first category of algorithms are called brute-force algorithms. Levitin defines

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

Dynamic Programmming: Activity Selection

Dynamic Programmming: Activity Selection Dynamic Programmming: Activity Selection Select the maximum number of non-overlapping activities from a set of n activities A = {a 1,, a n } (sorted by finish times). Identify easier subproblems to solve.

More information

Introduction to Algorithms

Introduction to Algorithms Introduction to Algorithms Dynamic Programming Well known algorithm design techniques: Brute-Force (iterative) ti algorithms Divide-and-conquer algorithms Another strategy for designing algorithms is dynamic

More information

Lecturers: Sanjam Garg and Prasad Raghavendra March 20, Midterm 2 Solutions

Lecturers: Sanjam Garg and Prasad Raghavendra March 20, Midterm 2 Solutions U.C. Berkeley CS70 : Algorithms Midterm 2 Solutions Lecturers: Sanjam Garg and Prasad aghavra March 20, 207 Midterm 2 Solutions. (0 points) True/False Clearly put your answers in the answer box in front

More information

6. Algorithm Design Techniques

6. Algorithm Design Techniques 6. Algorithm Design Techniques 6. Algorithm Design Techniques 6.1 Greedy algorithms 6.2 Divide and conquer 6.3 Dynamic Programming 6.4 Randomized Algorithms 6.5 Backtracking Algorithms Malek Mouhoub, CS340

More information

Data Structures and Algorithms for Engineers

Data Structures and Algorithms for Engineers 04-630 Data Structures and Algorithms for Engineers David Vernon Carnegie Mellon University Africa vernon@cmu.edu www.vernon.eu Data Structures and Algorithms for Engineers 1 Carnegie Mellon University

More information

Algorithms and Data Structures

Algorithms and Data Structures Algorithm Analysis Page 1 - Algorithm Analysis Dr. Fall 2008 Algorithm Analysis Page 2 Outline Textbook Overview Analysis of Algorithm Pseudo-Code and Primitive Operations Growth Rate and Big-Oh Notation

More information

Backtracking. Chapter 5

Backtracking. Chapter 5 1 Backtracking Chapter 5 2 Objectives Describe the backtrack programming technique Determine when the backtracking technique is an appropriate approach to solving a problem Define a state space tree for

More information

UNIT 5 BACKTRACKING. BACKTRACKING (General Method)

UNIT 5 BACKTRACKING. BACKTRACKING (General Method) UNIT 5 BACKTRACKING BACKTRACKING (General Method) Definition Depth First node generation with bounding function is called backtracking. Suppose mi is the size of set S i. Then there are m=m1,m2..m n n-tuples

More information

CMSC Introduction to Algorithms Spring 2012 Lecture 16

CMSC Introduction to Algorithms Spring 2012 Lecture 16 CMSC 351 - Introduction to Algorithms Spring 2012 Lecture 16 Instructor: MohammadTaghi Hajiaghayi Scribe: Rajesh Chitnis 1 Introduction In this lecture we will look at Greedy Algorithms and Dynamic Programming.

More information

CS 350 Final Algorithms and Complexity. It is recommended that you read through the exam before you begin. Answer all questions in the space provided.

CS 350 Final Algorithms and Complexity. It is recommended that you read through the exam before you begin. Answer all questions in the space provided. It is recommended that you read through the exam before you begin. Answer all questions in the space provided. Name: Answer whether the following statements are true or false and briefly explain your answer

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

CS 161 Fall 2015 Final Exam

CS 161 Fall 2015 Final Exam CS 161 Fall 2015 Final Exam Name: Student ID: 1: 2: 3: 4: 5: 6: 7: 8: Total: 1. (15 points) Let H = [24, 21, 18, 15, 12, 9, 6, 3] be an array of eight numbers, interpreted as a binary heap with the maximum

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

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

Brute Force: Selection Sort

Brute Force: Selection Sort Brute Force: Intro Brute force means straightforward approach Usually based directly on problem s specs Force refers to computational power Usually not as efficient as elegant solutions Advantages: Applicable

More information

The Algorithm Design Manual

The Algorithm Design Manual Steven S. Skiena The Algorithm Design Manual With 72 Figures Includes CD-ROM THE ELECTRONIC LIBRARY OF SCIENCE Contents Preface vii I TECHNIQUES 1 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 1.10 2 2.1 2.2 2.3

More information

1 P a g e A r y a n C o l l e g e \ B S c _ I T \ C \

1 P a g e A r y a n C o l l e g e \ B S c _ I T \ C \ BSc IT C Programming (2013-2017) Unit I Q1. What do you understand by type conversion? (2013) Q2. Why we need different data types? (2013) Q3 What is the output of the following (2013) main() Printf( %d,

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

Exam Sample Questions CS3212: Algorithms and Data Structures

Exam Sample Questions CS3212: Algorithms and Data Structures Exam Sample Questions CS31: Algorithms and Data Structures NOTE: the actual exam will contain around 0-5 questions. 1. Consider a LinkedList that has a get(int i) method to return the i-th element in the

More information

Outline and Reading. Analysis of Algorithms 1

Outline and Reading. Analysis of Algorithms 1 Outline and Reading Algorithms Running time ( 3.1) Pseudo-code ( 3.2) Counting primitive operations ( 3.4) Asymptotic notation ( 3.4.1) Asymptotic analysis ( 3.4.2) Case study ( 3.4.3) Analysis of Algorithms

More information

CS 440 Theory of Algorithms /

CS 440 Theory of Algorithms / CS 440 Theory of Algorithms / CS 468 Algorithms in Bioinformaticsi Brute Force. Design and Analysis of Algorithms - Chapter 3 3-0 Brute Force A straightforward approach usually based on problem statement

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

CMSC351 - Fall 2014, Final Exam

CMSC351 - Fall 2014, Final Exam CMSC351 - Fall 2014, Final Exam Type A WAIT FOR INSTRUCTIONS BEFORE BEGINNING HONOR PLEDGE: I pledge on my honor that I have not given or received any unauthorized assistance on this examination. Signature

More information

Chapter 6. Dynamic Programming

Chapter 6. Dynamic Programming Chapter 6 Dynamic Programming CS 573: Algorithms, Fall 203 September 2, 203 6. Maximum Weighted Independent Set in Trees 6..0. Maximum Weight Independent Set Problem Input Graph G = (V, E) and weights

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

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

Lecture 1. Introduction

Lecture 1. Introduction Lecture 1 Introduction 1 Lecture Contents 1. What is an algorithm? 2. Fundamentals of Algorithmic Problem Solving 3. Important Problem Types 4. Fundamental Data Structures 2 1. What is an Algorithm? Algorithm

More information

LECTURE 9 Data Structures: A systematic way of organizing and accessing data. --No single data structure works well for ALL purposes.

LECTURE 9 Data Structures: A systematic way of organizing and accessing data. --No single data structure works well for ALL purposes. LECTURE 9 Data Structures: A systematic way of organizing and accessing data. --No single data structure works well for ALL purposes. Input Algorithm Output An algorithm is a step-by-step procedure for

More information

University of New Mexico Department of Computer Science. Final Examination. CS 362 Data Structures and Algorithms Spring, 2006

University of New Mexico Department of Computer Science. Final Examination. CS 362 Data Structures and Algorithms Spring, 2006 University of New Mexico Department of Computer Science Final Examination CS 6 Data Structures and Algorithms Spring, 006 Name: Email: Print your name and email, neatly in the space provided above; print

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

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

Lecture 4: Graph Algorithms

Lecture 4: Graph Algorithms Lecture 4: Graph Algorithms Definitions Undirected graph: G =(V, E) V finite set of vertices, E finite set of edges any edge e = (u,v) is an unordered pair Directed graph: edges are ordered pairs If e

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

Lecture 13. Reading: Weiss, Ch. 9, Ch 8 CSE 100, UCSD: LEC 13. Page 1 of 29

Lecture 13. Reading: Weiss, Ch. 9, Ch 8 CSE 100, UCSD: LEC 13. Page 1 of 29 Lecture 13 Connectedness in graphs Spanning trees in graphs Finding a minimal spanning tree Time costs of graph problems and NP-completeness Finding a minimal spanning tree: Prim s and Kruskal s algorithms

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

Elementary maths for GMT. Algorithm analysis Part II

Elementary maths for GMT. Algorithm analysis Part II Elementary maths for GMT Algorithm analysis Part II Algorithms, Big-Oh and Big-Omega An algorithm has a O( ) and Ω( ) running time By default, we mean the worst case running time A worst case O running

More information