SlideShare a Scribd company logo
1 of 13
COMPLEXITY OF
ALGORITHM AND
COST_TIME TRADE OFF
Introduction
Algorithm
An algorithm is a finite set of well-defined instructions
for accomplishing some task, which given an initial
state, will terminate in a defined end-state.
Complexity of algorithms
Complexity of algorithms
The complexity of an algorithm is a function f (n) which measures
the time and space used by an algorithm in terms of input size n.
In computer science, the complexity of an algorithm is a way
to classify how efficient an algorithm is, compared to alternative
ones. The focus is on how execution time increases with the data
set to be processed.
The computational complexity and efficient implementation of the
algorithm are important in computing, and this depends on
suitable data structures.
Complexity of algorithms
Description of Complexity
Different algorithms may complete the same task with
a different set of instructions in less or more time,
space or effort than other. The analysis and study of
algorithms is a discipline in Computer Science which
has a strong mathematical background. It often relies
on theoretical analysis of pseudo-code. To compare
the efficiency of algorithms, we don't rely on abstract
measures such as the time difference in running
speed, since it too heavily relies on the processor
power and other tasks running in parallel.
Classes of complexity
Polynomial time algorithms
•(C) --- Constant time --- the time necessary to perform
the algorithm does not change in response to the size of
the problem.
•(n) --- Linear time --- the time grows linearly with the size
(n) of the problem.
• (n2) --- Quadratic time --- the time grows quadratically
with the size (n) of the problem
Classes of complexity
Sub-linear time algorithms
• It grow slower than linear time algorithms
• Super-polynomial time algorithms
• It grows faster than polynomial time algorithms.
• Exponential time --- the time required grows
exponentially with the size of the problem.
Example of finding the complexity of an
algorithm
BUBBLE SORT
For ( int I = 0 ; I < 5 ; I ++ )
For ( int j = 0 ; j < 4 ; j ++ )
If (A [ j ] > A [ j + 1 ] ) {
Temp = A [ j ] ;
A [ j ] = A [ j+1 ] ;
A [ j + 1 ] =Temp;
}
Complexity of Bubble Sort
The time for assorting algorithm is measured in the
number of the comparisons. The number of f(n) of
comparisons in the bubble sort is easily computed.
Specifically ,there are n-1 comparisons during the 1st
pass , which places the largest element in the last
position ; there are n-2 comparisons in the 2nd step,
which places the 2nd largest element in the next –to-
last position; and so on.. In other words, the time
required to execute the bubble sort algorithm is
proportional to n2, where n is the number of input
items.
Example of finding the complexity of an
algorithm
Linear Search
Int array[10]={10,20,30,40,50,60,70,80,90,100};
Int I,n, Loc=-1;
Cout<<“Enter the value to find “;
Cin>>n;
For(i=0;I<10;I++)
if(array[I]==n)
Loc=I;
If(Loc==-1)
Cout<<“Value not found”;
Else
Cout<<“The value”<<n<<“is found at index “<<Loc;
Space-time tradeoff
In computer science, a space-time tradeoff refers to a
choice between algorithmic solutions of a data
processing problem that allows one to derease the
running time of an algorithmic solution by increasing
the space to store the data and vice versa.
The computation time can be reduced at the cost of
increased memory use. As the relative costs of CPU
cycles, RAM space, and hard drive space change —
hard drive space has for some time been getting
cheaper at a much faster rate than other components
of computers, the appropriate choices for space-time
tradeoffs have changed radically. Often, by exploiting
a space-time tradeoff, a program can be made to run
much faster.
Space-time tradeoff
A space-time tradeoff can be applied to the
problem of data storage. If data is stored
uncompressed, it takes more space but less time
than if the data were stored compressed (since
compressing the data reduces the amount of
space it takes, but it takes time to run the
compression algorithm). Depending on the
particular instance of the problem, either way is
practical.
Continued…
Larger code size can be traded for higher program
speed when applying loop unwinding. This technique
makes the code longer for each iteration of a loop, but
saves the computation time required for jumping back to
the beginning of the loop at the end of each iteration.
Algorithms that make use of space-time tradeoffs to
achieve better running times include the baby-step
giant-step algorithm for calculating discrete logarithms
Using Genetic Algorithms to Solve
Construction Time-Cost Trade-Off Problems
Existing methods for time-cost trade-off analysis focus
on using heuristics or mathematical programming.
These methods, however, are not efficient enough to
solve large-scale CPM networks (hundreds of activities
or more). Analogous to natural selection and genetics in
reproduction, genetic algorithms (GAs) have been
science and
successfully
engineering
adopted to solve many
problems and have proven to be an
efficient means for searching optimal solutions in a
large problem domain computer program that can
execute the algorithm efficiently.

