Anda di halaman 1dari 4

# FIFTH SEMESTER CS307 DESIGN AND ANALYSIS OF ALGORITHMSONLINE

QUESTION BANK
1.Differentiate between Binary and Binary Search Tree.2.Is 2n+1=O(2n)?3.What is the w
orst case running time of Quick Sort?4.What is the worst case running time of algorithm t
o delete each element from the linked list?5.Which is more efficient of BFS and DFS?
6.What are maximum and minimum number of elements in a heap of height h?7.Where i
n a heap might the smallest element reside?8.Differentiate between NP Hard and NP Co
mplete .9.What is time complexity ?10.What is space complexity?11.Give brief concept o
f Divide and conquer.12.Write an algorithm to sort an array containing 0's and 1's with co
mplexity of order of n .13.What is recursion?What are its drawbacks?14.The order of co
mplexity of Binary Search in Best case is in the average case is in the worst case is 15.If
W= MNOP,list all substrings of W.16.Define the term Divide and Conquer.17.How does
heap Sort work?18.Explain the backtracking Problem with 4 Queens on a 4*4 chess boar
d.19.Define non deterministic algorithm.20.Write an algorithm that will traverse a binary
tree level by level. That is root is visited first then the intermediate children of root then g
rand children of root and so on.21.What are the advantages of dynamic programming ove
r greedy method?22.What are the various techniques for design of various algorithms?
23.How the time and space complexities measured for an algorithm?24.What is the order
of Bubble Sort?25.What are the conditions under which backtracking can be used?
26.What is Optimal Merge Pattern Problem?27.What is algorithm for in order traversal?
28.What is solution space in Backtracking Techniques ?29.How will Merge Sort sort the
6 numbers:40, 10, 20 , 18, 16,62. by divide and conquer technique.30.What is Binary Sea
rch Tree?31.What are various steps used in design of an algorithms?Give an example of a
lgorithm which is infinite in nature.32.What is the order of the computation for the follow
ing loop.for(i=1,i<n,i+1)for(j=1,j<n,j+1)33.Give the definition for 0/1 knapsack problem.
34.What are the various set operations possible?35.What is algorithm of Pre Order Traver
sal.36.What is NP Hard Problem?37.What is Ordering Paradigm?38.Differentiate betwee
n full and complete Binary Tree.39.Write an algorithm for insertion sort. Also give its co
mputing time.40.What is lower bound?41.What are explicit and implicit constraints?
42.What is algebraic simplification?43.How will u represent a polynomial using dense re
presentation strategy.44.Differentiate between Deterministic and Non Deterministic algor
ithms.45.What is Criterion Function ?46.Define the Principal of Optimality.47.What are
Decision Problems?48.What is Interpolation of polynomial?Short Answer Type Question
s49.Describe an algorithm to insert and delete edges in the adjacency list representation f
or an undirected graph .Remember that the edge (i,j) appears on the adjacency list for bot
h vertex i and j50.Give an algorithm to count number of leaf nodes in a Binary Tree t and
what is its computing time51.Explain basic concepts of NP hard and NP Complete probl
ems.
52.Explain the use of asymptotic notations in the analysis of algorithms53.What type of o
perations can be performed on string's .Explain at least 2 operations on strings with algor
ithms.54.Write short notes on the following:Dynamic ProgrammingBranch and Bound55.
What do you mean by Time and space complexity. Among Quick Sort,Insertion Sort ,Hea
p Sort, Which algorithm is best to sort the data and why?56.What are the disadvantages o
f Binary Search algorithm .What will be the order of complexity of a Binary Search in th
e unsuccessful case57.Here are 16 integers:22 36 6 79 26 45 75 13 31 62 27 76 33 16 62
47 .Sort them using a Quick Sort ,Insertion Sort Heap Sort,Bin Sort,treating them as a pai
r of digits in a range of 09.58.Let G be a connected and undirected graph .Write an algorit
hm to find out minimum number of edges to be added to G so that G becomes disconnect
ed .Your algorithm should output such a set of edges .What are time and space requireme
nts of your algorithm59.In the following Graph ,find out the shortest distance of all the no
des from the node A .Explain with the help of suitable algorithms.60.What is time and sp
ace complexity of “Insertion Sort”?Explain.61.Write an string processing algorithm to ide
ntify whether a particular sequence of character is in string or not. 62.What are the vario
us methods or techniques in which various algorithms can be expressed?63.What is criter
ion function in backtracking?What is solution space for backtracking problem?Explain by
taking sum of subset as a problem64.What is LC Search. How does it help in finding a s
olution for Branch and Bound Algorithm.65.Explain algorithm for evaluating a polynomi
al in coefficient exponent form.66.What is 8 Queens problem?How does backtracking hel
ps in solving it. 67.What is Greedy Method ?
Write an algorithm for knapsack problem using Greedy Method.68.What is Optimal Mer
ge Pattern problem. Merge the files (X1,X2....X5 )of length 20,30,10,5,30 respectively. A
lso represent the merge pattern using Binary Tree.69.Define Principal of Optimality. Expl
ain 0/1 knapsack problem using Dynamic Programming.70.What is evaluation and interp
olation of Polynomials. Explain by giving a suitable example71.Justify the statement “An
optimization problem can be solved in the polynomial time if and only if the correspondi
ng decision problem can.”72.Explain the Big Oh notation used in the analysis of algorith
m73.What is the computing time for the following statement{for i=1to m do for i=1 to
n do c[i,j]:= a[i,j]+ b[i,j];}74.Write an algorithm to delete an element from a linke
d list .Also mention the worst case running time for this operation.75.Explain the connect
ed and Biconnected components in Graphs.76.Explain the tree traversal techniques.77.Us
ing suitable example explain straightforward evaluation of polynomials78.Give brief con
cept of Algebraic Simplification and algebraic transformation 79.Explain the various path
traversal techniques with example.80.Define Algorithm and also explain the different crit
erion that all algorithms must satisfy.81.Explain how to validate and analyze the algorith
m . 82.Using the recursive algorithm ,explain how the tower of Hanoi problem can be sol
ved. What will be time and space complexity for the algorithms.83.Algorithm sum(a,n)
{s=0.0;for i=1 to n dos=s+a[i];return s ;}84.Explain why we use a asymptotic notation .A
lso define the following notationsBig OhOmegaTheta85.Explain an algorithm to insert 5
elements in stack and in a Queue.86.Explain the different terminologies for tree and grap
h87.Explain what do you mean by algebraic problem .Discuss various techniques for alg
ebraic problems.88.Define Prim's and Kruskal Algorithms89.Explain Traveling Salesper
son Problem90.What do you mean by dynamic programming .Explain All pairs Shortest
Path problem with example91.Solve 4 Queens Problem using Backtracking92.What is dy
namic Programming. What is Multi Stage Graph Problem93.What do you mean by sortin
g .What are various sorting Techniques .Explain any 2.94.Solve 0/1 knapsack Problem us
ing Greedy Method.95.Solve 0/1 knapsack Problem using Dynamic Programming.96.Exp
lain evaluation and interpolation with example.97.What is NP Hard and NP Complete ?
Explain with example.98.Differentiate between Deterministic and Non Deterministic Alg
orithms.99.Explain the algorithm for Quick Sort .On what input does Quick Sort exhibit i
ts worst case behavior100.What is Multi Stage Graph Problem? How does dynamic probl
em help in solving it101.Write short notes on Approximation Algorithms
Combinatorial Algorithms102)Write an algorithm to find nth minimum and maxi
mum element using divide and conquer strategy103)What is Traveling Salesperson Probl
em?.Find the solution of the following Traveling Salesperson Problem ?.Find the solution
of the following salesman problem104)calculate the number of swaps to sort the followin
g data using bubble sort5, 3, 2, 0, 4, 10, 15, 1105)give pictorial representation of each pas
s.106)What is criterion function and solution space of Backtracking? Explain and solve f
our Queen's problem using Backtracking107)Explain in detail various Set algorithms108
)What is Greedy method? Give general algorithm for it. State and write Knapsack proble
m using Greedy Method109)Give State space representation for 4 Queen's problem. Nu
mber the nodes as inDFSBFSD Search110)Solve 15 Puzzle Problem using Branch and B
ound .Initial arrangement of tiles is given below111)Prove using the formal definition of
Big O,(you need to give a ,c,,n
0
)5n3=O(n)2n
2
+3n+20=O(n
2
)112)Prove using definition of Omega( you need to give a ,c,,n
0
)3n10=Omega(n)n
2
5n20=Omega(n
2
)113)By taking suitable example explain how the sum of Subset problem can be solved b
y using Backtracking algorithm design technique.114)Explain the following algorithm de
sign techniques ; Backtracking Branch and BoundDynamic ProgrammingDivide and Con
quer115)Write and explain the algorithms for Disjoint Set Union if we are given two sets
Si and Sj116)Define Knapsack problem. Solve the following using Knapsack Problemn=
3,m=20(P1,P2,P3)=(24,25,15)(W1,W2,W3)=(18,15,10)117)Define Job Sequencing with
(P1,P2,P3,P4)=(100,10,15,27)(D1,D2,D3,D4)=(2,1,2,1)118)Define Optimal Storage on T
apes. Solve the following using this technique:n=3,(L1,L2,L3)=(5,10,3)119)Define Opti
mal Merge Pattern .Find Optimal Merge pattern for 10 files whose lengths are 28,32,12,5,
84,53,91,35,3,11120)Obtain a set of Optimal Huffman Codes for the messages(M1........
M7)with relative frequencies (q1....q7)=(4,5,7,8,10,12,20).Draw the decode tree for this s
et of codes.121)Define the Traveling Salesperson Problem .Solve problem using TSP wh
ere the edge lengths are given as:0 10 15 205 0 9
106 13 0 128 8 9 0122)What do yo
u mean by deterministic and Non Deterministic Algorithms. Differentiate between them.
Write example for each of them.123)Define NP Hard and NP Complete .Represent the rel
ation between them. Prove that P is a subset of NP.124)What is Clique Decision Problem.
Show that clique optimization reduces to clique decision problem.125)What are approxi
mation Algorithms. Define absolute approximation and Eapproximation with example.12
6)What is Algorithm .Write the various performance analysis techniques of Algorithm .D
ous data structures with examples129)Write algorithm for Quick Sort using divide and C
onquer .130)What is Divide and Conquer algorithm. Use this algorithm to find maximu
m and minimum from a given array131)Write an algorithm for Merge Sort using Divide a
nd Conquer.132)What do you mean by dynamic programming. Explain multistage Graph
s using dynamic Programming133)What are Strings. What are various String Algorithms.
Explain any two of them.134)Explain 0/1 knapsack problem using any two techniques y
ou know135)Explain asymptotic notations .Also explain the following notations:Big OO
megaTheta136)What do you mean by complexity of an algorithm .Define time and space
complexity with examples137)Explain various traversal techniques for trees138)Explain
various traversal techniques for graphs139)What is Backtracking. Explain various proble
ms solved by backtracking140)What is Backtracking. Solve 8 Queens problem by backtr
acking141)Explain various search techniques for trees142)Explain various search techni
ques for graphs143)How sum of subset problem is solved by Backtracking144)What is gr
aph coloring. Explain it with example .Show that a graph is 4 color able 145)What do yo
u mean by Branch and Bound. Solve 15puzzle problem 146)Define the followingLC Sear
chFIFO Branch and BoundLC branch and Bound147)Define Principle of Optimality .Exp
lain how does it holds on the following problems:
knapsackOptimal Merge PatternShortest Pat