Dear
students get fully solved assignments
Send
your semester & Specialization name to our mail id :
“
help.mbaassignments@gmail.com ”
or
Call
us at : 08263069601
(Prefer
mailing. Call in emergency )
ASSIGNMENT
PROGRAM
|
BSc IT
|
SEMESTER
|
FOURTH
|
SUBJECT CODE & NAME
|
BT0080,Fundamental of Algorithms
|
CREDIT
|
4
|
BK ID
|
B1092
|
MAX. MARKS
|
60
|
Q.1 Define and explain
recursion with the help of an example.
Answer: - A recursive definition of a function defines values of the
functions for some inputs in terms of the values of the same function for other
inputs. For example, the factorial function n!.
Recursion has also been described more simply as the ability to place
one component inside another component of the same kind. A function that calls
itself is known as recursive function and this technique is known as recursion
in C programming.
A linguistic element or
grammatical structure that can be used repeatedly in sequence is said to be
recursive.
Q.2 State the concept of
divide and conquer strategy with the help of an example.
Answer: - Divide and conquer (D&C) is an algorithm design paradigm based
on multi-branched recursion. A divide and conquer algorithm works by
recursively breaking down a problem into two or more sub-problems of the same
(or related) type, until these become simple enough to be solved directly. The
solutions to the sub-problems are then combined to give a solution to the
original problem.
This technique is the basis of efficient algorithms for all kinds of
problems, such as sorting (e.g., quicksort, merge sort), multiplying large
numbers (e.g. Karatsuba), syntactic analysis (e.g., top-down parsers), and
computing the discrete Fourier
Q.3 Explain knapsack
problem. Write algorithm for it.
Answer: - The knapsack problem or rucksack problem is a problem in
combinatorial optimization: Given a set of items, each with a mass and a value,
determine the number of each item to include in a collection so that the total
weight is less than or equal to a given limit and the total value is as large
as possible. It derives its name from the problem faced by someone who is
constrained by a fixed-size knapsack and must fill it with the most valuable
items.
The problem often arises in resource allocation where there are
financial constraints and is studied in fields such as combinatorics, computer
science, complexity theory, cryptography and applied mathematics.
Q.4 Explain trees and sub
graphs with examples.
Answer:-Tree: - A tree is a connected graph without any cycles, or a tree is a
connected acyclic graph. The edges of a tree are called branches. It follows
immediately from the definition that a tree has to be a simple graph (because
self-loops and parallel edges both form cycles). Figure 4.1(a) displays all
treewith fewer than six vertices.
An AVL tree is another balanced binary search
Q.5 Define and explain
Hamiltonian circuit and path.
Answer: - A graph that contains a Hamiltonian cycle is called a Hamiltonian
graph. Similar notions may be defined for directed graphs, where each edge
(arc) of a path or cycle can only be traced in a single direction (i.e., the
vertices are connected with arrows and the edges traced
"tail-to-head").
Hamiltonian path: - a Hamiltonian path (or traceable path) is a path in an
undirected or directed graph that visits each vertex exactly once. A
Hamiltonian cycle (or Hamiltonian circuit) is a Hamiltonian path that is a
cycle. Determining whether such paths and cycles exist in graphs is the
Hamiltonian path problem, which is NP-complete.
Q.6 (1) Show that the
Clique problem is an NP-Complete problem.
Answer: - Clique Problem is an NP-Complete
problem: - The clique problem refers to any of the problems related to
finding particular complete sub graphs ("cliques") in a graph, i.e.,
sets of elements where each pair of elements is connected.
For example, the maximum clique problem arises in the following
real-world setting. Consider a social network, where the graph’s vertices
represent people, and the graph’s edges represent mutual acquaintance. To find
a largest subset of people who all know each other, one can systematically
inspect all subsets, a process that is too time-consuming to be practical for
social networks comprising more than a few dozen people. Although this brute-
2. Show that the Vertex
cover problem is NP-Complete.
Answer:-Vertex cover
problem is an NP-Complete:- a vertex cover
(sometimes node cover) of a graph is a set of vertices such that each edge of
the graph is incident to at least one vertex of the set. The problem of finding
a minimum vertex cover is a classical optimization problem in computer science
and is a typical example of an NP-hard optimization problem that has an
approximation algorithm. Its decision version, the vertex cover problem, was
one of Karp's 21 NP-complete problems and is therefore a classical NP-complete
problem in computational complexity theory. Furthermore, the vertex cover
problem is fixed-parameter tractable and a central problem in
Dear
students get fully solved assignments
Send
your semester & Specialization name to our mail id :
“
help.mbaassignments@gmail.com ”
or
Call
us at : 08263069601
(Prefer
mailing. Call in emergency )
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.