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

Size: px
Start display at page:

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

Transcription

1 Contents Preface... (vii) Acknowledgements... (ix) 1 Introduction 1.1 Algorithm Life Cycle of Design and Analysis of Algorithm Pseudo-Code for Expressing Algorithms Recursive Algorithms Towers of Hanoi Performance Analysis of Algorithm Efficiency Priori Analysis Posteriori Analysis Complexity Asymptoic Notation: [Formal Definitions] Properties of Asymptotic Notations Recurrence Relations Substitution Method The Master Method Probabilistic Analysis Amortized Analysis 33 Previous Gate Questions and Solutions 35 Objective Question Bank 42 Fill in the Blanks 45 Review Questions 46 2 Searching and Traversal Techniques 2.1 Binary Tree Traversal Techniques Recursive Binary Tree Traversal Algorithms Non-recursive Binary Tree Traversal Algorithms Sets and Disjoint Set Union 60

2 (xii) Contents 2.3 Representation of Sets Tree Representation of Sets Data Representation of Sets Array Representation of Sets Simple Union Algorithm Weighted Union Algorithm Weighting Rule for Union (i, j) Collapsing Rule Graph Adjacency Matrix Adjacency List Graph Traversal Algorithms Spanning Tree Types of Edges AND-OR Graphs Game Trees The Minimax Search Procedure NIM Game Tree Connected Components Strongly Connected Graph Bi-connected Component 82 Objective Question Bank 84 Fill in the Blanks 86 Review Questions 87 3 Divide and Conquer 3.1 General Method Binary Search Recursive Algorithm for Binary Search Maximum and Minimum Iterative Maximum and Minimum Algorithm Recursive Maximum and Minimum Algorithm Quick Sort Quick Sort Algorithm Best Case Time Complexity 105

3 3.4.3 Worst Case Time Complexity Average Case Time Complexity Merge Sort Recursive Merge Sort Algorithm Time Complexity of Merge Sort Space Complexity Two Way Merge Sort Matrix Multiplication Strassen s Matrix Multiplication Strassen s Algorithm Time Complexity of Strassen s Algorithm 117 Previous Gate Questions and Answers 118 Objective Question Bank 119 Fill in the Blanks 122 Review Questions The Greedy Method 4.1 The Greedy Method Functions of Greedy Algorithms Knapsacks Problem Job Sequencing with Deadlines Minimum Cost Spanning Tree Prim s Algorithm Krushkal s Algorithm Optimal Storage on Tapes Optimal Merge Patterns Single Source Shortest Paths 144 Objective Question Bank 146 Fill in the Blanks 147 Review Questions 148 Contents (xiii)

4 (xiv) Contents 5 Dynamic Programming 5.1 The General Methods Multistage Graphs Forward Method Backward Method Solution Optimal Binary Search Trees Binary Search Tree Cost of a Binary Search Tree /1 Knapsack Problem Dominance Rule All Pairs Shortest Path Problem The Travelling Salesperson Problem Reliability Problem 180 Objective Question Bank 183 Fill in the Blanks 185 Review Questions Backtracking 6.1 The General Methods N-Queens Problem Queens Problem Tracing of Solution to 4-queen Problem Queen Problem Sum Of Subsets Graph Coloring Hamiltonian Cycles 209 Objective Question Bank 211 Fill in the Blanks 214 Review Questions Branch and Bound 7.1 Introduction Fifo Branch and Bound 218

5 Contents (xv) 7.3 Lifo Branch and Bound Least Cost Branch and Bound Queens Problem Formulation of Least Cost Search Control Abstractions for LC Search Bounding Travelling Sales Person Problem Reduced Cost Matrix /1 Knapsack Problem using Branch and Bound LC Branch and Bound Solution FIFO Branch and Bound Solution 241 Objective Question Bank 244 Fill in the Blanks 246 Review Questions NP Hard and NP Complete Problems 8.1 Introduction Tractable Problems Polynomial Time Algorithm Intractable Problems NP Problems Non-deterministic Algorithms NP-Hard and NP-complete Classes NP Complete Problem NP Hard Problems Satisfiability Problem Cook s Theorem 257 Objective Question Bank 257 Fill in the Blanks 260 Review Questions 261 Answers 263 Index 269

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

CS/ENGRD 2110 Object-Oriented Programming and Data Structures Spring 2012 Thorsten Joachims. Lecture 25: Review and Open Problems

