Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 6

DAA Practical File Questions

1. What is an Algorithm?

The Term 'Algorithm' refers to the set of instructions that must be followed to solve a problem. The logical
description of the instructions can be executed to carry out a critical function. Algorithms are typically
generated independently of primary languages, implying that an algorithm can be accomplished in more
than one programming language.

2. What is the DAA algorithm?

A DAA algorithm is a procedure that accomplishes its goal effectively and can be expressed in a finite amount
of time and space. DAA algorithms are instructions for computers to follow when they need to perform a
calculation, process some data, or use some form of automated reasoning to resolve a problem.

3. What is DAA design?

The fields of algorithm design and analysis help design algorithms that can be used to solve various
problems in computer science. It is beneficial to design and analyzes the logic governing how the program
will function before developing its actual code.

4. What is the Algorithm's Time Complexity?

The time complexity of an algorithm was the total amount of time required for the program to run until it
was finished. In most cases, it is expressed with the notation known as the big O. The length of time needed
for a program to run entirely was indicated by the Algorithm's time complexity.
5. What is Data Structures?

Data Structures are one of the most basic ways to store and display data. Data is how a processor shows
facts, ideas, and instructions for all computing tasks. Data structures are the different ways all this
information can be organized helpfully.

6. What is Backtracking in DAA?

The term "Backtracking" refers to a recursive algorithmic technique for solving problems by first attempting
to build a solution and then discarding any solutions that don't meet the problem's constraints at that stage.
You could say that going backward is better than going forwards with force. The backtracking method
involves searching through all options to find a solution to a problem

7. What is a Greedy method in DAA?

Greedy algorithms construct a solution piece by piece, selecting the subsequent component in a way that
provides an immediate benefit. This method never takes prior decisions into account. This method is
primarily employed to address optimization issues.

8. What are the different types of algorithms?

There are many different types of algorithms available, and they are listed below:

 Randomized Algorithm
 Hashing Algorithm
 Recursive Algorithm
 Brute Force Algorithm
 Searching Algorithm
 Sorting Algorithm

9. What is Asymptotic Notation?

A method that can represent the behavior of functions when they are either in the limit or when they are not
bound. The notations are explained in terms of methods, and the domains of those methods are the set of
natural numbers represented by the numbers 0 through 2.
Notations of this kind make defining the worst-case running time function T more convenient (n). It is
possible to extend it to cover the realm of real numbers.

10. What is a Dynamic Method in DAA?

Similarly to the divide-and-conquer strategy, the key to success in dynamic programming is to merge the
results of previously solved subproblems. In addition, the dynamic programming algorithm only needs to
compute the solution to each sub-problem once, and then it can reuse that information from a table.

11. What is Dijkstra's Algorithm?

Dijkstra's Algorithm computes the shortest path from a given source vertex to a given target vertex in a
weighted graph or digraph by solving the single-source shortest path problem. Dijkstra's Algorithm works
properly for graphs with positive weights.

12. What exactly are Huffman Trees?

A Huffman tree is a binary tree that shortens the time it takes to travel from the root node to each of the
leaves by using weights that have already been determined. The most effective application of Huffman trees
is to create a Huffman code with their help.

13. What criteria are used to make the Algorithm work better?

The various standards used to raise the Algorithm's effectiveness include

 Input: "Input" means that one or more quantities come from the outside.

 Output: The composition of at least one quantity constitutes an output.

 Clarity: Every guideline is easy to understand and follows.

 Finiteness: Algorithms are said to be "finite" if they can be solved in a finite number of steps by

following their instructions to the letter.

 Effectiveness: Efficient teaching requires starting at the very beginning.

14. What is the Knapsack Problem?


Assume we have n elements, where we know their weights wi and values vi for i=1, 2, etc. Given n and W,
identify the most valuable subsets of the elements that fit in a knapsack of size W.

When sorting the components of a specific instance, it helps to do so in descending value-to-weight order. It
means that the payoff per unit of weight is highest for the first element and lowest for the last.

15. What is Dynamic Huffman Encoding?

