Professional Documents
Culture Documents
www.smuassignment.in
online store
or
computeroperator4@gmail.com
Charges rs 125/subject
SEMESTER - 2
Answer: Answer:
The steps involved in analyzing the efficiency of non-recursive algorithms are as follows:
Decide the input size based on the constraint n
Identify the
2 Define selection sort and explain how to implement the selection sort? 3+7=10
Answer:
Definition: Selection sort is one of the simplest and performance oriented sorting techniques
that work well for small files. It has time complexity as O(n2) which is unproductive on large
lists.
Answer: Topological sort is done using a directed acyclic graph (DAG), which is a linear
ordering of all vertices G= (V, E) is an ordering of all vertices such that if G contains an edge (u,
v), then u appears before v in the ordering. A topological sort of a particular graph can be looked
upon as a horizontal line where all directed edges travel from left to right. Thus, topological sort
differs from the
This shift helps in shifting a matched part of the pattern, and is denoted by Q. Good suffix shift
Q is applied after 0 < k < m characters are matched.
Q = distance
Item 1 2 3 4
Weight 2 6 4 8
Knapsack capacity is given as W=12. Analyze the Knapsack problem using memory
functions with the help of the values given above. 10
Answer:
Knapsack Problem by Memory Functions
I 0 1 23 4 5 6 7 8 9 10
Answer:
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
www.smuassignment.in
online store
or
computeroperator4@gmail.com
Charges rs 125/subject