0% found this document useful (0 votes)
592 views

ADA Viva Questions Unit 1 and 2

An algorithm is a collection of unambiguous instructions that produces an output for a given input in a finite amount of time. There are different types of algorithms such as recursive, backtracking, divide and conquer, dynamic programming, greedy, branch and bound, and brute force. Algorithms have properties like non-ambiguity, range of input, multiplicity, speed, and finiteness. A vector is a list of numbers that can be added, subtracted, multiplied via dot product and cross product. Quantifiers in predicate logic determine quantity and are either universal or existential. A matrix is a rectangular array of numbers with defined operations like addition, subtraction, and multiplication. Common operations on matrices include addition, subtraction, multiplication, and transpose

Uploaded by

Yash Patel
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)
592 views

ADA Viva Questions Unit 1 and 2

An algorithm is a collection of unambiguous instructions that produces an output for a given input in a finite amount of time. There are different types of algorithms such as recursive, backtracking, divide and conquer, dynamic programming, greedy, branch and bound, and brute force. Algorithms have properties like non-ambiguity, range of input, multiplicity, speed, and finiteness. A vector is a list of numbers that can be added, subtracted, multiplied via dot product and cross product. Quantifiers in predicate logic determine quantity and are either universal or existential. A matrix is a rectangular array of numbers with defined operations like addition, subtraction, and multiplication. Common operations on matrices include addition, subtraction, multiplication, and transpose

Uploaded by

Yash Patel
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/ 5

UNIT 1 : Basics of Algorithms and Mathematics

1. Define the term: Algorithm or What is an algorithm?


The algorithm is defined as a collection of unambiguous
instructions occurring in some specific sequence and such an
algorithm should produce output for given set of input in finite
amount of time

2. List types of algorithms.


• Simple recursive algorithms.
• Backtracking algorithms.
• Divide and conquer algorithms.
• Dynamic programming algorithms.
• Greedy algorithms.
• Branch and bound algorithms.
• Brute force algorithms.
• Randomized algorithms

3. Enlist properties of algorithm.


• Non-ambiguity
• Range of input
• Multiplicity
• Speed
• Finiteness

4. What is vector? Which operations are performed on vector?


• A vector in the plane is a directed line segment.
• A vector is a list of numbers (can be in a row or column)
• Operation performed on vector: Addition Subtraction
Multiplication(Dot Product , Cross Product)

5. Explain the terms: Quantifier


In Predicate logic the quantifier is a kind of operator
which is used to determine the
quantity.
There are 2 types of quantifiers
1) Universal Quantifier – Any quantifier starts with “” is
universal quantifier.
2) Extential Quantifier- Any quantifier starts with “Ǝ” is
universal quantifier.

6. What is Matrix?
A matrix is a rectangular array of numbers or other
mathematical objects for which operations such as addition
and multiplication are defined.

7. List out operations which can be performed on matrix.


o Addition
o Subtraction
o Multiplication
o Transpose
UNIT NO- 2 : Analysis of Algorithm

8. Define Big Omega Asymptotic Notation.


It is a method of representing the lower bound of algorithm’s
running time. Using Omega notation we can denote shortest
amount of time taken by algorithm.

9. Define space complexity.


Space complexity of an algorithm means amount of memory
taken by an algorithm.

10. What is worst case time complexity ?


The worst-case time complexity measures the running time an
algorithm requires in the worst-case. It gives an upper bound
on the time required by the algorithm

11. What is time complexity?


Time complexity of an algorithm means amount of time taken
by an algorithm to run.

12. What is efficiency of algorithm?


The efficiency of an algorithm can be specified using time
efficiency i.e. time complexity and space efficiency i.e. space
complexity Time complexity of an algorithm means amount of
time taken by an algorithm to run. Space complexity of an
algorithm means amount of memory taken by an algorithm
13. What is the average case time complexity of bubble sort?
O(n2 )

14. Write down the Best case, Worst Case and Average case
Complexity for selection sort
Best case, Worst Case and Average case Complexity for
selection sort: O(n2 )

15. Write down the Best case, Worst Case and Average case
Complexity for Heap sort.

the Best case, Worst Case and Average case Complexity for
Heap sort : O(n log n)

16. What is the complexity of Counting sort?


O(n)

17. What is the complexity of Bucket sort?


Worst-case O(n2 )

18. What is merge sort?


The merge sort is a sorting algorithm that uses the divide
and conquer strategy . Merge sort on an input array with n
elements consists of three steps:
1)Divide: Partition array into two sub lists s1 and s2 with n/2
elements each.
2)Conquer: Then sort sub list s1 and s2
3)Combine: Merge s1 and s2 into a unique sorted group

19. What do you mean by divide and conquer ?


Divide and conquer is an algorithm design technique in which
the given problem is,
• Divided into smaller sub problems
• The sub problems are solved independently
• Combining all the solutions of sub problems into a solution of
the whole

20. What is the complexity of Quick sort?


Best Case: Θ(n log2n)
Average case: Θ(n log2n)
Worst Case: Θ(n2)

21. What are the merits and demerits of merge sort?


MERITS:
It requires less running time.
Used in data processing
DEMERITS:
The algorithm requires linear amount of extra storage
It requires an additional array with n elements

You might also like