0% found this document useful (0 votes)
5 views20 pages

1.2.1 C. Algorithm Complexity

The document outlines the vision, mission, program outcomes, educational objectives, and specific outcomes for the Bachelor of Computer Application in Data Structures at the University Institute of Computing. It emphasizes experiential learning, innovative teaching methods, and the importance of algorithmic complexity, including time and space complexities, in solving computational problems. Additionally, it provides references for textbooks and video resources related to the subject.

Uploaded by

wiyijag354
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views20 pages

1.2.1 C. Algorithm Complexity

The document outlines the vision, mission, program outcomes, educational objectives, and specific outcomes for the Bachelor of Computer Application in Data Structures at the University Institute of Computing. It emphasizes experiential learning, innovative teaching methods, and the importance of algorithmic complexity, including time and space complexities, in solving computational problems. Additionally, it provides references for textbooks and video resources related to the subject.

Uploaded by

wiyijag354
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 20

UNIVERSITY INSTITUTE OF COMPUTING

Bachelor of Computer Application


Subject Name: Data Structure
24CAP-151/24SCT-151
VISION

To be a Centre of Excellence for nurturing computer professionals with


strong application expertise through experiential learning and research
for matching the requirements of industry and society instilling in them
the spirit of innovation and entrepreneurship.

2
Mission of the Department

M1. To provide innovative learning centric facilities and quality-


oriented teaching learning process for solving computational problems.
M2. To provide a frame work through Project Based Learning to
support society and industry in promoting a multidisciplinary activity.
M3. To develop crystal clear evaluation system and experiential
learning mechanism aligned with futuristic technologies and industry.
M4. To provide doorway for promoting research, innovation and
entrepreneurship skills incollaboration with industry and academia.
M5. To undertake societal activities for upliftment of rural/deprived
sections of the society.
3
Program Outcomes
• PO1 Apply mathematics and computing fundamental and domain concepts to find out the solution of defined problems and requirements. (Computational
Knowledge)
• PO2 Use fundamental principle of Mathematics and Computing to identify, formulate research literature for solving complex problems, reaching appropriate
solutions. (Problem Analysis)
• PO3 Understand to design, analyze and develop solutions and evaluate system components or processes to meet specific need for local, regional and global public
health, societal, cultural, and environmental systems.
• PO4 (Design /Development of Solutions)Use expertise research-based knowledge and methods including skills for analysis and development of information to
reach valid conclusions. (Conduct Investigations of Complex Computing Problems)
• PO5 Adapt, apply appropriate modern computing tools and techniques to solve computing activities keeping in view the limitations. (Modern Tool Usage)
• PO6 Exhibiting ethics for regulations, responsibilities and norms in professional computing practices. (Professional Ethics)
• PO7 Enlighten knowledge to enhance understanding and building research, strategies in independent learning for continual development as computer applications
professional. (Life-long Learning)
• PO8 Establishing strategies in developing and implementing ideas in multi- disciplinary environments using computing and management skills as a member or
leader in a team. (Project Management and Finance)
• PO9 Contribute to progressive community and society in comprehending computing activities by writing effective reports, designing documentation, making
effective presentation, and understand instructions. (Communication Efficacy)
• PO10 Apply mathematics and computing knowledge to access and solve issues relating to health, safety, societal, environmental, legal, and cultural issues within
local, regional and global context. (Societal and Environmental Concern)
• PO11 Gain confidence for self and continuous learning to improve knowledge and competence as a member or leader of a team. (Individual and Teamwork)
• PO12 Learn to innovate, design and develop solutions for solving real life business problems and addressing business development issues with a passion for quality
competency and holistic approach. (Innovation and Entrepreneurship)

4
Program Educational Objectives

PEO1 Demonstrate analytical and design skills including the ability to generate creative solutions and foster
team-oriented professionalism through effective communication in their careers.
PEO2 Expertise in successful careers based on their understanding of formal and practical methods of
application development using the concept of computer programming languages and design principles in
accordance to industry 4.0
PEO3 Exhibit the growth of the nation and society by implementing and acquiring knowledge of upliftment of
health, safety and other societal issues.
PEO4 Implement their exhibiting critical thinking and problem- solving skills in professional practices or tackle
social, technical and business challenges.

5
Program Specific Outcomes

PSO1 Analyze their abilities in systematic planning, developing, testing


and executing complex computing applications in field of Social-Media
and Analytics, Web Application Development and Data Interpretations.
PSO2 Apprise in-depth expertise and sustainable learning that
contributes to multi-disciplinary creativity, permutation, modernization
and study to address global interest.

6
Topic To be Covered

• Algorithmic Complexity (CO3)


