This document provides information about getting fully solved assignments for the 4th semester MCA program. It includes the subject code and name (MCA4040 - Analysis and Design of Algorithms), credit hours (4), and marks (60). Students are instructed to send their semester and specialization details to help.mbaassignments@gmail.com or call 08263069601 to receive solved assignments. The document includes 6 questions related to algorithm properties, sequential search, topological sort with example, Boyer-Moore algorithm, knapsack problem using memory functions, and variable length encoding and Huffman encoding.
Solid waste management & Types of Basic civil Engineering notes by DJ Sir.pptx
Mit203 analysis and design of algorithms
1. Dear students get fully solved assignments
Send your semester & Specialization name to our mail id :
help.mbaassignments@gmail.com
or
call us at : 08263069601
ASSIGNMENT
PROGRAM MCA(REVISED FALL 2012)
SEMESTER FOURTH
SUBJECT CODE & NAME MCA4040- ANALYSIS AND DESIGN OF ALGORITHM
CREDIT 4
BK ID B1480
MARKS 60
Answer all questions
Q1 . List and explain the properties of Algorithms.
Answer: Data structure - Define an algorithm.What are the propertiesof an algorithm? - Feb 27,
2010, 11:15 am by RajmeetGhai
Define analgorithm.Whatare the propertiesof analgorithm?Whatare the typesof algorithms?
An algorithmisaseriesof stepsor methodologyto solve aproblem.
Propertiesof analgorithm:-
It iswritteninsimple English.
Q2. Write a note on sequential search.
Answer: When data items are stored in a collection such as a list, we say that they have a linear or
sequentialrelationship.Each data item is stored in a position relative to the others. In Python lists,
these relative positions are the index values of the individual items. Since these index values are
ordered,itis possible for us to visit them in sequence. This process gives rise to our first searching
technique, the sequential search.
2. Q3. Explain topological sort with an 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
verticesof the graphmay representtaskstobe performed,andthe edgesmayrepresentconstraints
that one task mustbe performedbefore 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 graph (DAG). Any DAG has at least one topological
ordering, and algorithms are known for constructing a
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
beingsearchedfor(the pattern),butnotthe stringbeingsearchedin(the text).Itisthuswell-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
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
capacityc. The problemasksfora subsetof itemswhose total weightdoesnot exceed the knapsack
capacity, and whose profit is a maximum. It can be formulated as the following Integer Linear
Program (ILP):
(KP)max∑j∈Npjxj(1)
∑j∈Nwjxj≤c(2)
xj∈{0,1},j∈N.(3)
Each variable xj takes value 1 if and only if item j is
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
3. compressed and decompressed with zero error (lossless data compression) and still be read back
symbol by symbol.Withthe rightcodingstrategyan independentandidentically-distributed source
may be compressedalmost arbitrarily close to its entropy. This is in contrast to fixed length coding
methods,forwhichdatacompressionisonlypossible 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.Some examples of well-known variable-length coding
strategies are Huffman coding, Lempel–Ziv coding and
Dear students get fully solved assignments
Send your semester & Specialization name to our mail id :
help.mbaassignments@gmail.com
or
call us at : 08263069601