186 views

Uploaded by Pritom Rajkhowa

- Graph Terminology
- 07972276.pdf
- 10.1.1.111
- Shortest Path
- intro_graphs(2).pdf
- 8_restrictedshortestparth
- Finding the Strongest Path between Two Cities by using Mathematical Model
- Anaheim Traffic Optimization
- Caltech (1)
- 219 Integration2010 Proceedings
- DS Lect 24 All Pairs Shortest Path Problem
- Cycle Detection in Directed Graph
- 04greedy-mod-1 (2)
- Path Related n-Cap Cordial Graphs
- DAA(CSE311)_Course__Handout_.doc
- Bipartite graphs as Models of Complex Networks
- IC-(126)
- Building Basic Views
- robust_cs.pdf
- EulerPather Optimal Layout

You are on page 1of 2

(EC-2 Regular) Course No. Course Title Nature of Exam Weightage Duration Date of Exam Note:

1. 2. 3. 4.

: IS ZC361 : DATA STRUCTURES AND ALGORITHMS : Open Book : 60% No. of Pages =2 : 3 Hours No. of Questions = 5 : 25/10/2009 (AN)

Please follow all the Instructions to Candidates given on the cover page of the answer book. All parts of a question should be answered consecutively. Each answer should start from a fresh page. Mobile phones and computers of any kind should not be used inside the examination hall. Use of any unfair means will result in severe disciplinary action.

Q.1 (a).

Given a coin set of Rs. 1, 5, 10, 20, 50, 100, 500 and 1000. A person wishes to travel with minimum number of coins in exchange for his money (say Rs. R). Write a greedy algorithm for obtaining minimum number of coins for exchange for Rs. R. The algorithm should be written in pseudocode and should produce output as the value and number of each coin used for exchange. [6] Prove or disprove that the solution thus obtained above is optimal. Give one example to support your logic. [6]

Q.1 (b).

Q.2.

A carpenter has a piece of wood of a certain length that must be cut at positions a1, a2 ..., an where ai is the distance from the left end of the original piece of wood. Notice that after making the first cut, the carpenter now has two pieces of wood; after making the second cut, the carpenter has three pieces of wood, etc. Assume that the cost of making a cut in a piece of wood of length l is equal to l, and is the same no matter which position in that piece of wood is being cut. Let L be the length of the original piece of wood.

|______________________________|____________|________________________| ai aj an a0 2.1 Use dynamic programming to find minimum cost solution of the above problem. Describe the problem substructure. [5] Write an algorithm to find optimal sequence of cut marks for cutting the wood into n pieces. The optimality refers to the minimum cost of cutting the wood log. [7]

2.2

Page 1 of 2

Q.3.

Page 2

Q.4 (a).

Construct the adjacency list representing the above graph. [4] Use Dijkstras algorithm to find the shortest path from vertex A to vertex F. Compute the shortest path. [4] Is vertex A reachable from vertex F? Give the path. [4] Draw a figure illustrating the comparisons done by brute force pattern matching algorithm for the case when the text is aaabaadaabaaa and the pattern is aabaaa. [8] Use Knuth-Morris-Pratt pattern matching Algorithm and illustrate the pattern matching for the text and the pattern strings given in the above question. [4] [NOTE: You are not required to write any algorithm in both of the above two parts of question 4. Only illustrate the pattern matching process as asked. END NOTE]

Q.4 (b).

Q.5. Let G be a graph whose vertices are integers 1 through 8, and let the adjacent vertices be given by the table below: Vertex 1 2 3 4 5 6 7 8 5.1 5.2 5.3 Adjacent vertices 2,3,4 3,5,7,1 2,4,5 6,7,8 2,7 8 2,5,6 3

Draw G. Is the graph directed or undirected? [4] Order the vertices as they are visited in a DFS (Depth First Traversal) traversal starting at vertex 1. [4] Order the vertices as they are visited in a BFS (Breadth First Traversal) traversal starting at vertex 1. [4] ******** Page 2 of 2

