Sei sulla pagina 1di 4

Nov/Dec 2006

Part-A

1. What is an algorithm design technique?


It is the general approaches to Solving problems algorithmicly,applicable to a variety of problems
from different areas of computing

1. General design techniques are:


2. Brute force
3. Divide and Conquer
4. Decrease and Conquer
5. Transform and Conquer
6. Greedy Technique
7. Dynamic Programming
8. Backtracking
9. Branch and Bound
2. Compare the order of the growth n! and 2n
Lim n!/2
n->∞

3.what is the tool for analyzing the time efficiency of a non recursive algorithm?
 Set up a sum expressing the number of times the algorithm’s basic operation is
executed.
 Standard formulas and rules of sum manipulation,finds either closed form
formula for the count or at least its order of growth..
4.What is algorithm animation?
It is dyanamic algorithm visualization.It shows a continous movie like presentation of an
algorithm’s operations.
5.Compare DFS and BFS

6.Find the number of comparisions made by the sequential search in the worst case and best case
Input size-number of elements=n
Basic operation-key comparision A[i]==k
The number of comparision is same for all arrays of size n,represented as:
Sworst(n)=n€‫ﻂ‬
7.How efficient is prim’s algorithm?
If prism’s algorithm is implemented using adjacency matrix,list then the time complexity is
O(|V2|),O(E log2 V) where V is the total number of vertices in a graph and E is the total
number of edges.the same can be implemented with queue representation also.

8.what do you mean by Huffman code?


It is an optimal prefix-tree variable length encoding scheme that assigns
Bit strings to characters based on their frequencies in a given text.This is accomplished by a greedy
Construction of a binary tree whose leaves represent the alphabet characters and whose edge are l
Labeled with 0’s and 1’s.

9.what is state space tree


A rooted tree whose nodes represent partially constructed solutions to the problem in question.It
Terminates a node as soon as it can be guaranteed that no solution to the problem can be obtained
By considering choices that correspond to the node’s descendants.

10.what are the additional items required for branch and bound compare backtracking technique?
Backtracking:
(i) Traced using depth first search.
(ii) Decision problems can be solved.
(iii) If dead end is reached during solution then backtracking and try another solution.
(iv) Example:
 Knapsack
 Sum of subset

Branch and Bound:


(i) Traced using DFS and BFS .
(ii) Optimization problems can be solved.
(iii) Search is based on bounding values (upper bound or lower bound is computed
additionally.
(iv) Example
 Job sequencing
 TSP
MAY/JUNE 2007
1. Define an algorithm.
An algorithm is a sequence of unambiguous instructions for solving a problem that is for
obtaining a required output for any legitimate input in a finite amount of time.

2. Order of an algorithm.
Measuring the performance of an algorithm in relation with the input size n is known as order
of growth.
3. Define loop.
In a graph representation edges connecting vertices to themselves is called loop.

G= (V, E) - directed graph


A-c-b-a - loop representation
4. Recursive call.
Recursive algorithm makes more than a single call to itself is known as recursive call.

5. Objectives of sorting algorithm.


(i) Stable – relative order property has to be maintained.
(ii) In place – does not require any extra memory space
(iii) Suitable for applications such as entries in telephone books, dictionaries in alphabetical
order and search operation(when input is sorted, search is efficient)
6. Bubble sort.
In the bubble sort method, each pass the largest element from the unsorted list is bubbled
up to the last position. Here it is named as bubble sort.
7. AVL tree.
An AVL tree is a binary search tree in which the balance factor of every node, which is
defined as the difference between the heights of the node’s left and right subtrees, is
either 0 or +1 or -1.
8. Minimum cost spanning tree.
In a weighted graph G= (V, E, W) the weight of a sub graph t= (V, E) is the sum pf the
weights of the edges in the sub graph, if t is a tree. A MST for a weighted graph is a
spanning tree with minimum weight.
9. Optimal solution.
It is a feasible solution with the best value of the objective function.
10. Row major and column major.
It describe methods for storing multidimensional array in linear memory.
In row_major storage, a multidimensional array in linear memory is accessed such that rows
are stored one after the other. When using row_major order, the difference b/w addresses
of array cells in increasing rows is larger than addresses of cells in increasing columns.for
ex, consider this 2 X 3 arrays.
1 2 3
4 5 6
would find the array laid-out in linear memory as
1 2 3 4 5 6
Column-major order is a similar method of flattening array onto linear memory, but the column are
listed in sequence.
The array
1 2 3
4 5 6
If sorted in linear memory with column-major order would look like the following:
1 4 2 5 3 6

With columns listed first.

NOV/DEC 2007
Part-A
1. Stepwise Refinement
In topdown design methodology the problem is solved in sequence (step by
step) is known as stepwise refinement.

2. Efficiency of an algorithm.
(i)Time efficiency-indicates how fast the algorithm runs.
(ii) Space efficiency-deals with the extra space it requires.
3. Smoothness rule.
Let T(n) be an eventually non decreasing function and f(n) be a smooth
function .If T(n) €Θ(f(n)) for values of n that are powers of b, where b>=2 then T(n)
€Θ(f(n)).
4. Algorithm visualization.
It is the use of images to convey useful information about aig.The variation
are:
(i) Static algorithm visualization.
(ii) Dynamic algorithm visualization.
5. Time complexity of bubble sort algorithm.
C(n)=∑

6. Drawbacks of binary search algorithm are:


(i) Input should be in sorted order

Potrebbero piacerti anche