ADA Lab Viva Questions
ADA Lab Viva Questions
perform a computation.
A: Divide and Conquer, Greedy, Dynamic Programming, Backtracking, and Branch and
Bound etc.
complexities? A:
A: To find the minimum cost spanning tree using edge-based greedy approach.
edges.
A: Prims grows MST from a starting node using adjacent vertices; Kruskals selects globally
smallest edge.
cycles.
Warshall? A: O(V3)
queue.
sorted.
fractional knapsack.
profit/weight ratio.
pruning.
stable? A: No.
A: No.
stable? A: Yes.
A: Place N queens on an NN board such that no two queens attack each other.
backtracking? A: O(N!).
Additional Questions
A: It represents the upper bound of an algorithms running time, used for worst-case
analysis.
A: They describe the behavior of functions for large input sizes: Big-O (upper bound),
A: Because they make a series of choices that seem best at the moment (locally optimal).
undirected.
structure.
optimal substructure.
promising.
Sorting Algorithms
A: Selection sort, Quick sort, Merge sort, Bubble sort, Heap sort.
Q17. What is the key difference between BFS and Dijkstras algorithm?
A: BFS is used in unweighted graphs to find shortest paths; Dijkstra is used for weighted
graphs.
A: A linear ordering of vertices such that for every directed edge u v, u appears before v.
Special Problems
Q20. How many solutions exist for the 4-Queens
symmetric variations).
column, or diagonal.