More Related Content

Similar to algocomplexity cost effective tradeoff in

FALLSEM2022-23_BCSE202L_TH_VL2022230103292_Reference_Material_I_25-07-2022_Fu...
FALLSEM2022-23_BCSE202L_TH_VL2022230103292_Reference_Material_I_25-07-2022_Fu...FALLSEM2022-23_BCSE202L_TH_VL2022230103292_Reference_Material_I_25-07-2022_Fu...
FALLSEM2022-23_BCSE202L_TH_VL2022230103292_Reference_Material_I_25-07-2022_Fu...AntareepMajumder
 
Chapter 1 Data structure.pptx
Chapter 1 Data structure.pptxChapter 1 Data structure.pptx
Chapter 1 Data structure.pptxwondmhunegn
 
TIME EXECUTION OF DIFFERENT SORTED ALGORITHMS
TIME EXECUTION   OF  DIFFERENT SORTED ALGORITHMSTIME EXECUTION   OF  DIFFERENT SORTED ALGORITHMS
TIME EXECUTION OF DIFFERENT SORTED ALGORITHMSTanya Makkar
 
Introduction to data structures and Algorithm
Introduction to data structures and AlgorithmIntroduction to data structures and Algorithm
Introduction to data structures and AlgorithmDhaval Kaneria
 
Cupdf.com introduction to-data-structures-and-algorithm
Cupdf.com introduction to-data-structures-and-algorithmCupdf.com introduction to-data-structures-and-algorithm
Cupdf.com introduction to-data-structures-and-algorithmTarikuDabala1
 
Introduction to data structures and Algorithm
Introduction to data structures and AlgorithmIntroduction to data structures and Algorithm
Introduction to data structures and AlgorithmDhaval Kaneria
 
STATISTICAL APPROACH TO DETERMINE MOST EFFICIENT VALUE FOR TIME QUANTUM IN RO...
STATISTICAL APPROACH TO DETERMINE MOST EFFICIENT VALUE FOR TIME QUANTUM IN RO...STATISTICAL APPROACH TO DETERMINE MOST EFFICIENT VALUE FOR TIME QUANTUM IN RO...
STATISTICAL APPROACH TO DETERMINE MOST EFFICIENT VALUE FOR TIME QUANTUM IN RO...ijcsit
 
Data Structure and Algorithm chapter two, This material is for Data Structure...
Data Structure and Algorithm chapter two, This material is for Data Structure...Data Structure and Algorithm chapter two, This material is for Data Structure...
Data Structure and Algorithm chapter two, This material is for Data Structure...bekidea
 
Algorithm Analysis.pdf
Algorithm Analysis.pdfAlgorithm Analysis.pdf
Algorithm Analysis.pdfMemMem25
 
Fundamentals of the Analysis of Algorithm Efficiency
Fundamentals of the Analysis of Algorithm EfficiencyFundamentals of the Analysis of Algorithm Efficiency
Fundamentals of the Analysis of Algorithm EfficiencySaranya Natarajan
 
DAAMOD12hjsfgi haFIUAFKJNASFQF MNDAF.pdf
DAAMOD12hjsfgi haFIUAFKJNASFQF MNDAF.pdfDAAMOD12hjsfgi haFIUAFKJNASFQF MNDAF.pdf
DAAMOD12hjsfgi haFIUAFKJNASFQF MNDAF.pdfOnkarSalunkhe5
 