- Graph TerminologyUploaded byJunaid khan
- 07972276.pdfUploaded bypramukh shankar
- 10.1.1.111Uploaded bybifteki1
- Shortest PathUploaded byMeisam Bagheri
- intro_graphs(2).pdfUploaded byevan d
- 8_restrictedshortestparthUploaded bytantrungluong
- Finding the Strongest Path between Two Cities by using Mathematical ModelUploaded byJASH MATHEW
- Anaheim Traffic OptimizationUploaded byJasmeet Singh
- Caltech (1)Uploaded byDelmwin Baeka
- 219 Integration2010 ProceedingsUploaded byKhirulnizam Abd Rahman
- DS Lect 24 All Pairs Shortest Path ProblemUploaded byzachaboi
- Cycle Detection in Directed GraphUploaded byShubham Gupta
- 04greedy-mod-1 (2)Uploaded byMadhu Meghana
- Path Related n-Cap Cordial GraphsUploaded byIoan Degau
- DAA(CSE311)_Course__Handout_.docUploaded byLiNu
- Bipartite graphs as Models of Complex NetworksUploaded byComplexNetworks
- IC-(126)Uploaded bySam
- Building Basic ViewsUploaded byraviskumar2005
- robust_cs.pdfUploaded byPero Peric
- EulerPather Optimal LayoutUploaded byAbhimanyu Yadav
- Decision MathsUploaded byGobi Krishnaa
- input9Uploaded byvikas_ojha54706
- Mock ExamUploaded byGoma Bluse
- QueryByTrace VDB00Uploaded byaptureinc
- 10(1)Uploaded byArnav Guddu
- 235 - GraphsUploaded bymorganmc16
- 10.1.1.25.483Uploaded byJiang Long
- Gate 2012 Solutions Cs It Set dUploaded byBalmukund Singh
- IJET-V3I4P13Uploaded byInternational Journal of Engineering and Techniques
- Trivial Fuzzy Topology of the Set of Fuzzy GraphsUploaded byInternational Journal of Innovative Science and Research Technology

- CS6010 - SOCIAL NETWORK ANALYSISUploaded bySanthosh Kumar
- PC Shifting GraphsUploaded byHector R.
- II-I cse syllabusUploaded byKoti Gaddam
- INTERPRETING THE SEMANTICS OF ANOMALIES BASED ON MUTUAL INFORMATION IN LINKMININGUploaded byMaurice Lee
- Design and Analysis of AlgorithmsUploaded bytierSarge
- Graphs Lect5Uploaded bypurijatin
- 14cs10011Uploaded byArijit Panigrahy
- DiracUploaded byMaria Kusuma
- Algo Mcq CompiledUploaded bysny2ksa
- bok%3A978-1-4614-6446-4.pdfUploaded byElioth Sanabria
- sa11ma-2_07Uploaded bysukuthambi
- s_finsolUploaded bySachin Michu
- b.c.a.i II IIIUploaded byswatiwarokar
- MCA_2015.pdfUploaded byGagan Bansal
- Design and Analysis of Algorithms 2 Marks and 16 MarksUploaded bymiraclesuresh
- NWBTool ManualUploaded byAstrid Elisabet Adelgren
- nug26Uploaded byDominic Giambra
- Mathematics Trial SPM 2015 P2 Bahagian BUploaded byPauling Chia
- acsl 16-17 contest 4 notes - graph theory de assemblyUploaded byapi-328824013
- Let's Draw a Graph: An Introduction with GraphvizUploaded byGio
- Douglas West Solution 1.2Uploaded byGanesh Sutar
- Brute ForceUploaded byAarthi Vishwanathan
- AlgoUploaded bysamj1912
- Edge Regular Property of Alpha Product, Beta Product and Gamma Product of Two Fuzzy GraphsUploaded byIOSRjournal
- BookChapter_11 good one.pdfUploaded byjyothimonc
- Leblanc 111Uploaded byCricketRajesh
- Computation of Shortest Path Problem in a Network with SV-Trapezoidal Neutrosophic NumbersUploaded byAnonymous 0U9j6BLllB
- Grupos Soficos. Szoke Nora GabriellaUploaded byMagdalena Hernandez
- The Hitchhiker’s Guide to the Programming ContestsUploaded bydpiklu
- BOOK Barabasi 02 Linked the New Science of NetworksUploaded byviewhacker