1.Introduction to Alg Analysis
1.Introduction to Alg Analysis
Dr. S. Vidhusha
Array
Abstract
Data Type
Classification of Data Structures
Time Complexity
Complexity
Analysis
Space Complexity
Definition of an Algorithm
•It’s a way of organizing, storing and retrieving data and their relationship with each
other.
Array
Linked List
Stack
Queue
Tree
Why Data Structures?
Accessing each record exactly once so that certain items in the record may be processed
2) Searching
Finding the location of the record with the given key value or finding the location of all records which satisfy one or more conditions
3) Insertion
4) Deletion
5) Sorting
6) Merging
Combining records from two or more files or data structures into a single structure.
Approaches in Solving a Problem
Measuring Efficiency
• The efficiency of an algorithm is a measure of the amount of resources consumed in
solving a problem of size n.
• The resource we are most interested in is time.
• We can use the same techniques to analyze the consumption of other resources, such as
memory space.
Running Time of an Algorithm
Generally time grows with size of input, so running time of an algorithm is usually
measured as function of input size.
• If,
N = 10 => 53 steps
1. Big-oh notation (O)-Worst case running time of an algorithm concerned with large values of N.
2. Big-omega notation (Ω)-Best case running time of an algorithm concerned with large values of N.
3. Big-theta notation ) - Average case running time of an algorithm concerned with large values of N
4. Little-oh notation (o)-Worst case running time of an algorithm concerned with small values of N.
Classifications of Algorithm Analysis