The dynamic Huffman encoding tree is updated after each character is read. It guarantees the highest
degree of precision in the coding process. For the most precise coding, this is a must. To avoid the problems
inherent in the bare-bones implementation, we turned to dynamic Huffman n-coding.

16. Write the difference between dynamic programming and the greedy method?

Greedy method

 There is always only one path that can unfold.

 It need not always supply the best possible answer.

Dynamic programming

 There are a plethora of options from which to choose.

 Provides the best possible answer every time

17. What are Minimum Spanning Trees?

A tree is a spanning tree for a linked graph if its set of vertices is the same as the graph's set of vertices and
its edges are a subgroup of the graph's edge set.

A spanning tree is a component of every linked graph. The sum of the weights of each edge in a spanning
tree is the tree's weight, denoted by the symbol w (T). The Minimum Spanning Tree, abbreviated MST, is a
spanning tree with the least amount of weight that is practically possible.
18. What exactly do you mean by the Huffman code?

A Huffman code is an optimal variable-length prefix tree encoding method. This method works by assigning
bit strings to characters in a text based on the number of times those characters appear.

19. What exactly is Backtracking?

The generation of depth-first nodes is referred to as backtracking when using the bounding method. The
backtracking method can find the solution in a significantly smaller number of iterations than m trials.

20. What is a Sorting Network?

A sorting network is a mathematical representation of the wired network and comparator modules used to
order a set of numbers.

This model is used to sort the numbers. Every comparator has two wires that connect and sort the values by
sending the value lower to one wire and the other wire higher. In contrast, with comparison sorting
algorithms, the series of comparisons is determined by the outcome of the comparisons that came before it.
Because of this independence of comparison series, parallel execution of the methods can benefit greatly
from having this property.

21. What is time Complexity in DAA?

Time complexity, a particular case of computational complexity, describes the time it takes to run an
algorithm. The time complexity algorithm is the specific time that must elapse before any statement can be
executed. Accordingly, this is highly dependent on the amount of data being processed.

22. What is the principle of optimality in DAA?

When the subsolutions of a problem's optimal solution are also the optimal solutions for their respective
subproblems, we say that the problem satisfies the principle of optimality. It means that the optimal solution
to the problem has subsolutions that satisfy the principle.

Examples: The principle of optimality can be shown to be satisfied by the shortest path problem.

23. What is reliability design in DAA?

The probability that a product will continue to function past the time specified and under the specified
conditions is known as reliability. It implies that even if a keyboard has 99% reliability over 1000 hours, 1% of
those 1000 hours could still see a malfunction.

24. What is the order of growth in DAA?

The order of growth of an algorithm provides a rough estimate of the amount of time needed to execute a
computer program as the size of the input variable increases. The order of growth does not take into
account the constant factor that is required for fixed operations. Instead, it emphasizes the operations that
expand in proportion to the input size.

25. What is the Importance of Algorithms?


An algorithm is merely a procedure for accomplishing a goal. Computers, smartphones, and websites can't
perform their tasks or make decisions without them; they're the foundation of programming. Many of the
activities we engage in daily are, like algorithms, used by technology.

26. Explain the Bubble sort algorithms.

Bubble sorting involves splitting the list into two parts. They are sorted and unsorted. The smallest item in a
sublist that hasn't been sorted is "bubbled." When the smallest piece of the wall is shifted, the entire wall
shifts forward one space. The idea behind bubble sort was to highlight the item at the top of the list in a giant
bubble. It does not matter if the highest or lowest item is bubbled. In this variant, two adjacent components
are switched around based on a comparison. Since bubble sort performs a full array check, sorting a record
with n elements can take up to n-1 iterations.

27. Explain the Quick sort algorithms.

The Quicksort algorithm relies on division to sort the data. The term "partition exchange sorting" is also used
to refer to this technique in some contexts. The quick sort algorithm involves picking one item from an array
and then rearranging the rest of the data so that it revolves around that item. This item caused the initial list
to be divided in half. The "pivot" is the currently chosen option. Any items whose values are less than the
pivot are shifted to the left, and those whose values are more significant than the pivot are shifted to the
right when the pivot is selected. Until sub-lists containing only one item are found, selecting a pivot and
dividing the list is repeated in a while loop.

You might also like