This document outlines an exam for an Algorithms course, including 16 questions covering various algorithm topics. The questions cover concepts like time complexity, asymptotic notations, graph algorithms like minimum spanning trees and shortest paths, sorting algorithms like merge sort and quicksort, search algorithms like linear search and pattern matching, NP-complete problems, dynamic programming, and other algorithm design paradigms like divide-and-conquer, greedy algorithms, and backtracking. Students are asked to define key terms, outline algorithms, analyze time complexities, and provide examples for many fundamental algorithms and problems.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
45 views3 pages
UnivQP Alg AK
This document outlines an exam for an Algorithms course, including 16 questions covering various algorithm topics. The questions cover concepts like time complexity, asymptotic notations, graph algorithms like minimum spanning trees and shortest paths, sorting algorithms like merge sort and quicksort, search algorithms like linear search and pattern matching, NP-complete problems, dynamic programming, and other algorithm design paradigms like divide-and-conquer, greedy algorithms, and backtracking. Students are asked to define key terms, outline algorithms, analyze time complexities, and provide examples for many fundamental algorithms and problems.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 3
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
ACADEMTC YEAR 2022-2023 - EVEN SEMESTER (Regulation 2021)
UNIVERSITY EXAM Course Code &Title: CS3401 - ALGORITHMS Year / Semester : II / IV Date : 17/06/2023 Time : 3 Hours Max Marks: 100 Marks
Answer all questions
PART – A (5 X 2 = 10 Marks) 1. Define time complexity of an algorithm. Time complexity is defined as the amount of time taken by an algorithm to run, as a function of the length of the input. It measures the time taken to execute each statement of code in an algorithm. 2. List the types of asymptotic notations in analysing complexity of algorithms. Asymptotic Notation is used to describe the running time of an algorithm - how much time an algorithm takes with a given input, n. There are three different notations: big O, big Theta (Θ), and big Omega (Ω). 3. Outline the directed graph with an example. A directed graph (or digraph) is a set of nodes connected by edges, where the edges have a direction associated with them. For example, an arc (x, y) is considered to be directed from x to y, and the arc (y, x) is the inverted link. Y is a direct successor of x, and x is a direct predecessor of y. 4. What is minimum spanning tree? A minimum spanning tree (MST) or minimum weight spanning tree is a subset of the edges of a connected, edge-weighted undirected graph that connects all the vertices together, without any cycles and with the minimum possible total edge weight. 5. Outline the divide and conquer algorithm design paradigm Divide and Conquer is an algorithm design paradigm that involves breaking up a larger problem into non- overlapping sub-problems, solving each of these sub-problems, and combining the results to solve the original problems. 6. Define a multistage graph. A Multistage graph is a directed, weighted graph in which the nodes can be divided into a set of stages such that all edges are from a stage to next stage only (In other words there is no edge between vertices of same stage and from a vertex of current stage to previous stage). 7. What is backtracking? Backtracking is an algorithmic technique whose goal is to use brute force to find all solutions to a problem. It entails gradually compiling a set of all possible solutions. Because a problem will have constraints, solutions that do not meet them will be removed. 8. State the travelling salesman problem. The travelling salesman problem is a graph computational problem where the salesman needs to visit all cities (represented using nodes in a graph) in a list just once and the distances (represented using edges in the graph) between all these cities are known. The solution that is needed to be found for this problem is the shortest possible route in which the salesman visits all the cities and returns to the origin city. 9. Outline the difference between tractable problem and an intractable problem. Tractable Problem: a problem that is solvable by a polynomial-time algorithm. The upper bound is polynomial. Intractable Problem: a problem that cannot be solved by a polynomial-time al- gorithm. 10. State the bin packing problem. The bin packing problem is an optimization problem, in which items of different sizes must be packed into a finite number of bins or containers, each of a fixed given capacity, in a way that minimizes the number of bins used. 11.a. Write an algorithm to perform linear search on a array of ‘N’ numbers. Illustrate the best case, average case and worst case complexity of the linear search with an example. Definition of Linear Search Algorithm Analysis with explanation Example 11.b. What is pattern searching? Outline the steps in the Rabin-Karp algorithm for pattern searching with an example. Definition Algorithm Analysis with explanation Example 12.a. Outline the BFS graph traversal algorithm and DFS graph traversal algorithm with an example Definition of BFS & DFS Algorithm Analysis with explanation Example 12.b. Explain Dijkstra’s shortest path algorithm with an example. Definition Algorithm Analysis with explanation Example 13.a. Outline the merge sort algorithm with an example Definition Algorithm Analysis with explanation Example 13.b What is a Huffman tree? Outline the steps to build a Huffman tree using greedy algorithm design paradigm with an example. Definition Algorithm Analysis with explanation Example 14.a. State the Hamiltonian circuit problem. Outline the steps to find to find the Hamiltonian circuit using backtracking algorithm design paradigm with an example. Definition Algorithm Analysis with explanation Example 14.b. State the Knapsack problem. Outline how Knapsaack problem can be solved using branch and bound algorithm design paradigm with an example. Definition Algorithm Analysis with explanation Example 15.a. Elaborate NP-Complete problem and NP- Hard problem with an example. Definition Algorithm Analysis with explanation Example 15.b. Outline the randomized quick sort algorithm with an example. Definition Algorithm Analysis with explanation Example 16.a. Apply the insertion sort algorithm to sort the following sequence of n numbers stored in an array A. 15,9,1,22,26,19,55,43,99,2. Illustrate each step of the sorting process. Definition Algorithm Analysis with explanation Example 16.b. What is dynamic programming? Explain the dynamic programming solution for matrix chain multiplication with an example. Definition Algorithm Analysis with explanation Example