Ss Zg519 Ec-3r First Sem 2013-2014

2
Birla Institute of Technology & Science, Pilani Work-Integrated Learning Programmes Division First Semester 2013-2014 Comprehensive Examination (EC-3 Regular) Course No. : SS ZG519 Course Title : DATA STRUCTURE AND ALGORITHMS DESIGN Nature of Exam : Open Book Weightage : 50% Duration : 3 Hours Date of Exam : 09/11/2013 (FN) Note: 1. Please follow all the Instructions to Candidates given on the cover page of the answer book. 2. All parts of a question should be answered consecutively. Each answer should start from a fresh page. 3. Assumptions made if any, should be stated clearly at the beginning of your answer. Q.1. For the following scenarios, describe briefly the nature and behavior of data; and suggest the most appropriate data structure(s) with relevant justification. (a) A cycle renting firm in city allows for any of its subscribers to hire a cycle from any of its designated outlets. The rent is calculated based on lending time and returning time. To promote regular customers, those who lent and return during the same time slot on all weekdays/weekends is provided a special x% discount. Also, there is a special y% discount to those users who pick a cycle that was not used during the last 12 hours. The objective is to come up with an appropriate accounting software for the firm. (b) To catch stolen vehicles, the traffic police have devised a system to identify vehicle number of all the vehicles passing through every junction in the district. The number identified then needs to be compared with the list of stolen vehicles reported. The objective is to derive an efficient approach to assist the traffic police to trace the lost vehicles. [Note: Provide only data structures to be used. No algorithm should be written for this question.] [5 + 5 = 10] Q.2. Consider the problem defined as follows: Data entry operators are paid on the basis of the correctness of the entries they make. For every correct entry they make, they are paid Rs. 100/-. If they miss an entry, they are penalized with Rs. 50. If they enter the wrong value, they are penalized with Rs. 200/-. Given the list of numbers entered by an operator and the actual list of values, compute the payment due to an operator. (a) To which complexity class does this problem belong to? (b) By using Dynamic Programming (c) By using any greedy method (d) Argue whether or not the algorithms suggested by you in the preceding parts provide optimum measure for any input instance. [2+ 6 + 6 + 6 =20] SS ZG519 (EC-3 Regular) First Semester 2013-2014 Page 1 of 2 No. of Pages = 2 No. of Questions = 4

description

BITS MTech Question Paper

Transcript of Ss Zg519 Ec-3r First Sem 2013-2014

  • Birla Institute of Technology & Science, PilaniWork-Integrated Learning Programmes Division

    First Semester 2013-2014

    Comprehensive Examination (EC-3 Regular)

    Course No. : SS ZG519 Course Title : DATA STRUCTURE AND ALGORITHMS DESIGN Nature of Exam : Open Book Weightage : 50% Duration : 3 Hours Date of Exam : 09/11/2013 (FN) Note: 1. Please follow all the Instructions to Candidates given on the cover page of the answer book.2. All parts of a question should be answered consecutively. Each answer should start from a fresh page. 3. Assumptions made if any, should be stated clearly at the beginning of your answer.

    Q.1. For the following scenarios, describe briefly the nature and behavior of data; and suggest the most appropriate data structure(s) with relevant justification.

    (a) A cycle renting firm in city allows for any of its subscribers to hire a cycle from any of its designated outlets. The rent is calculated based on lending time and returning time. To promote regular customers, those who lent and return during the same time slot on all weekdays/weekends is provided a special x% discount. Also, there is a special y% discount to those users who pick a cycle that was not used during the last 12 hours. The objective is to come up with an appropriate accounting software for the firm.

    (b) To catch stolen vehicles, the traffic police have devised a system to identify vehicle number of all the vehicles passing through every junction in the district. The number identified then needs to be compared with the list of stolen vehicles reported. The objective is to derive an efficient approach to assist the traffic police to trace the lost vehicles.

    [Note: Provide only data structures to be used. No algorithm should be written for this question.] [5 + 5 = 10]

    Q.2. Consider the problem defined as follows:Data entry operators are paid on the basis of the correctness of the entries they make. For every correct entry they make, they are paid Rs. 100/-. If they miss an entry, they are penalized with Rs. 50. If they enter the wrong value, they are penalized with Rs. 200/-. Given the list of numbers entered by an operator and the actual list of values, compute the payment due to an operator.

    (a) To which complexity class does this problem belong to?(b) By using Dynamic Programming (c) By using any greedy method(d) Argue whether or not the algorithms suggested by you in the preceding parts

    provide optimum measure for any input instance. [2+ 6 + 6 + 6 =20]

    SS ZG519 (EC-3 Regular) First Semester 2013-2014 Page 1 of 2

    No. of Pages = 2No. of Questions = 4

  • SS ZG519 (EC-3 Regular) First Semester 2013-2014 Page 2

    Q.3. An n-dimensional tic-tac-toe game involves an n x n table in which the two opposing players may either put a cross or a circle. The winning criteria is to have a row or a column or one of the 2 main diagonals filled with exactly n symbols of the same kind. The first player in the game can only put circles, while the second player can only put crosses.

    (a) Given an intermediate configuration of the game (the table with crosses and circles, and a number indicating the next player to make a move), write a backtracking algorithm to determine the number of moves that are atleast required to make a player p win the game.

    (b) Argue whether or not the solution reached is the best solution available. [6 + 2 = 8]

    Q.4. Prove that the following problem is NP-Hard.Government of India decided to start a new international airport in the city of Ludhiana that contains k runways. At any given point of time, only one plane can land or take off from a runway. The airport is legally bound to accommodate N services for the various airlines. The task for the management is to assign suitable schedule for the various flights such that no flights shall land or take off from the same runway at the same time. [12]

    ************

    SS ZG519 (EC-3 Regular) First Semester 2013-2014 Page 2 of 2

    No. of Questions = 4