0% found this document useful (0 votes)
2K views9 pages

Ada Lab Viva Voice Questions

Uploaded by

GS SINDHU
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2K views9 pages

Ada Lab Viva Voice Questions

Uploaded by

GS SINDHU
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

VIVA VOICE QUESTIONS

1. What is an Algorithm? (L2)


Algorithm is a Step by step procedure to Solve a given problem for a finite number of input
producing finite number of output with desired output.
2. What is the Aim of DAA lab or why we need to study DAA Lab?(L3)
DAA is a discipline, where we are dealing with designing or writing the algorithm
keeping in Consideration of Space and Time Complexity, Such that Our Algorithm
should execute in a very minimum amount of time by Minimum Space or RAM.
3. Define Space and Time Complexity? Among this which one is more prioritized?(L3)
Space Complexeity is a measure of Amount of Space taken by a Program to finish its
Execution.
Time Complexeity is a measure of amount of time taken by a program to complte its
Execution.Depending Upon Application it is considered,EX:For Mobile or Handheld
Devices,We give Prefernce for both Space and time.
For a Huge and Inter active Systems like Web Applications we give more Preferences to
time Complexeity.
4. What is Design and what is Analysis of a Program?(L2)
Design is a Process of Writing an algorithm to a given Problem so that it should accept
finite number ofinput and finite number of output with a definite output and Should Exit
appropriately.
Analysis:Analysis is a next Phase of Writing an Algorithm ,in this phase we calculate
the Efficiency of anAlgorithm i.e time and space needed by an algorithm.
5. Write the general plan for analyzing the recursive algorithms.(L2)
Identify the inputs.
Identify the output is depended only on number of inputs.
Identify the Basic Operation in ALgorithm.
Form or write the Recursive Relation to the Algorithm.
6. What are the various notations used to write an algorithm? (L2)
(i) Pseudocode (ii)Natural Language and etc..
7. What is a Pseudocode?(L2)
It’s a notation which is having the combination of Programming Constructs and English like
Statements.
8. What is Asymptotic Notations?Explain Various notations used for the same.(L2)
Asymptotic Notation is a way of Representing an algorithm time
Complexeity in terms ofBest,Average,Worst.
There are 3 Notations used to represent (i)Ω(n)-Best Case :-Here the algorithm runing
time g(n) is less thanf(n). for all n>=no .Such that there exist a constant C.
f(n)>=c.g(n),for all n>no
Refer Text book for Graph.
(ii) O-Worst Case:-Here the Algorithm runing time g(n) is greater than
F(n) for all n>=no . f(n)<=c.g(n) ,for all n>=no, Such that there exist a
constant C.
Refer Text book for Graph.
(iii) Ө-Average Case:When there is more than one parameter controlling the Execution
time and We should go for Amortized analysis or Series of Execution for the Same Input
and the Resultant Would be Average Case is which is c1.g(n)<f(n)<c2.g(n) ,for all n>=no,
Such that there exist a constant C.
Refer Text book for Graph.
9. List out the few topics you have studied or Explain few topics of your Favourite
list.(L2)
1. Mention a topics Which you are really good in,the topics like

 Searching-Explain any one Searching Algorithm


 Sorting-Explain Any one Sorting Algorithm.
 String Matching-Explain any one method ,Select either Brute Force or
Horspool Method.
 Divide and Conquer-Explain either Merge sort or Quick sort
which You are MoreComfortable.
 Greedy Technique-Define Greedy and Explain Any problem
with Greedy MethodEx:Knapsack Problem,Job Sequencing with
Deadlines,Prims ,Kruskals and etc..
 dynamic Programming-Explain any Problem with Dynamic Programming
Approach
 Decrease and Conquer:Explain any problem which can be Solved
Using decrease andConquer,EX:DFS,BFS,Topological Sorting.
 Limitations of Algorithms:Explain few things about Decision trees and
its use in solving aProblem.
 Coping with Limitations of Algorithms:Explain Backtracking and one