CS/ENGRD 2110 Object-Oriented Programming and Data Structures Spring 2012 Thorsten Joachims. Lecture 25: Review and Open Problems CS/ENGRD 2110 Object-Oriented Programming and Data Structures Spring 2012 Thorsten Joachims Lecture 25: Review and Open Problems Course Overview Programming Concepts Object-Oriented Programming Interfaces

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

INDEX. Cambridge University Press How to Think About Algorithms Jeff Edmonds Index More information

INDEX. Cambridge University Press How to Think About Algorithms Jeff Edmonds Index More information INDEX 439 abstract data type (ADT), 1, 43 exercise solutions, 414 functions vs., 43 merging with queue, 56 specifications/implementations, 44 dictionary, 47 graphs, 47 link list implementation, 51 list,

More information

2) Explain in detail about different AVL rotation applied on unbalanced trees.

2) Explain in detail about different AVL rotation applied on unbalanced trees. (DMCS 01) ASSIGNMENT - 1, MAY-2014. PAPER- I : DATA STRUCTURES 1) Define circular queue. Write an algorithm to describe insertion and deletion operation on a circular queue. Illustrate these operations

More information

M.Sc. (Previous) DEGREE EXAMINATION, MAY (Examination at the end of First Year) Computer Science. Time : 03 Hours Maximum Marks : 75

M.Sc. (Previous) DEGREE EXAMINATION, MAY (Examination at the end of First Year) Computer Science. Time : 03 Hours Maximum Marks : 75 M.Sc. (Previous) DEGREE EXAMINATION, MAY - 2013 (Examination at the end of First Year) Computer Science Paper - I : DATA STRUCTURES (DMCS 01) Time : 03 Hours Maximum Marks : 75 Section - A (3 15 = 45)

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

Notation Index. Probability notation. (there exists) (such that) Fn-4 B n (Bell numbers) CL-27 s t (equivalence relation) GT-5.

Notation Index. Probability notation. (there exists) (such that) Fn-4 B n (Bell numbers) CL-27 s t (equivalence relation) GT-5. Notation Index (there exists) (for all) Fn-4 Fn-4 (such that) Fn-4 B n (Bell numbers) CL-27 s t (equivalence relation) GT-5 ( n ) k (binomial coefficient) CL-15 ( n m 1,m 2,...) (multinomial coefficient)

More information

DIVIDE & CONQUER. Problem of size n. Solution to sub problem 1

DIVIDE & CONQUER. Problem of size n. Solution to sub problem 1 DIVIDE & CONQUER Definition: Divide & conquer is a general algorithm design strategy with a general plan as follows: 1. DIVIDE: A problem s instance is divided into several smaller instances of the same

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

LOGIC SYNTHESIS AND VERIFICATION ALGORITHMS. Gary D. Hachtel University of Colorado. Fabio Somenzi University of Colorado.

LOGIC SYNTHESIS AND VERIFICATION ALGORITHMS. Gary D. Hachtel University of Colorado. Fabio Somenzi University of Colorado. LOGIC SYNTHESIS AND VERIFICATION ALGORITHMS by Gary D. Hachtel University of Colorado Fabio Somenzi University of Colorado Springer Contents I Introduction 1 1 Introduction 5 1.1 VLSI: Opportunity and

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

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