Algorithmic complexity
• Algorithmic complexity refers to the analysis of the computational
resources required by an algorithm to solve a problem as a function of
the size of the input.
• The two primary types of algorithmic complexity are time complexity
and space complexity. Understanding algorithmic complexity helps in
predicting the performance and efficiency of algorithms, particularly
as the size of the input grows.
• Two Types of complexity
Time complexity
Space complexity
Time Complexity
• Time complexity measures the amount of time an algorithm takes to
complete as a function of the length of the input.
• It is typically expressed using Big O notation, which describes the
upper bound of the algorithm's running time.
• Common Time Complexities:
O(1) - Constant Time
O(log n) - Logarithmic Time
O( n ) - Linear Time
O(n log n) - Linearithmic Time
O(n^2) - Quadratic Time
O(2^n) - Exponential Time
Common Time Complexities:
• O(1) - Constant Time: The O(log n) - Logarithmic Time: The algorithm's running
time grows logarithmically with the input size. This is
algorithm takes the same common in algorithms that divide the problem in half
each step, such as binary search.
amount of time regardless of
int binarySearch(int arr[], int n, int target) {
the input size. int left = 0, right = n - 1;
while (left <= right) {
int mid = left + (right - left) / 2;
int getFirstElement(int arr[]) if (arr[mid] == target)
{ return mid;
if (arr[mid] < target)
return arr[0]; left = mid + 1;
else
}
right = mid - 1;
}
return -1;
}
O( n ) - Linear Time O(n log n) - Linearithmic Time
• The algorithm's running time • The algorithm's running time grows in
grows linearly with the input proportion to n log n. This is typical
size. for efficient sorting algorithms like
mergesort and heapsort.
int sumArray(int arr[], int n) void mergeSort(int arr[], int l, int r)
{ {
int sum = 0; if (l >= r) return;
for (int i = 0; i < n; i++) { int m = l + (r - l) / 2;
sum += arr[i]; mergeSort(arr, l, m);
mergeSort(arr, m + 1, r);
}
merge(arr, l, m, r);
return sum;
}
}
O(n^2) - Quadratic Time O(2^n) - Exponential Time
• The algorithm's running time grows • The algorithm's running time
quadratically with the input size. This is
common in simple sorting algorithms like doubles with each additional
bubble sort, insertion sort, and selection element in the input. This is
sort. typical for algorithms that solve
void bubbleSort(int arr[], int n) { problems with recursive
for (int i = 0; i < n-1; i++) { structures and extensive
for (int j = 0; j < n-i-1; j++) { branching, such as certain
if (arr[j] > arr[j+1]) { combinatorial problems.
int temp = arr[j];
arr[j] = arr[j+1]; int fib(int n) {
arr[j+1] = temp; if (n <= 1) return n;
}
return fib(n-1) + fib(n-2);
}
}} }
Space Complexity
• Space complexity measures the amount of memory an algorithm uses
as a function of the length of the input. It includes the space needed
for the input, auxiliary space, and call stack space for recursive
algorithms.
• Common Space Complexities:
O(1) - Constant Space
O( n ) - Linear Space
O(n^2) - Quadratic Space
O(1) - Constant Space O(n ) - Linear Space

• The algorithm uses a fixed • The algorithm's memory usage


amount of space regardless of grows linearly with the input
the input size. size.
void printFirstElement(int arr[]) int* createArray(int n)
{ {
std::cout << arr[0] << std::endl; return new int[n];
} }
O(n^2) - Quadratic Space

• The algorithm's memory usage grows quadratically with the input size. This
is less common but can occur in certain graph algorithms or dynamic
programming problems with two-dimensional tables.
int** createMatrix(int n) {
int** matrix = new int*[n];
for (int i = 0; i < n; ++i) {
matrix[i] = new int[n];
}
return matrix;
}
Best Case, Worst Case, and Average Case
Analysis

Algorithms may exhibit different performance characteristics


depending on the nature of the input data:
• Best Case: The scenario where the algorithm performs the minimum
number of operations.
• Worst Case: The scenario where the algorithm performs the
maximum number of operations.
• Average Case: The expected scenario considering all possible inputs,
providing a more realistic measure of an algorithm's performance.
Practical Applications

• Understanding algorithmic complexity helps in:


• Choosing the most efficient algorithm for a given problem.
• Predicting the algorithm's behavior on large inputs.
• Optimizing existing algorithms for better performance.
Book References
TEXT BOOKS
• Seymour Lipchitz, Schaum's Outlines Series Data Structures TMH. J.P. Hayes,
Computer Organization and Architecture, Third Edition, TMH.
• Data Structure Theory Problem and Algorithms, R.S. Salaria, Khanna Book
Publishing Company, Delhi.
REFERENCE BOOKS
• Introduction to Data Structures Applications, Trembley&Soreson, Second
Edition, Pearson Education Robert L. Britton, MIPS Assembly Language
Programming, Pearson Prentice Hall.
• A. Tanenbaum, Y. Lanhgsam and A. J. Augenstein, Data Structures Using C++,
Prentice Hall of India, 1990
Video Links

https://www.youtube.com/watch?v=ZniDyolzrBw
THANK YOU

Created by: Mehak Bhatia (E16757)


[email protected]

You might also like