problem which illustratesabout Backtacking method and Wind Up.
12. What is the Time Complexeity of Bubble Sort,Selection Sort ,Merge Sort,Quick
Sort?(L3)
Bubble Sort-n2,
Selection Sort- n2
Merge Sort-nlog.n
Quick Sort -nLogn, Worst case for Quick Sort- n2
13. Which sorting agorithm is more Efficient and why?(L3)
Quick Sorting is More Efficient ,because this algorithm is
instable algorithm andinplace.
14. What do you mean by the term Instable Algorithms?(L2)
The Instable Algorithms are one, which divides the array as certainly depending upon
pivot or key element and hence i index precedes index j
15. Which algorithms are faster?(L3)
Instable Algorithms are much Faster compared to Stable Algorithms.
16. For what type of instance Merge sort do better than Quick Sort?(L3)
For a Larger input and a sorted input values.
17. For what type of instance Quick sort do better than Merge Sort? (L3)
For Smaller Set of input numbers.
18. What are Inplace Algorithms?
Inplace Algorithms are the one which doesn't occupies Extra Space.
19. Write the order of growth terms as per the time Execution in Ascending Order.(L3)
logn,n,nlogn,n2,n3,..... nn,2n,n!
20. What is Brute Force Technique? When We Should Use? (L3)
Brute Force is a straight Forward Technique to solve a problem, We used to solve a
Problem throughthis approach when we don't have sufficient data to solve a problem in
Efficient Way.
21. What is the difference between Divide and Conquer, Decrease and Conquer? (L2)
Divide and Conquer can be solved to solve a problem with a larger data set and
when there is no dependency between any of the data sets.
 Divide and Solve as Small as Small sets.
 Conquer or Merge it get one final resultant data set.
