Data Structure and Algorithms (MTE 2151)
Data Structure and Algorithms (MTE 2151)
Data Structure and Algorithms (MTE 2151)
Q5. Write the algorithm/ pseudo code for Insertion sort. Compare and contrast it with Bubble
sort. (3)
Q6. The field of Bioinformatics uses searching algorithms to look for structural patterns in
protein DNA. For example in the structure ‘ATGACGATAAAGGCACGGC’ the pattern ‘AAA’
has to be searched for. Could you suggest how this can be done using the Horspool algorithm?
(3)
Q7. The following is a news snipped from the InfoSecurity magazine. According to the article,
what is the main strategy for hacking the passwords of the GitHub users? Explain by using an
example.
GitHub resets passwords after mass-scale Brute force attack (22nd November 2013)
As a result, the company is telling users that it's now requiring them to be more responsible in
their password choices. (3)
Q8. How is the problem of collision/ spurious hits resolved in the Rabin Karp algorithm used for
text processing? (3)
Q9. Using the following search tree, perform the searches indicated below from S to G. Each
node shows both the total path cost to the node and heuristic value for the corresponding node.
(7)
For each of the searches below, write the sequence of nodes expanded by the searches.
Specify a node by writing the name of the state and the length of the path (C above), e.g. S0, B3
etc.
Assume that the children nodes are expanded in alphabetical order.
a) Assume you want to retire after doing the least number of different jobs. Of all the basic
search algorithms you learned about which one should you apply to the graph in order to find a
path, with the least search effort, that has the minimum number of nodes from M to R? Draw
the tree and give the path. (3)
b) Now you are interested in finding a path and the associated distance. Due to Space Constraints
you can store total cost information of only two nodes. As before, you are looking for a path
from M to R. Draw the tree and give the path.
(3)
Q11. Illustrate the supremacy of A* Search Technique over Greedy Search Techniques. Explain,
Admissibility and Consistency of Heuristics. (5)
Q12. Construct the search tree for the graph above, indicate the path length to each node. The
numbers shown above are link lengths. Pay careful attention to the arrows; some are bi-
directional (shown thick) while some are uni-directional. (7)
Choose the most efficient search method that meets the criteria indicated below. Explain your
choice.
a) You are given a state graph with link costs. The running time of the algorithm should be a
function of the number of states in the graph and the algorithm should guarantee that the path
with shortest path cost is found.
b) You are given a state graph with link costs and consistent heuristic values on the states. The
running time of the algorithm should be a function of the number of states in the graph and the
algorithm should guarantee that the path with shortest path cost is found.