2. Introduction to Algorithm.pptx
2. Introduction to Algorithm.pptx2. Introduction to Algorithm.pptx
2. Introduction to Algorithm.pptxRahikAhmed1
 
Data structure and algorithm
Data structure and algorithmData structure and algorithm
Data structure and algorithmTrupti Agrawal
 

Similar to algocomplexity cost effective tradeoff in (20)

Analyzing algorithms
Analyzing algorithmsAnalyzing algorithms
Analyzing algorithms
 
Daa notes 1
Daa notes 1Daa notes 1
Daa notes 1
 
Ds
DsDs
Ds
 
FALLSEM2022-23_BCSE202L_TH_VL2022230103292_Reference_Material_I_25-07-2022_Fu...
FALLSEM2022-23_BCSE202L_TH_VL2022230103292_Reference_Material_I_25-07-2022_Fu...FALLSEM2022-23_BCSE202L_TH_VL2022230103292_Reference_Material_I_25-07-2022_Fu...
FALLSEM2022-23_BCSE202L_TH_VL2022230103292_Reference_Material_I_25-07-2022_Fu...
 
Chapter 1 Data structure.pptx
Chapter 1 Data structure.pptxChapter 1 Data structure.pptx
Chapter 1 Data structure.pptx
 
TIME EXECUTION OF DIFFERENT SORTED ALGORITHMS
TIME EXECUTION   OF  DIFFERENT SORTED ALGORITHMSTIME EXECUTION   OF  DIFFERENT SORTED ALGORITHMS
TIME EXECUTION OF DIFFERENT SORTED ALGORITHMS
 
Introduction to data structures and Algorithm
Introduction to data structures and AlgorithmIntroduction to data structures and Algorithm
Introduction to data structures and Algorithm
 
Cupdf.com introduction to-data-structures-and-algorithm
Cupdf.com introduction to-data-structures-and-algorithmCupdf.com introduction to-data-structures-and-algorithm
Cupdf.com introduction to-data-structures-and-algorithm
 
Introduction to data structures and Algorithm
Introduction to data structures and AlgorithmIntroduction to data structures and Algorithm
Introduction to data structures and Algorithm
 
STATISTICAL APPROACH TO DETERMINE MOST EFFICIENT VALUE FOR TIME QUANTUM IN RO...
STATISTICAL APPROACH TO DETERMINE MOST EFFICIENT VALUE FOR TIME QUANTUM IN RO...STATISTICAL APPROACH TO DETERMINE MOST EFFICIENT VALUE FOR TIME QUANTUM IN RO...
STATISTICAL APPROACH TO DETERMINE MOST EFFICIENT VALUE FOR TIME QUANTUM IN RO...
 
Data Structure and Algorithm chapter two, This material is for Data Structure...
Data Structure and Algorithm chapter two, This material is for Data Structure...Data Structure and Algorithm chapter two, This material is for Data Structure...
Data Structure and Algorithm chapter two, This material is for Data Structure...
 
Python algorithm
Python algorithmPython algorithm
Python algorithm
 
Algorithm Analysis.pdf
Algorithm Analysis.pdfAlgorithm Analysis.pdf
Algorithm Analysis.pdf
 
Fundamentals of the Analysis of Algorithm Efficiency
Fundamentals of the Analysis of Algorithm EfficiencyFundamentals of the Analysis of Algorithm Efficiency
Fundamentals of the Analysis of Algorithm Efficiency
 
Cs 331 Data Structures
Cs 331 Data StructuresCs 331 Data Structures
Cs 331 Data Structures
 
DAAMOD12hjsfgi haFIUAFKJNASFQF MNDAF.pdf
DAAMOD12hjsfgi haFIUAFKJNASFQF MNDAF.pdfDAAMOD12hjsfgi haFIUAFKJNASFQF MNDAF.pdf
DAAMOD12hjsfgi haFIUAFKJNASFQF MNDAF.pdf
 
Time andspacecomplexity
Time andspacecomplexityTime andspacecomplexity
Time andspacecomplexity
 
2. Introduction to Algorithm.pptx
2. Introduction to Algorithm.pptx2. Introduction to Algorithm.pptx
2. Introduction to Algorithm.pptx
 