Decrease and Conquer is almost similar to Divide and Conquer but we are finding a
solutions to the problem in a different variations,EX:Decrease by Constant (Usually
by One),Decrease by Constant factor which is almost similar to Divide and Conquer
Technique(Usually by two),Decrease by Variable(The Dividing Criteria changes for
each iteration depends upon the data set.
22. Define Greedy Technique. (L2)
Greedy Technique is always applied for the problem of the type optimization type,
which reduces loss and increases profit.
23. Define Optimal and Feasible Solution. (L2)
Optimal Solution is a solution which is best among N
Feasible Solution. Feasible Solution is a solution which
Satisfies a Problem Constraints/conditions.
24. Can A Problem solved by all the algorithmic Techniques.(L3)
Yes,but some problems will give better results with some Algorithmic Technique
and it may give worst result when it is applied with other technique.
25. State and Explain Knapsack Problem. (L2)
Filling the Maximum number of items to the Knapsack (Container) Which
Increases the profit and decreases the Loss.
26. State Few Algorithmic Techniques which you have studied. (L2)
Brute Force Technique
Divide and Conquer
Greedy Technique
Dynamic Programming
Decrease and Conquer
27. Which one is Most Admired algorithmic Technique?(L3)
Dynamic Programming.
28. What is Spanning tree and Minimum Spanning tree?(L2)
A tree Without Cycles are called as Spanning tree .
A Minimum Spanning Tree is a spanning tree which yeilds the very less Cost when all
the edges cost summed up.
29. How Many Spanning Tree can a Tree can have?(L3)
A tree can have 1 to many number of Possible ways of Spanning Tree.
30. Differentiate between Prims and Kruskals Algorithm for finding MST.(L2)
In Prims We consider any one vertex in the graph as Source and We compute the
distance from that source to other vertices ,after computing the vertices which has
minimum value among (n-1) vertices is added to tree vertices and that respective edges
added to tree Edges Set.The above mentioned Process continues till we reach (n-1)
vertices.
In Kruskals we first arrange the edges in Ascending Order and then we start to form the
tree which wont formcycles,if adding that edges forms cycles then that edges is dropped
from adding to tree edges.The above saidprocess is continues till we reach the count of
(n-1) Vertices.
31. What is the Application of Prims and Kruskals Algorithm?(L3)
In Networks to remove the Cyclicity of the Network.
32. Explain Job Sequencing With Deadlines?(L2)
Placing or scheduling the maximum number of Jobs to a machine without violating the
deadlines constraintof any of the Jobs in Sequence.
33. Why the Name Bubble Sort named?(L3)
Because in first Pass the first highest data will bubbles up,so since the largest
element bubbles up in the first and second largest element bubbles up in the Second
pass and so on, so hence the name bubble sort.
34. Why the Name Selection Sort?(L3)
The Selection sort is named because we initially first select an arrays first element as
minimum and will compare with other elements ,so in pass one first least element
goes to the first position and so on so forth for 2nd,3rd and so on. Selecting
35. What is the difference between Brute force strings matching to Horspool
String Matching Method? (L2)In brute Force we compare each and every
element of the text to the pattern by shiftingthe text positionby one and in Horspool
method we shift it by number of shift positions recorded in theshift table.
36. Explain Merge Sort?(L2)
In Merge Sort will divide the entire input set by 2 until we reach low<high and later
will find a solution to each item by comparing half of the array data set to the other
half array data set and finally we mergeit to form a sinle array(conquer)
37. What is the Basic Operations in Merge sort and Quick sort?(L2)
In Merge Sort the Basic Operations is Comparisions and in Quick sort basic Operations
is Partitioning andhence also known as partitioning sort.
38. Why the Insertion Sort?(L3)
We are Inserting an element to its suitable place by comparing n elements for each pass.
39. What is the Use of DFS and BFS?(L2)
DFS and BFS both used to check the Connectivity of a graph,Cyclicity in a
graph,Spanning tree of agraph.
40. Differentiate between DFS and BFS.(L2)
DFS and BFS are both the Graph Traversing Technique,in which DFS Traverse the
Graph in a depthwise(Vertical) and BFS Traverse the Graph from left to
right(Horizontal)
41. Which Data structures used in BFS and DFS.(L2)
BFS USes Queue as its data structure and DFS uses as stack its Data structure.
42. What are back edges in DFS and Cross Edges in BFS.(L2)
Back Edges and Cross edges are the Edges which already visited by a ancestor node.
43. What is Topological Sorting?(L2)
Topological Sorting is a Sorting Technique used for sorting Vertices in the Graph.
44. What is the Conditions necessary for a Topological Sorting? (L3)
For a Topological Sorting the Graph Should be DAG(Directed Acyclic Graph)
45. What are the Different methods used to solve a topological Sorting ?(L3)
(i) Source Removal Method
(ii) Using DFS based Scheme.
46. What is the Use of Topological Sorting?(L3)
Use of Topological Ordering is in the field of Operating System for Scheduling and in
Networks,Automation and Robotics.
47. What is Dijikstra's Algorithm?(L2)
Dijikstra's Algorithm is Used to find the Single shortest Path from source to the other
vertex.
48. What is a graph?(L2)
Graph is a component which is having a set of Edges and vertices G={V,E}
49. What are the different ways that can be represents a graph?(L2)
Adjaceny Matrix and Adjacency List.
50. What is Adjacency Matrix?(L2)
Is a Matrix which illustrates the Graph in the form of Matrix,if it is a weights Graph
then we initialize the value of the cost in that position(i,j) or else simply we write 1 to
mention ther exist an edge between (i,j) OR else we use 0 or 9999 to mention non
connectivity of a graph.
51. What is the limitations of Algorithms?(L2)
Algorithm can't find the better the soltions when we come across the tight lower
bound,So we can find thebetter solutins which is not possible with Algorithmic way.To
find the Tight lower bound we use DecisionTrees.
52. What is Tight lower Bound?(L2)
It is a Lower bound which is a best lower bound for an problem,beyond that no
algorithm will produce better results.
53. What are Decision Trees?(L2)
Decision trees are also known as Comparision Trees used to find the tight lower
bound for a particular Problem EX:Tight Lower Bound For Sorting is n.logn
and tight lower bound for Searching is logn which is not possible to get the better result.
54. What is a polynomial problem (P-type) (L2)
P-type problem are decision problems in which we can find the solutions in a
polynomial time and is oftype deterministic.
55. What is NP-problem?(L2)
NP-Problem belongs to decision problem and these problems are Non Deterministic
Polynomial i.e forwhich the problem doesn't have deterministic solutions and Can be
solved in Polynomial time
There are 2 phases in solving a problem.
(i) Guessing(Non-Deterministic stage) Producing N number of Candidate Outputs.
(ii) Verification(Deterministic Stage) Verifying The correctness of N Number of
Candidate Outputs.
56. What is NP-Complete Problems? (L2)
Np_Complete Problems belongs to Decision problems and NP type Problems .
These problems can be find the solutions by converting or reducing to the problem
which we know theSolutions.

57. What is a trivial lower bound?(L2)


Trivial bound can be derived by formulating the number of inputs that has to be given
and number ofoutputs that has to be generated.
58. Explain Bactracking W.r.t
(I)Subset Problem (ii)N-Queens Problem
59. Explain Subset Problem.(L2)
In a given Set S ,find the Subset,in which the sum of all subset elements is equal to
the sum d which is predefined in a problem.
60. Explain N-Queens Problem.(L2)
N-Queens Problem is of Placing a N-Queens in a N*N Chess board such that No 2-
Queens Should be placed in the same Row,Column and same diagnol(N=Should
consider both principal diagonal elements)
61. What is Hamiltonian Circuit?(L2)
Hamiltonian circuit is a problem in which that circuit starts from a source vertex and
has other vertex in any order without repeating and Should end with the Source vertex
only i.e source and Destination vertexshould be same.
62. Explain the Problem of TSP.(L2)
Travelling Sales Person Problem is a problem in which he should Visit N number of
cities with a minimum number of Cost by visiting every city Exactly one and the city
what he is started should end with same city.
63. What is the Concept of Dynamic Programming?(L3)
Deriving a Solution to the basic Condition and Extracting the solutions for the rest of
the other data sets by Previously drawnd Solution.Computer to other algorithmic
Technique Dynamic Programming because it avoids lot of reworking on the same
Solution what we have solved in the earlier phases of deriving the solution to the
problem.
64. What is the goal of Warshalls Algorithm?(L3)
Warshall’s algorithm is to find the shortest distance between a node to all the other
nodes in the graph. It Uses the Property of Transitive Closure i.e if there exist a path
between (i,k) and (k,j) then there surely exist a path between (i,j)
(i,k) & (k,j)---(I,J)
65. What is the use of Floyds algorithm?(L3)
It is use to find the All pairs shortest Path of an Graph.
66. What is Parallel Programming?(L2)
Parallel programming is a technique of writing a Program to Execute a series of
instructions parallel to gain Speed up in Execution.
67. What is openMp?(L2)
OpenMp is an abbreviation of Open Multi programming and it is a programming tool
which creates an environment to execute a program in the Parallel fashion i.e, N
number of Instructions at the same time so as to achieve the spped up.
68. When one can go for Parallel Programming?(L3)
Parallel Programming Fashion is can be opted when there is no dependency between
the series of Instructions that has to be Executed Parallely.
69. What is the Command used to compile
a parallel Program? (L2) Command is
cc-fopen filename.c
70. What is cc stands for and –fopenmp stands for?(L2)
Cc stands for invoking a turbo C Compiler and –fopenmp is an option to the
command which directs a compiler to invoke or use the parallel programming API so
as to Execute the program in a parallel Way.
71. What are the Maximum Number of Possible Ways for a travelling Sales Person
with N number of Cities?(L4)
(N-1)! i.e for 5 cities (5-1)!= 4 !=24 ways.
72. Give Some Examples for a problem of type NP and NP-Complete?(L2)
Knapsack,Job Sequenncing with Deadlines,N-Queens Problem,Subset Problem,TSP
and Hamiltoniancircuit.

You might also like