Coconote
AI notes
AI voice & video notes
Try for free
📘
Definition and Characteristics of Algorithms
Jul 21, 2024
Definition and Characteristics of Algorithms
What is an Algorithm?
A finite set of steps to solve a particular problem.
Can be written in any programming language (C, Java, Python) or in layman terms as steps.
Example: Sum of two numbers
Step 1: Read A
Step 2: Read B
Step 3: Sum = A + B
Step 4: Print Sum
Characteristics of an Algorithm
Finite Steps
Must contain a finite number of steps/instructions.
Each instruction should take a finite amount of time.
Unambiguous
Instructions should be clear and unambiguous.
Use relevant and correct symbols.
Analysis
Process of comparing two algorithms.
Involves constraints like time, space, number of registers, and network bandwidth.
Most important parameters: Time and Space.
Types of Analysis
Priory Analysis
Analysis before execution.
Independent of hardware.
Calculate the number of iterations.
Example: Time complexity in terms of iterations.
Posterior Analysis
Analysis after execution.
Dependent on hardware.
Measures exact time taken (e.g., 0.4 seconds).
Example: Program execution time varies with hardware.
Comparison of Priory and Posterior Analysis
Priory gives an approximate value.
Posterior gives an exact value but is hardware-dependent.
Priory is preferred due to its hardware independence and uniform values.
Asymptotic Notations
Used to represent time complexity.
Types:
Big O notation
Big Omega
Theta
Small o
Small omega
Upcoming Topics
Detailed explanation of asymptotic notations in the next video.
Thank you!
📄
Full transcript