Notation Index 9 (there exists) Fn-4 8 (for all) Fn-4 3 (such that) Fn-4 B n (Bell numbers) CL-25 s ο t (equivalence relation) GT-4 n k (binomial coef

Notation Index 9 (there exists) Fn-4 8 (for all) Fn-4 3 (such that) Fn-4 B n (Bell numbers) CL-25 s ο t (equivalence relation) GT-4 n k (binomial coef Notation 9 (there exists) Fn-4 8 (for all) Fn-4 3 (such that) Fn-4 B n (Bell numbers) CL-25 s ο t (equivalence relation) GT-4 n k (binomial coefficient) CL-14 (multinomial coefficient) CL-18 n m 1 ;m 2

More information

LOGIC AND DISCRETE MATHEMATICS

LOGIC AND DISCRETE MATHEMATICS LOGIC AND DISCRETE MATHEMATICS A Computer Science Perspective WINFRIED KARL GRASSMANN Department of Computer Science University of Saskatchewan JEAN-PAUL TREMBLAY Department of Computer Science University

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

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

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

Lecture 3, Review of Algorithms. What is Algorithm?

Lecture 3, Review of Algorithms. What is Algorithm? BINF 336, Introduction to Computational Biology Lecture 3, Review of Algorithms Young-Rae Cho Associate Professor Department of Computer Science Baylor University What is Algorithm? Definition A process

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

M.Sc. (Computer Science) I Year Assignments for May Paper I DATA STRUCTURES Assignment I

M.Sc. (Computer Science) I Year Assignments for May Paper I DATA STRUCTURES Assignment I Paper I DATA STRUCTURES (DMCS 01) 1. Explain in detail about the overview of Data structures. 2. Explain circular linked list and double-linked list. 3. Explain CPU scheduling in Multiprogramming Environment.

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

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

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

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

Theorem 2.9: nearest addition algorithm

Theorem 2.9: nearest addition algorithm There are severe limits on our ability to compute near-optimal tours It is NP-complete to decide whether a given undirected =(,)has a Hamiltonian cycle An approximation algorithm for the TSP can be used

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

Cpt S 223 Course Overview. Cpt S 223, Fall 2007 Copyright: Washington State University

Cpt S 223 Course Overview. Cpt S 223, Fall 2007 Copyright: Washington State University Cpt S 223 Course Overview 1 Course Goals Learn about new/advanced data structures Be able to make design choices on the suitable data structure for different application/problem needs Analyze (objectively)

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

Review of course COMP-251B winter 2010

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

More information

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

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

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

The Design of Approximation Algorithms

The Design of Approximation Algorithms The Design of Approximation Algorithms David P. Williamson Cornell University David B. Shmoys Cornell University m Щ0 CAMBRIDGE UNIVERSITY PRESS Contents Preface page ix I An Introduction to the Techniques

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

About the Author. Dependency Chart. Chapter 1: Logic and Sets 1. Chapter 2: Relations and Functions, Boolean Algebra, and Circuit Design

About the Author. Dependency Chart. Chapter 1: Logic and Sets 1. Chapter 2: Relations and Functions, Boolean Algebra, and Circuit Design Preface About the Author Dependency Chart xiii xix xxi Chapter 1: Logic and Sets 1 1.1: Logical Operators: Statements and Truth Values, Negations, Conjunctions, and Disjunctions, Truth Tables, Conditional

More information

Chapter 1 Introduction

Chapter 1 Introduction Preface xv Chapter 1 Introduction 1.1 What's the Book About? 1 1.2 Mathematics Review 2 1.2.1 Exponents 3 1.2.2 Logarithms 3 1.2.3 Series 4 1.2.4 Modular Arithmetic 5 1.2.5 The P Word 6 1.3 A Brief Introduction

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

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

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

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

CLASSIC DATA STRUCTURES IN JAVA

CLASSIC DATA STRUCTURES IN JAVA CLASSIC DATA STRUCTURES IN JAVA Timothy Budd Oregon State University Boston San Francisco New York London Toronto Sydney Tokyo Singapore Madrid Mexico City Munich Paris Cape Town Hong Kong Montreal CONTENTS

More information

Specimen of Lesson Plan

Specimen of Lesson Plan Specimen of Lesson Plan Programming Languages(BCA-201 B) 15 s(from july 2018 to Dec 2018) ** Work Load (/)per week(in hours):- rs:-4 BCA 1 Introduction to PL, Characteristics of a good PL Syntactics and

More information

Spanning Tree. Lecture19: Graph III. Minimum Spanning Tree (MSP)

Spanning Tree. Lecture19: Graph III. Minimum Spanning Tree (MSP) Spanning Tree (015) Lecture1: Graph III ohyung Han S, POSTH bhhan@postech.ac.kr efinition and property Subgraph that contains all vertices of the original graph and is a tree Often, a graph has many different

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

Table of Contents. Chapter 1: Introduction to Data Structures... 1

Table of Contents. Chapter 1: Introduction to Data Structures... 1 Table of Contents Chapter 1: Introduction to Data Structures... 1 1.1 Data Types in C++... 2 Integer Types... 2 Character Types... 3 Floating-point Types... 3 Variables Names... 4 1.2 Arrays... 4 Extraction

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

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

For 100% Result Oriented IGNOU Coaching and Project Training Call CPD: ,

For 100% Result Oriented IGNOU Coaching and Project Training Call CPD: , ASSIGNMENT OF MCS-031(ADA) Question 1: (a) Show, through appropriate examples or otherwise, that the following three characteristics of an algorithm are independent (i) finiteness An algorithm must terminate

More information

CSE 100: B+ TREE, 2-3 TREE, NP- COMPLETNESS

CSE 100: B+ TREE, 2-3 TREE, NP- COMPLETNESS CSE 100: B+ TREE, 2-3 TREE, NP- COMPLETNESS Analyzing find in B-trees Since the B-tree is perfectly height-balanced, the worst case time cost for find is O(logN) Best case: If every internal node is completely

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

THE DESIGN AND ANALYSIS OF COMPUTER ALGORITHMS

THE DESIGN AND ANALYSIS OF COMPUTER ALGORITHMS 2008 AGI-Information Management Consultants May be used for personal purporses only or by libraries associated to dandelon.com network. THE DESIGN AND ANALYSIS OF COMPUTER ALGORITHMS Alfred V. Aho Bell

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

Best known solution time is Ω(V!) Check every permutation of vertices to see if there is a graph edge between adjacent vertices

Best known solution time is Ω(V!) Check every permutation of vertices to see if there is a graph edge between adjacent vertices Hard Problems Euler-Tour Problem Undirected graph G=(V,E) An Euler Tour is a path where every edge appears exactly once. The Euler-Tour Problem: does graph G have an Euler Path? Answerable in O(E) time.

More information

UNIT 3. Greedy Method. Design and Analysis of Algorithms GENERAL METHOD

UNIT 3. Greedy Method. Design and Analysis of Algorithms GENERAL METHOD UNIT 3 Greedy Method GENERAL METHOD Greedy is the most straight forward design technique. Most of the problems have n inputs and require us to obtain a subset that satisfies some constraints. Any subset

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

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

Greedy Algorithms 1 {K(S) K(S) C} For large values of d, brute force search is not feasible because there are 2 d {1,..., d}.

Greedy Algorithms 1 {K(S) K(S) C} For large values of d, brute force search is not feasible because there are 2 d {1,..., d}. Greedy Algorithms 1 Simple Knapsack Problem Greedy Algorithms form an important class of algorithmic techniques. We illustrate the idea by applying it to a simplified version of the Knapsack Problem. Informally,

More information

Unit 8: Coping with NP-Completeness. Complexity classes Reducibility and NP-completeness proofs Coping with NP-complete problems. Y.-W.

Unit 8: Coping with NP-Completeness. Complexity classes Reducibility and NP-completeness proofs Coping with NP-complete problems. Y.-W. : Coping with NP-Completeness Course contents: Complexity classes Reducibility and NP-completeness proofs Coping with NP-complete problems Reading: Chapter 34 Chapter 35.1, 35.2 Y.-W. Chang 1 Complexity

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

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

Total No. of Questions : 18] [Total No. of Pages : 02. M.Sc. DEGREE EXAMINATION, DEC First Year COMPUTER SCIENCE.

Total No. of Questions : 18] [Total No. of Pages : 02. M.Sc. DEGREE EXAMINATION, DEC First Year COMPUTER SCIENCE. (DMCS01) Total No. of Questions : 18] [Total No. of Pages : 02 M.Sc. DEGREE EXAMINATION, DEC. 2016 First Year COMPUTER SCIENCE Data Structures Time : 3 Hours Maximum Marks : 70 Section - A (3 x 15 = 45)

More information

Ph.D. Written Examination Syllabus

Ph.D. Written Examination Syllabus Ph.D. Written Examination Syllabus August 11, 2016 1 Analysis of Algorithms Syllabus Philosophy: We are testing analytical ability: how well students think on their feet, rather than details of some data

More information

Contents. Preface xvii Acknowledgments. CHAPTER 1 Introduction to Parallel Computing 1. CHAPTER 2 Parallel Programming Platforms 11

Contents. Preface xvii Acknowledgments. CHAPTER 1 Introduction to Parallel Computing 1. CHAPTER 2 Parallel Programming Platforms 11 Preface xvii Acknowledgments xix CHAPTER 1 Introduction to Parallel Computing 1 1.1 Motivating Parallelism 2 1.1.1 The Computational Power Argument from Transistors to FLOPS 2 1.1.2 The Memory/Disk Speed

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

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

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

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

Data Structures. 1. Each entry in a linked list is a called a (a)link (b)node (c)data structure (d)none of the above

Data Structures. 1. Each entry in a linked list is a called a (a)link (b)node (c)data structure (d)none of the above Data Structures 1. Each entry in a linked list is a called a --------- (a)link (b)node (c)data structure (d)none of the above 2. Linked list uses type of memory allocation (a)static (b)dynamic (c)random

More information

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

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

More information

Adikavi Nannaya University, Rajahmundry MCA III Semester 3.1 Computer Networks (Model Question Paper) Time : 3 Hours Max.

Adikavi Nannaya University, Rajahmundry MCA III Semester 3.1 Computer Networks (Model Question Paper) Time : 3 Hours Max. 3.1 Computer Networks (Model Question Paper) 1. a)with a neat block diagram explain the TCP/IP reference model. List out the limitations of the model. [15] (b) What are the functions of the physical layer?

More information