Data structure and algorithm
Data structure and algorithmData structure and algorithm
Data structure and algorithm
 
Algorithm.pptx
Algorithm.pptxAlgorithm.pptx
Algorithm.pptx
 

More from javed75

Unit-1.pptx final unit new mtech unit thre
Unit-1.pptx final unit new mtech unit threUnit-1.pptx final unit new mtech unit thre
Unit-1.pptx final unit new mtech unit threjaved75
 
javed_prethesis2608 on predcition of heart disease
javed_prethesis2608 on predcition of heart diseasejaved_prethesis2608 on predcition of heart disease
javed_prethesis2608 on predcition of heart diseasejaved75
 
Section 7.5 version 2 AM new ppt for every
Section 7.5 version 2 AM new ppt for everySection 7.5 version 2 AM new ppt for every
Section 7.5 version 2 AM new ppt for everyjaved75
 
Cyber_Security_Awareness_Presentation (1).pptx
Cyber_Security_Awareness_Presentation (1).pptxCyber_Security_Awareness_Presentation (1).pptx
Cyber_Security_Awareness_Presentation (1).pptxjaved75
 
anand ethics ppt for phd scholar integral
anand ethics ppt for phd scholar integralanand ethics ppt for phd scholar integral
anand ethics ppt for phd scholar integraljaved75
 
Data Science.pptx NEW COURICUUMN IN DATA
Data Science.pptx NEW COURICUUMN IN DATAData Science.pptx NEW COURICUUMN IN DATA
Data Science.pptx NEW COURICUUMN IN DATAjaved75
 
1 Basic E-Commerce Concepts for it 2ndt year
1 Basic E-Commerce Concepts for it 2ndt year1 Basic E-Commerce Concepts for it 2ndt year
1 Basic E-Commerce Concepts for it 2ndt yearjaved75
 
UNIT-IV WT web technology for 1st year cs
UNIT-IV WT web technology for 1st year csUNIT-IV WT web technology for 1st year cs
UNIT-IV WT web technology for 1st year csjaved75
 
training about android installation and usa
training about android installation and usatraining about android installation and usa
training about android installation and usajaved75
 
Phd2023-2024cIntegralUniversitynida.pptx
Phd2023-2024cIntegralUniversitynida.pptxPhd2023-2024cIntegralUniversitynida.pptx
Phd2023-2024cIntegralUniversitynida.pptxjaved75
 

More from javed75 (10)

Unit-1.pptx final unit new mtech unit thre
Unit-1.pptx final unit new mtech unit threUnit-1.pptx final unit new mtech unit thre
Unit-1.pptx final unit new mtech unit thre
 
javed_prethesis2608 on predcition of heart disease
javed_prethesis2608 on predcition of heart diseasejaved_prethesis2608 on predcition of heart disease
javed_prethesis2608 on predcition of heart disease
 
Section 7.5 version 2 AM new ppt for every
Section 7.5 version 2 AM new ppt for everySection 7.5 version 2 AM new ppt for every
Section 7.5 version 2 AM new ppt for every
 
Cyber_Security_Awareness_Presentation (1).pptx
Cyber_Security_Awareness_Presentation (1).pptxCyber_Security_Awareness_Presentation (1).pptx
Cyber_Security_Awareness_Presentation (1).pptx
 
anand ethics ppt for phd scholar integral
anand ethics ppt for phd scholar integralanand ethics ppt for phd scholar integral
anand ethics ppt for phd scholar integral
 
Data Science.pptx NEW COURICUUMN IN DATA
Data Science.pptx NEW COURICUUMN IN DATAData Science.pptx NEW COURICUUMN IN DATA
Data Science.pptx NEW COURICUUMN IN DATA
 
1 Basic E-Commerce Concepts for it 2ndt year
1 Basic E-Commerce Concepts for it 2ndt year1 Basic E-Commerce Concepts for it 2ndt year
1 Basic E-Commerce Concepts for it 2ndt year
 
UNIT-IV WT web technology for 1st year cs
UNIT-IV WT web technology for 1st year csUNIT-IV WT web technology for 1st year cs
UNIT-IV WT web technology for 1st year cs
 
