Dsecl Zg519-Ec3r-1 PDF
Dsecl Zg519-Ec3r-1 PDF
Dsecl Zg519-Ec3r-1 PDF
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.
Answer All the Questions (Only in the pages mentioned against questions. If you need more
pages. Continue remaining answers from page 16 onwards, we have provided extra space at
each question)
Fig-1
Q.4. Question based on fig:2, For the given Graph G. Using Floyd-Warshall algorithm
compute the shortest-path weights matrix D(k).
Fig-2
Q.5. Question based on fig:3, For the given graph G, find the shortest path from the node A
to all other nodes.
Fig-3
(a) Assuming that quick sort simply chooses the first element as the pivot (instead of the
median of first, last, and middle), what is the arrangement of data that produces the
worst-case performance in quick sort? (that is, if you were the attacker trying to sabotage
the system, what data would you have to send?)
(b) Suggest a simple strategy (hopefully requiring no more than linear time) to avoid the
problem. That is, a strategy to guarantee that quick sort will run in O(n log n) most of
the time, regardless of input data, even if this input data is maliciously created. Notice
that in the context of this question, you’re not allowed to change the way quick sort
selects the pivot (in fact, you will hopefully suggest a strategy that works regardless of
how quick sort selects the pivot).
Q.7. Question based on fig-4, List the nodes of the tree below in preorder,
postorder, and breadth-first order.
Fig-4.
Q.8. There are four pages. Page A contains a link to page B, a link to page C, and a link to
page D. Page B contains one single link to page D. Page C points to pages A and D, and
page D points to pages A and C. Using page rank algorithm find the page rank. [ Hint:
the page are initial ranked 1, use the standard damping factor, find page rank till 5
iteration]
Q.9. Construct K-D tree for the following data (3,6), (17,15), (13,15), (6,12), (9,1), (2,7),
(10,19).