MCA4040 - ANALYSIS AND DESIGN OF ALGORITHM

Dear students get fully solved assignments
Send your semester & Specialization name to our mail id :
help.mbaassignments@gmail.com
or
call us at : 08263069601


[ SUMMER 2015 ] ASSIGNMENT

PROGRAM
MCA(REVISED FALL 2012)
SEMESTER
4
SUBJECT CODE & NAME
MCA4040- ANALYSIS AND DESIGN OF ALGORITHM
CREDIT
4
BK ID
B1480
MARKS
60


Answer all questions
Q. 1. Write the steps involved in analyzing the efficiency of non-recursive algorithms.

Answer:The study of algorithms is called algorithmics. It is more than a branch of computer science. It is the core of computer science and is said to be relevant to most of science, business and technology. An algorithm is a sequence of unambiguous instructions for solving a problem, i.e., for obtaining a required output for any legitimate input in finite amount of time.

The three algorithms used to find the gcd of two numbers are

·         Euclid’s algorithm
·         Consecutive integer




Q. 2. Define selection sort and explain how to implement the selection sort?

Answer:In computer science, selection sort is a sorting algorithm, specifically an in-place comparison sort. It has O(n2) time complexity, making it inefficient on large lists, and generally performs worse than the similar insertion sort. Selection sort is noted for its simplicity, and it has performance advantages over more complicated algorithms in certain situations, particularly where auxiliary memory is limited.

The algorithm divides the input list into two parts: the sublist of items already sorted, which is built up from left to right at the front (left) of the list, and







Q. 3. Define Topological sort. And explain with example.

Answer:In computer science, a topological sort (sometimes abbreviated topsort or toposort) or topological ordering of a directed graph is a linear ordering of its vertices such that for every directed edge uv from vertex u to vertex v, u comes before v in the ordering. For instance, the vertices of the graph may represent tasks to be performed, and the edges may represent constraints that one task must be performed before another; in this application, a topological ordering is just a valid sequence for the tasks. A topological ordering is possible if and only if the graph has no directed cycles, that is, if it is a directed acyclic




Q. 4. Explain good-suffix and bad-character shift in Boyer-Moore algorithm.

Answer:In computer science, the Boyer–Moore string search algorithm is an efficient string searching algorithm that is the standard benchmark for practical string search literature. It was developed by Robert S. Boyer and J Strother Moore in 1977. The algorithm preprocesses the string being searched for (the pattern), but not the string being searched in (the text). It is thus well-suited for applications in which the pattern is much shorter than the text or where it persists across multiple searches. The Boyer-Moore algorithm uses information gathered during the preprocess step to skip sections of the text, resulting in a lower constant factor than many other string algorithms. In general, the algorithm runs faster




Q. 5. Solve the Knapsack problem using memory functions.
Item 1 2 3 4
Weight 2 6 4 8
Value (in Rs.) 12 16 30 40
Knapsack capacity is given as W=12. Analyze the Knapsack problem using memory functions with the help of the values given above.

Answer:The classical Knapsack Problem (KP) can be described as follows. We are given a set N={1,…,n} of items, each of them with positive profit pj and positive weight wj, and a knapsack capacity c. The problem asks for a subset of items whose total weight does not exceed the knapsack capacity, and whose profit is a maximum. It can be formulated as the following Integer Linear Program (ILP):
(KP)max∑jNpjxj(1)




Q. 6. Describe Variable Length Encoding and Huffman Encoding.

Answer:Variable Length Encoding:In coding theory a variable-length code is a code which maps source symbols to a variable number of bits.Variable-length codes can allow sources to be compressed and decompressed with zero error (lossless data compression) and still be read back symbol by symbol. With the right coding strategy an independent and identically-distributed source may be compressed almost arbitrarily close to its entropy. This is in contrast to fixed length coding methods, for which data compression is only possible for large blocks of data, and any compression beyond the logarithm of the total number of possibilities comes with a finite (though perhaps arbitrarily small) probability of failure.

Dear students get fully solved assignments
Send your semester & Specialization name to our mail id :
help.mbaassignments@gmail.com
or
call us at : 08263069601


No comments:

Post a Comment

Note: Only a member of this blog may post a comment.