training about android installation and usa
training about android installation and usatraining about android installation and usa
training about android installation and usa
 
Phd2023-2024cIntegralUniversitynida.pptx
Phd2023-2024cIntegralUniversitynida.pptxPhd2023-2024cIntegralUniversitynida.pptx
Phd2023-2024cIntegralUniversitynida.pptx
 

Recently uploaded

Customer Service Analytics - Make Sense of All Your Data.pptx
Customer Service Analytics - Make Sense of All Your Data.pptxCustomer Service Analytics - Make Sense of All Your Data.pptx
Customer Service Analytics - Make Sense of All Your Data.pptxEmmanuel Dauda
 
Best VIP Call Girls Noida Sector 39 Call Me: 8448380779
Best VIP Call Girls Noida Sector 39 Call Me: 8448380779Best VIP Call Girls Noida Sector 39 Call Me: 8448380779
Best VIP Call Girls Noida Sector 39 Call Me: 8448380779Delhi Call girls
 
Unveiling Insights: The Role of a Data Analyst
Unveiling Insights: The Role of a Data AnalystUnveiling Insights: The Role of a Data Analyst
Unveiling Insights: The Role of a Data AnalystSamantha Rae Coolbeth
 
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.pptdokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.pptSonatrach
 
High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...
High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...
High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...soniya singh
 
EMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM TRACKING WITH GOOGLE ANALYTICS.pptx
EMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM  TRACKING WITH GOOGLE ANALYTICS.pptxEMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM  TRACKING WITH GOOGLE ANALYTICS.pptx
EMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM TRACKING WITH GOOGLE ANALYTICS.pptxthyngster
 
Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...
Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...
Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...Sapana Sha
 
Call Girls In Mahipalpur O9654467111 Escorts Service
Call Girls In Mahipalpur O9654467111  Escorts ServiceCall Girls In Mahipalpur O9654467111  Escorts Service
Call Girls In Mahipalpur O9654467111 Escorts ServiceSapana Sha
 
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Callshivangimorya083
 
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
RA-11058_IRR-COMPRESS Do 198 series of 1998
RA-11058_IRR-COMPRESS Do 198 series of 1998RA-11058_IRR-COMPRESS Do 198 series of 1998
RA-11058_IRR-COMPRESS Do 198 series of 1998YohFuh
 
FESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfFESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfMarinCaroMartnezBerg
 
Invezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signalsInvezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signalsInvezz1
 
Full night 🥵 Call Girls Delhi New Friends Colony {9711199171} Sanya Reddy ✌️o...
Full night 🥵 Call Girls Delhi New Friends Colony {9711199171} Sanya Reddy ✌️o...Full night 🥵 Call Girls Delhi New Friends Colony {9711199171} Sanya Reddy ✌️o...
Full night 🥵 Call Girls Delhi New Friends Colony {9711199171} Sanya Reddy ✌️o...shivangimorya083
 
B2 Creative Industry Response Evaluation.docx
B2 Creative Industry Response Evaluation.docxB2 Creative Industry Response Evaluation.docx
B2 Creative Industry Response Evaluation.docxStephen266013
 
04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationships04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationshipsccctableauusergroup
 
Dubai Call Girls Wifey O52&786472 Call Girls Dubai
Dubai Call Girls Wifey O52&786472 Call Girls DubaiDubai Call Girls Wifey O52&786472 Call Girls Dubai
Dubai Call Girls Wifey O52&786472 Call Girls Dubaihf8803863
 
Beautiful Sapna Vip Call Girls Hauz Khas 9711199012 Call /Whatsapps
Beautiful Sapna Vip  Call Girls Hauz Khas 9711199012 Call /WhatsappsBeautiful Sapna Vip  Call Girls Hauz Khas 9711199012 Call /Whatsapps
Beautiful Sapna Vip Call Girls Hauz Khas 9711199012 Call /Whatsappssapnasaifi408
 

Recently uploaded (20)

Customer Service Analytics - Make Sense of All Your Data.pptx
Customer Service Analytics - Make Sense of All Your Data.pptxCustomer Service Analytics - Make Sense of All Your Data.pptx
Customer Service Analytics - Make Sense of All Your Data.pptx
 
