DAA3
DAA3
a. Algorithm
b. Function
c. Program
d. Procedure
Ans: A
2. The measure of the longest amount of time possibly taken to complete an algorithm is expressed as
__.
a. Little-O
b. Little-Omega
c. Big-Omega
d. Big-O
Ans: D
a. Stack
b. Queue
c. Psuedocode
Ans: C
b. Space complexity
c. Compiling time
d. Best case
Ans: A
5. Potential function method is the technique that performs an amortized analysis based on ___.
a. Financial model
b. Computational model
c. Algorithm analysis
d. Energy model
Ans: D
6. ___ is the maximum amount of time an algorithm takes to execute a specific set of inputs.
a. Running time
Ans: C
7. ___ within the limit deals with the behavior of a function for sufficiently large values of its parameter.
a. Asymptotic notation
b. Big-Oh notation
c. Omega notation
d. Theta notation
Ans: A
8. Which one of the following helps in calculating the longest amount of time taken for the completion
of the algorithm?
a. Theta notation
b. Big-Oh notation
c. Omega notation
d. Time complexity
Ans: B
9. For converting recursive algorithm to non-recursive algorithm, store the values of all ___ parameters
in the stack.
a. Negative
b. Global
c. Pass by reference
d. Pass by value
Ans: D
10. The ___ is also known as an escape clause which is used to terminate the algorithm.
a. Recursive step
b. Recursive function
c. Iterative step
d. Base case
Ans: D
11. In algorithm visualization of bubble sort algorithm the non-linear curve of the sorted elements is
close to ___.
a. 3n
b. n3
c. 2n
d. n2
Ans: D
b. Dynamic programming
d. Simple recursive
Ans: C
13. ___ are node-based data structures used in many system programming applications for managing
dynamic sets
a. Stack
b. Queue
d. List
Ans: C
14. Which method is practical to perform a single search in an unsorted list of elements?
a. Sequential search
b. Bubble sort
Ans: A
15. Which algorithm finds the solution for the single-source shortest path problem for a tree?
a. Prim’s
b. Dijkstra’s
c. Kruskal’s
d. Huffman code
Ans: B
16. Prim’s algorithm starts constructing a minimum spanning tree from ___.
Ans: A
17. Which method of encoding does not consider the probability of occurrence of symbols?
Ans: D
b. Frequency
Ans: A
19. ___ is a concept wherein larger solutions for problems are found based upon the solution of a
number of smaller problems.
d. Backtracking
Ans: A
20. The basic operation of the ___ algorithm is the comparison between the element and the array
given.
a. Binary search
b. Greedy
c. Brute force
d. Insertion sort
Ans: D
21. In ___, one begins at the root of the tree and then explores along each branch.
a. Topological sorting
b. Breadth-first search
c. Depth-first search
d. Insertion Sort
Ans: C
22. What is the mode for the following set numbers? 10,12,8,4,10, 6, 10,11,11,10,12
a. 11
b. 12
c. 10
d. 9
Ans: C
a. AVL tree
b. Binary tree
c. Red-black tree
d. B-tree
Ans: B
24. The number of key comparisons in the worst case while forming a heap is using an array of n
elements is ___.
a. nlog2(n+1)
b. 2(nlog(n+1))
c. 2(n-1)log2(n+1)
d. 2(n-log2(n+1))
Ans: D
25. ___ is an optimization technique for particular classes of backtracking algorithms that repeatedly
solve sub-problems.
b. Dynamic programming
Ans: B
a. kCn
b. nCk
c. n+1Ck
d. nCk+1
Ans: B
27. ___ is the technique by which we make a function perform faster by trading space for time.
b. Greedy
c. Memoization
d. Recursion
Ans: C
28. The root node in the B-Tree technique has ___ limit on the number of children?
a. Lower
c. Upper
d. No
Ans: C
29. The shift table is to be initialized to ___ to compute the bad character shift.
Ans: D
30. Each slot of the bucket array in separate chaining stores ___.
a. Records
d. Both b & c
Ans: B
31. The best possible value of the problem objective, written as a function of the state, is called the ___.
a. Value function
b. Control variables
c. Policy function
d. Principle of Optimality
Ans: A
32. If we have materials of different values per unit volume and maximum amounts, the ___ Knapsack
problem finds the most valuable mix of materials that fit in a knapsack of fixed volume.
a. Bounded
b. Binary
c. 0-1
d. Fractional
Ans: D
a. Backtracking
b. Recursion
c. Memoization
Ans: C
34. With respect to finding the time complexity of Kruskal’s algorithm, which operation keeps track of
the parent pointer until it reaches the root parent?
a. Makeset
b. Union
c. Find
d. Merge
Ans: C
35. ___ means calculating the minimum amount of work required to solve the problem.
a. Upper-bound
b. Lower–bound
c. Adversary
d. Problem reduction
Ans: B
a. Input value
b. Output value
c. Solution
d. Decision
Ans: D
37. An algorithm that defines every operation exclusively is called ___ algorithm.
a. NP-hard
b. Deterministic
c. Non-deterministic
d. NP-complete
Ans: B
38. ___ problems include counting of structures of a specific kind and identifying the largest, smallest or
optimal objects.
a. Combinatorial
b. Traveling Salesman
c. Knapsack problem
d. Use cases
Ans: A
39. ___ is a sequence of data elements connected to each other where every element has a link field
referring to the location of the next element.
a. Array
b. Stack
c. List
d. Queue
Ans: C
40. ___ organizes details of all candidate solutions and discards large subsets of fruitless candidates by
using upper and lower estimated bounds of the quantity being optimized.
a. Approximation algorithms
b. Dynamic programming
c. Greedy algorithm
Ans: D
a. An algorithm should have one or more inputs externally and it should produce one or more output.
c. To analyze an algorithm means to determine the number of resources necessary to execute it.
Ans: C
42. The two main conditions for theta notation are ___ and___.
a. f(n)=O(g(n)), f(n)≠Θ(g(n))
b. f(n)>O(g(n)), f(n)=Θ(g(n))
c. f(n)≠O(g(n)), f(n)≥Θ(g(n))
d. f(n)>O(g(n)), f(n)>Θ(g(n))
Ans: A
43. Identify the true and false statements from the following with respect to measuring the running time
of an algorithm.
a. 1-T, 2-F
b. 1-T, 2-T
c. 1-F, 2-T
d. 1-F, 2-F
Ans: A
44. The two primitive operations of the function Fact(x) are ___ and ___.
Ans: B
45. The smoothness rule assumes that T(n) Є Θ(n2) if ___ is a smooth function and ___ is eventually
non-decreasing.
a. n2, T(n)
b. Θ(n2), T(n)
c. T(n), n2
d. Θ(n),n
Ans: A
46. In which method of coding does the code of a symbol not depend on the frequency of occurrence of
that symbol?
Ans: B
47. Which among the following is not a reason to perform the empirical analysis?
c. To compare the efficiencies of different algorithms working to solve the same problem.
Ans: B
48. In distribution counting, one array is used to store ___ value and another to store ___ list of
elements.
a. Frequency, Sorted
b. Distribution, Sorted
c. Frequency, Unsorted
d. Sorted, Unsorted
Ans: B
49. In a knapsack problem, if a set of items are given, each with a weight and a value, the goal is to find
the number of items that ___ the total weight and ___ the total value.
a. Minimizes, Minimizes
b. Maximizes, Maximizes
c. Maximizes, Minimizes
d. Minimizes, Maximizes
Ans: D
a. 1-F, 2-F
b. 1-T, 2-F
c. 1-T, 2-T
d. 1-F, 2-T
Ans: D
This quiz will test your knowledge of algorithm design and analysis, and help you gain a better
understanding of the topic. So, why wait? Take the quiz now and find out how well you know your
algorithms!
FAQs
Q1: What is the difference between a graph algorithm and a network algorithm?
Ans: Graph algorithms are used for analyzing and manipulating data that is structured as a graph, while
network algorithms are used for analyzing and manipulating data that is structured as a network.
Graph algorithms focus on finding solutions to problems related to the structure of the graph, such as
shortest paths or minimum spanning trees. Network algorithms focus on optimizing communication
between nodes in the network, such as routing protocols or distributed consensus protocols.
Ans: An algorithm is a set of instructions for completing a task, while a program is an implementation of
an algorithm. An algorithm can be written in any language, while a program must be written in a specific
programming language.
Algorithms are often expressed as pseudocode, which is not executable code and cannot be run on a
computer. Programs are executable code and can be run on computers to perform tasks.
Software algorithms are used to automate processes and make them more efficient. They can be used
to solve complex problems quickly and accurately.
Ans: First, you should understand the problem and the data available to you. Then, research different
algorithms that may be applicable and consider their strengths and weaknesses.
Finally, experiment with different algorithms to see which one provides the best results for your
problem. Make sure to document your process so you can easily refer back to it if needed.
Ans: Common algorithm design patterns include divide and conquer, dynamic programming, greedy
algorithms, and backtracking. Divide and conquer involves breaking down a problem into smaller
subproblems which are then solved independently.