DAA unit 1
DAA unit 1
1. Algorithms
Algorithm design techniques are general methods used to create algorithms. The
main techniques include:
(a) Brute Force
Makes the locally optimal choice at each step with the hope of finding a global
optimum.
Tries all possible solutions and abandons those that fail constraints.
4. Analyzing Algorithms
Time Complexity: How does the execution time grow with input size?
Definition: Provides a tight bound (both upper and lower) on the running
time.
Example: If an algorithm runs in both O(f(n))O(f(n))O(f(n)) and
Ω(f(n))\Omega(f(n))Ω(f(n)), it is Θ(f(n))\Theta(f(n))Θ(f(n)).
Conclusion
Understanding algorithms, their analysis, and different data structures is crucial for
solving computational problems efficiently. Asymptotic notations provide a
mathematical way to compare algorithm efficiency and help in selecting the best
algorithm for a given problem.