Best VIP Call Girls Noida Sector 39 Call Me: 8448380779
Best VIP Call Girls Noida Sector 39 Call Me: 8448380779Best VIP Call Girls Noida Sector 39 Call Me: 8448380779
Best VIP Call Girls Noida Sector 39 Call Me: 8448380779
 
Unveiling Insights: The Role of a Data Analyst
Unveiling Insights: The Role of a Data AnalystUnveiling Insights: The Role of a Data Analyst
Unveiling Insights: The Role of a Data Analyst
 
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.pptdokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
 
High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...
High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...
High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...
 
EMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM TRACKING WITH GOOGLE ANALYTICS.pptx
EMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM  TRACKING WITH GOOGLE ANALYTICS.pptxEMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM  TRACKING WITH GOOGLE ANALYTICS.pptx
EMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM TRACKING WITH GOOGLE ANALYTICS.pptx
 
Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...
Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...
Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...
 
Call Girls In Mahipalpur O9654467111 Escorts Service
Call Girls In Mahipalpur O9654467111  Escorts ServiceCall Girls In Mahipalpur O9654467111  Escorts Service
Call Girls In Mahipalpur O9654467111 Escorts Service
 
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
 
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
 
RA-11058_IRR-COMPRESS Do 198 series of 1998
RA-11058_IRR-COMPRESS Do 198 series of 1998RA-11058_IRR-COMPRESS Do 198 series of 1998
RA-11058_IRR-COMPRESS Do 198 series of 1998
 
FESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfFESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdf
 
Invezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signalsInvezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signals
 
Full night 🥵 Call Girls Delhi New Friends Colony {9711199171} Sanya Reddy ✌️o...
Full night 🥵 Call Girls Delhi New Friends Colony {9711199171} Sanya Reddy ✌️o...Full night 🥵 Call Girls Delhi New Friends Colony {9711199171} Sanya Reddy ✌️o...
Full night 🥵 Call Girls Delhi New Friends Colony {9711199171} Sanya Reddy ✌️o...
 
B2 Creative Industry Response Evaluation.docx
B2 Creative Industry Response Evaluation.docxB2 Creative Industry Response Evaluation.docx
B2 Creative Industry Response Evaluation.docx
 
04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationships04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationships
 
E-Commerce Order PredictionShraddha Kamble.pptx
E-Commerce Order PredictionShraddha Kamble.pptxE-Commerce Order PredictionShraddha Kamble.pptx
E-Commerce Order PredictionShraddha Kamble.pptx
 
Dubai Call Girls Wifey O52&786472 Call Girls Dubai
Dubai Call Girls Wifey O52&786472 Call Girls DubaiDubai Call Girls Wifey O52&786472 Call Girls Dubai
Dubai Call Girls Wifey O52&786472 Call Girls Dubai
 
Beautiful Sapna Vip Call Girls Hauz Khas 9711199012 Call /Whatsapps
Beautiful Sapna Vip  Call Girls Hauz Khas 9711199012 Call /WhatsappsBeautiful Sapna Vip  Call Girls Hauz Khas 9711199012 Call /Whatsapps
Beautiful Sapna Vip Call Girls Hauz Khas 9711199012 Call /Whatsapps
 
VIP Call Girls Service Charbagh { Lucknow Call Girls Service 9548273370 } Boo...
VIP Call Girls Service Charbagh { Lucknow Call Girls Service 9548273370 } Boo...VIP Call Girls Service Charbagh { Lucknow Call Girls Service 9548273370 } Boo...
VIP Call Girls Service Charbagh { Lucknow Call Girls Service 9548273370 } Boo...
 

algocomplexity cost effective tradeoff in

  • 2. Introduction Algorithm An algorithm is a finite set of well-defined instructions for accomplishing some task, which given an initial state, will terminate in a defined end-state.
  • 3. Complexity of algorithms Complexity of algorithms The complexity of an algorithm is a function f (n) which measures the time and space used by an algorithm in terms of input size n. In computer science, the complexity of an algorithm is a way to classify how efficient an algorithm is, compared to alternative ones. The focus is on how execution time increases with the data set to be processed. The computational complexity and efficient implementation of the algorithm are important in computing, and this depends on suitable data structures.
  • 4. Complexity of algorithms Description of Complexity Different algorithms may complete the same task with a different set of instructions in less or more time, space or effort than other. The analysis and study of algorithms is a discipline in Computer Science which has a strong mathematical background. It often relies on theoretical analysis of pseudo-code. To compare the efficiency of algorithms, we don't rely on abstract measures such as the time difference in running speed, since it too heavily relies on the processor power and other tasks running in parallel.
  • 5. Classes of complexity Polynomial time algorithms •(C) --- Constant time --- the time necessary to perform the algorithm does not change in response to the size of the problem. •(n) --- Linear time --- the time grows linearly with the size (n) of the problem. • (n2) --- Quadratic time --- the time grows quadratically with the size (n) of the problem
  • 6. Classes of complexity Sub-linear time algorithms • It grow slower than linear time algorithms • Super-polynomial time algorithms • It grows faster than polynomial time algorithms. • Exponential time --- the time required grows exponentially with the size of the problem.
  • 7. Example of finding the complexity of an algorithm BUBBLE SORT For ( int I = 0 ; I < 5 ; I ++ ) For ( int j = 0 ; j < 4 ; j ++ ) If (A [ j ] > A [ j + 1 ] ) { Temp = A [ j ] ; A [ j ] = A [ j+1 ] ; A [ j + 1 ] =Temp; }
  • 8. Complexity of Bubble Sort The time for assorting algorithm is measured in the number of the comparisons. The number of f(n) of comparisons in the bubble sort is easily computed. Specifically ,there are n-1 comparisons during the 1st pass , which places the largest element in the last position ; there are n-2 comparisons in the 2nd step, which places the 2nd largest element in the next –to- last position; and so on.. In other words, the time required to execute the bubble sort algorithm is proportional to n2, where n is the number of input items.
  • 9. Example of finding the complexity of an algorithm Linear Search Int array[10]={10,20,30,40,50,60,70,80,90,100}; Int I,n, Loc=-1; Cout<<“Enter the value to find “; Cin>>n; For(i=0;I<10;I++) if(array[I]==n) Loc=I; If(Loc==-1) Cout<<“Value not found”; Else Cout<<“The value”<<n<<“is found at index “<<Loc;
  • 10. Space-time tradeoff In computer science, a space-time tradeoff refers to a choice between algorithmic solutions of a data processing problem that allows one to derease the running time of an algorithmic solution by increasing the space to store the data and vice versa. The computation time can be reduced at the cost of increased memory use. As the relative costs of CPU cycles, RAM space, and hard drive space change — hard drive space has for some time been getting cheaper at a much faster rate than other components of computers, the appropriate choices for space-time tradeoffs have changed radically. Often, by exploiting a space-time tradeoff, a program can be made to run much faster.
  • 11. Space-time tradeoff A space-time tradeoff can be applied to the problem of data storage. If data is stored uncompressed, it takes more space but less time than if the data were stored compressed (since compressing the data reduces the amount of space it takes, but it takes time to run the compression algorithm). Depending on the particular instance of the problem, either way is practical.
  • 12. Continued… Larger code size can be traded for higher program speed when applying loop unwinding. This technique makes the code longer for each iteration of a loop, but saves the computation time required for jumping back to the beginning of the loop at the end of each iteration. Algorithms that make use of space-time tradeoffs to achieve better running times include the baby-step giant-step algorithm for calculating discrete logarithms
  • 13. Using Genetic Algorithms to Solve Construction Time-Cost Trade-Off Problems Existing methods for time-cost trade-off analysis focus on using heuristics or mathematical programming. These methods, however, are not efficient enough to solve large-scale CPM networks (hundreds of activities or more). Analogous to natural selection and genetics in reproduction, genetic algorithms (GAs) have been science and successfully engineering adopted to solve many problems and have proven to be an efficient means for searching optimal solutions in a large problem domain computer program that can execute the algorithm efficiently.