SlideShare une entreprise Scribd logo
1  sur  18
Télécharger pour lire hors ligne
Juan Lopes
github.com
twitter.com   /juanplopes
for(int i = 0; i < 30000; i++)
    s += “whatever”;
var builder = new StringBuilder();
for(int i = 0; i < 30000; i++)
    builder.Append(“whatever”);

s = builder.ToString();
var builder = new StringBuilder();
builder.Append(“whatever”);
builder.Append(“whatever”);
s = builder.ToString();
n        tempo
     5         175
    10         700
    15        1575
    20        2800
    25        4375
    30        6300
    35        8575
    50       17500
                                       tempo
                     20000

                     15000

                     10000
                                                        tempo

                     5000

                         0
                             5   10 15 20 25 30 35 50
n
for(int i = 0; i < ; i++)
    s += “whatever”;




  O(n)?
for(int i = 0; i < ; i++)  n
    s += “whatever”;


  i        len(s)       custo
  0        0            L
  1        L            2*L
  2        2*L          3*L
                    …
  n        n*L          (n+1)*L
                         n²  n
                                L
  Total:                    2
n
for(int i = 0; i < ; i++)
    s += “whatever”;




  O(n²L)!
Dr. Donald E.

                   Knuth
“Programmers waste enormous amounts of time thinking about, or worrying
 about, the speed of noncritical parts of their programs, and these attempts
  at efficiency actually have a strong negative impact when debugging and
                          maintenance are considered.
  We should forget about small efficiencies, say about
                   97% of the time:
 premature optimization is the root of all evil.
      Yet we should not pass up our opportunities in that critical 3%.”
Vilfredo

Pareto

           20%


                 Alguma coisa
                 Outra coisa
80%
LT 03 - Juan Lopes - Complexidade algoritmos
LT 03 - Juan Lopes - Complexidade algoritmos

Contenu connexe

Tendances

Palindrome number program c
Palindrome number program cPalindrome number program c
Palindrome number program cmohdshanu
 
C programming codes for the class assignment
C programming codes for the class assignmentC programming codes for the class assignment
C programming codes for the class assignmentZenith SVG
 
New microsoft office word document
New microsoft office word documentNew microsoft office word document
New microsoft office word documentSyed Umair
 
Maple Code for Steepest Descent
Maple Code for Steepest DescentMaple Code for Steepest Descent
Maple Code for Steepest DescentJeremy Lane
 
C++ question 6 || solution of Programming Problem
C++ question 6 || solution of Programming Problem C++ question 6 || solution of Programming Problem
C++ question 6 || solution of Programming Problem Topics MixeR
 
คำสั่ง For
คำสั่ง Forคำสั่ง For
คำสั่ง Forkramsri
 
Bcsl 033 data and file structures lab s5-3
Bcsl 033 data and file structures lab s5-3Bcsl 033 data and file structures lab s5-3
Bcsl 033 data and file structures lab s5-3Dr. Loganathan R
 
C program to add two numbers
C program to add two numbers C program to add two numbers
C program to add two numbers mohdshanu
 
One dimensional operation of Array in C- language
One dimensional operation of Array in C- language One dimensional operation of Array in C- language
One dimensional operation of Array in C- language 9096308941
 
Bcsl 033 data and file structures lab s1-1
Bcsl 033 data and file structures lab s1-1Bcsl 033 data and file structures lab s1-1
Bcsl 033 data and file structures lab s1-1Dr. Loganathan R
 
Program in ‘C’ language to implement linear search using pointers
Program in ‘C’ language to implement linear search using pointersProgram in ‘C’ language to implement linear search using pointers
Program in ‘C’ language to implement linear search using pointersDr. Loganathan R
 
Bcsl 033 data and file structures lab s1-4
Bcsl 033 data and file structures lab s1-4Bcsl 033 data and file structures lab s1-4
Bcsl 033 data and file structures lab s1-4Dr. Loganathan R
 
Bcsl 033 data and file structures lab s2-2
Bcsl 033 data and file structures lab s2-2Bcsl 033 data and file structures lab s2-2
Bcsl 033 data and file structures lab s2-2Dr. Loganathan R
 
Dti2143 lab sheet 9
Dti2143 lab sheet 9Dti2143 lab sheet 9
Dti2143 lab sheet 9alish sha
 
Bti1022 lab sheet 9 10
Bti1022 lab sheet 9 10Bti1022 lab sheet 9 10
Bti1022 lab sheet 9 10alish sha
 

Tendances (20)

Palindrome number program c
Palindrome number program cPalindrome number program c
Palindrome number program c
 
C programming codes for the class assignment
C programming codes for the class assignmentC programming codes for the class assignment
C programming codes for the class assignment
 
New microsoft office word document
New microsoft office word documentNew microsoft office word document
New microsoft office word document
 
Maple Code for Steepest Descent
Maple Code for Steepest DescentMaple Code for Steepest Descent
Maple Code for Steepest Descent
 
C++ question 6 || solution of Programming Problem
C++ question 6 || solution of Programming Problem C++ question 6 || solution of Programming Problem
C++ question 6 || solution of Programming Problem
 
C programs pbq final
C programs pbq finalC programs pbq final
C programs pbq final
 
week-23x
week-23xweek-23x
week-23x
 
คำสั่ง For
คำสั่ง Forคำสั่ง For
คำสั่ง For
 
Bcsl 033 data and file structures lab s5-3
Bcsl 033 data and file structures lab s5-3Bcsl 033 data and file structures lab s5-3
Bcsl 033 data and file structures lab s5-3
 
C program to add two numbers
C program to add two numbers C program to add two numbers
C program to add two numbers
 
One dimensional operation of Array in C- language
One dimensional operation of Array in C- language One dimensional operation of Array in C- language
One dimensional operation of Array in C- language
 
Bcsl 033 data and file structures lab s1-1
Bcsl 033 data and file structures lab s1-1Bcsl 033 data and file structures lab s1-1
Bcsl 033 data and file structures lab s1-1
 
Program in ‘C’ language to implement linear search using pointers
Program in ‘C’ language to implement linear search using pointersProgram in ‘C’ language to implement linear search using pointers
Program in ‘C’ language to implement linear search using pointers
 
Bcsl 033 data and file structures lab s1-4
Bcsl 033 data and file structures lab s1-4Bcsl 033 data and file structures lab s1-4
Bcsl 033 data and file structures lab s1-4
 
Bcsl 033 data and file structures lab s2-2
Bcsl 033 data and file structures lab s2-2Bcsl 033 data and file structures lab s2-2
Bcsl 033 data and file structures lab s2-2
 
Dti2143 lab sheet 9
Dti2143 lab sheet 9Dti2143 lab sheet 9
Dti2143 lab sheet 9
 
Bti1022 lab sheet 9 10
Bti1022 lab sheet 9 10Bti1022 lab sheet 9 10
Bti1022 lab sheet 9 10
 
week-22x
week-22xweek-22x
week-22x
 
Faisal
FaisalFaisal
Faisal
 
Python program
Python programPython program
Python program
 

En vedette

Começando com Git
Começando com GitComeçando com Git
Começando com GitDaniel Costa
 
LT 09 - Victor Cavalcante - Arquitetura não é só server side
LT 09 - Victor Cavalcante - Arquitetura não é só server sideLT 09 - Victor Cavalcante - Arquitetura não é só server side
LT 09 - Victor Cavalcante - Arquitetura não é só server sideDNAD
 
LT 08 - Guilherme Silveira - Cache hipermidia
LT 08 - Guilherme Silveira - Cache hipermidiaLT 08 - Guilherme Silveira - Cache hipermidia
LT 08 - Guilherme Silveira - Cache hipermidiaDNAD
 
09 - Fábio Akita - Além do rails
09 - Fábio Akita - Além do rails09 - Fábio Akita - Além do rails
09 - Fábio Akita - Além do railsDNAD
 
LT 05 - Ismael Apolinário - Importancia participacao cliente
LT 05 - Ismael Apolinário - Importancia participacao clienteLT 05 - Ismael Apolinário - Importancia participacao cliente
LT 05 - Ismael Apolinário - Importancia participacao clienteDNAD
 
0210 bloqueando a opção salvar como
0210 bloqueando a opção salvar como0210 bloqueando a opção salvar como
0210 bloqueando a opção salvar comoAdilson Soledade
 

En vedette (7)

Começando com Git
Começando com GitComeçando com Git
Começando com Git
 
LT 09 - Victor Cavalcante - Arquitetura não é só server side
LT 09 - Victor Cavalcante - Arquitetura não é só server sideLT 09 - Victor Cavalcante - Arquitetura não é só server side
LT 09 - Victor Cavalcante - Arquitetura não é só server side
 
LT 08 - Guilherme Silveira - Cache hipermidia
LT 08 - Guilherme Silveira - Cache hipermidiaLT 08 - Guilherme Silveira - Cache hipermidia
LT 08 - Guilherme Silveira - Cache hipermidia
 
09 - Fábio Akita - Além do rails
09 - Fábio Akita - Além do rails09 - Fábio Akita - Além do rails
09 - Fábio Akita - Além do rails
 
Git 101
Git 101Git 101
Git 101
 
LT 05 - Ismael Apolinário - Importancia participacao cliente
LT 05 - Ismael Apolinário - Importancia participacao clienteLT 05 - Ismael Apolinário - Importancia participacao cliente
LT 05 - Ismael Apolinário - Importancia participacao cliente
 
0210 bloqueando a opção salvar como
0210 bloqueando a opção salvar como0210 bloqueando a opção salvar como
0210 bloqueando a opção salvar como
 

Similaire à LT 03 - Juan Lopes - Complexidade algoritmos

Daapracticals 111105084852-phpapp02
Daapracticals 111105084852-phpapp02Daapracticals 111105084852-phpapp02
Daapracticals 111105084852-phpapp02Er Ritu Aggarwal
 
Cluj.py Meetup: Extending Python in C
Cluj.py Meetup: Extending Python in CCluj.py Meetup: Extending Python in C
Cluj.py Meetup: Extending Python in CSteffen Wenz
 
C++ Code as Seen by a Hypercritical Reviewer
C++ Code as Seen by a Hypercritical ReviewerC++ Code as Seen by a Hypercritical Reviewer
C++ Code as Seen by a Hypercritical ReviewerAndrey Karpov
 
PVS-Studio team experience: checking various open source projects, or mistake...
PVS-Studio team experience: checking various open source projects, or mistake...PVS-Studio team experience: checking various open source projects, or mistake...
PVS-Studio team experience: checking various open source projects, or mistake...Andrey Karpov
 
Python Performance 101
Python Performance 101Python Performance 101
Python Performance 101Ankur Gupta
 
Python Conditionals and Functions
Python Conditionals and FunctionsPython Conditionals and Functions
Python Conditionals and FunctionsPooja B S
 
Go vs C++ - CppRussia 2019 Piter BoF
Go vs C++ - CppRussia 2019 Piter BoFGo vs C++ - CppRussia 2019 Piter BoF
Go vs C++ - CppRussia 2019 Piter BoFTimur Safin
 
C++17 not your father’s c++
C++17  not your father’s c++C++17  not your father’s c++
C++17 not your father’s c++Patrick Viafore
 
Bti1022 lab sheet 8
Bti1022 lab sheet 8Bti1022 lab sheet 8
Bti1022 lab sheet 8alish sha
 
B.Com 1year Lab programs
B.Com 1year Lab programsB.Com 1year Lab programs
B.Com 1year Lab programsPrasadu Peddi
 
Gentle Introduction to Functional Programming
Gentle Introduction to Functional ProgrammingGentle Introduction to Functional Programming
Gentle Introduction to Functional ProgrammingSaurabh Singh
 
Lab manual operating system [cs 502 rgpv] (usefulsearch.org) (useful search)
Lab manual operating system [cs 502 rgpv] (usefulsearch.org)  (useful search)Lab manual operating system [cs 502 rgpv] (usefulsearch.org)  (useful search)
Lab manual operating system [cs 502 rgpv] (usefulsearch.org) (useful search)Make Mannan
 
oop presentation note
oop presentation note oop presentation note
oop presentation note Atit Patumvan
 
Functional Programming Patterns (NDC London 2014)
Functional Programming Patterns (NDC London 2014)Functional Programming Patterns (NDC London 2014)
Functional Programming Patterns (NDC London 2014)Scott Wlaschin
 

Similaire à LT 03 - Juan Lopes - Complexidade algoritmos (20)

C programs
C programsC programs
C programs
 
Daapracticals 111105084852-phpapp02
Daapracticals 111105084852-phpapp02Daapracticals 111105084852-phpapp02
Daapracticals 111105084852-phpapp02
 
Cluj.py Meetup: Extending Python in C
Cluj.py Meetup: Extending Python in CCluj.py Meetup: Extending Python in C
Cluj.py Meetup: Extending Python in C
 
C questions
C questionsC questions
C questions
 
Python
PythonPython
Python
 
Vcs5
Vcs5Vcs5
Vcs5
 
C++ Code as Seen by a Hypercritical Reviewer
C++ Code as Seen by a Hypercritical ReviewerC++ Code as Seen by a Hypercritical Reviewer
C++ Code as Seen by a Hypercritical Reviewer
 
Lập trình C
Lập trình CLập trình C
Lập trình C
 
PVS-Studio team experience: checking various open source projects, or mistake...
PVS-Studio team experience: checking various open source projects, or mistake...PVS-Studio team experience: checking various open source projects, or mistake...
PVS-Studio team experience: checking various open source projects, or mistake...
 
Python Performance 101
Python Performance 101Python Performance 101
Python Performance 101
 
Python Conditionals and Functions
Python Conditionals and FunctionsPython Conditionals and Functions
Python Conditionals and Functions
 
Go vs C++ - CppRussia 2019 Piter BoF
Go vs C++ - CppRussia 2019 Piter BoFGo vs C++ - CppRussia 2019 Piter BoF
Go vs C++ - CppRussia 2019 Piter BoF
 
Time complexity
Time complexityTime complexity
Time complexity
 
C++17 not your father’s c++
C++17  not your father’s c++C++17  not your father’s c++
C++17 not your father’s c++
 
Bti1022 lab sheet 8
Bti1022 lab sheet 8Bti1022 lab sheet 8
Bti1022 lab sheet 8
 
B.Com 1year Lab programs
B.Com 1year Lab programsB.Com 1year Lab programs
B.Com 1year Lab programs
 
Gentle Introduction to Functional Programming
Gentle Introduction to Functional ProgrammingGentle Introduction to Functional Programming
Gentle Introduction to Functional Programming
 
Lab manual operating system [cs 502 rgpv] (usefulsearch.org) (useful search)
Lab manual operating system [cs 502 rgpv] (usefulsearch.org)  (useful search)Lab manual operating system [cs 502 rgpv] (usefulsearch.org)  (useful search)
Lab manual operating system [cs 502 rgpv] (usefulsearch.org) (useful search)
 
oop presentation note
oop presentation note oop presentation note
oop presentation note
 
Functional Programming Patterns (NDC London 2014)
Functional Programming Patterns (NDC London 2014)Functional Programming Patterns (NDC London 2014)
Functional Programming Patterns (NDC London 2014)
 

Plus de DNAD

LT 07 - Glauber de Almeida - DRY
LT 07 - Glauber de Almeida - DRYLT 07 - Glauber de Almeida - DRY
LT 07 - Glauber de Almeida - DRYDNAD
 
LT 06 - Douglas Aguiar - Quem nao se comunica se trumbica
LT 06 - Douglas Aguiar - Quem nao se comunica se trumbicaLT 06 - Douglas Aguiar - Quem nao se comunica se trumbica
LT 06 - Douglas Aguiar - Quem nao se comunica se trumbicaDNAD
 
LT 02 - Rodrigo Kumpera - Rodando c sharp
LT 02 - Rodrigo Kumpera - Rodando c sharpLT 02 - Rodrigo Kumpera - Rodando c sharp
LT 02 - Rodrigo Kumpera - Rodando c sharpDNAD
 
LT 01 - Rodrigo Yoshima - Business vsarchitecture
LT 01 - Rodrigo Yoshima - Business vsarchitectureLT 01 - Rodrigo Yoshima - Business vsarchitecture
LT 01 - Rodrigo Yoshima - Business vsarchitectureDNAD
 
LT 04 - Denis Ferrari - Como lidar com as dificuldades da primeira sprint - dnad
LT 04 - Denis Ferrari - Como lidar com as dificuldades da primeira sprint - dnadLT 04 - Denis Ferrari - Como lidar com as dificuldades da primeira sprint - dnad
LT 04 - Denis Ferrari - Como lidar com as dificuldades da primeira sprint - dnadDNAD
 
02a - Leandro Daniel - Examinando a arquitetura evolucionária
02a -  Leandro Daniel - Examinando a arquitetura evolucionária02a -  Leandro Daniel - Examinando a arquitetura evolucionária
02a - Leandro Daniel - Examinando a arquitetura evolucionáriaDNAD
 
07 - Osvaldo Daibert - Cenários para cache de dados distribuidos
07  - Osvaldo Daibert - Cenários para cache de dados distribuidos07  - Osvaldo Daibert - Cenários para cache de dados distribuidos
07 - Osvaldo Daibert - Cenários para cache de dados distribuidosDNAD
 
08 - Otavio Pecego - Arquitetura e nuvem: o que muda?
08 - Otavio Pecego - Arquitetura e nuvem: o que muda?08 - Otavio Pecego - Arquitetura e nuvem: o que muda?
08 - Otavio Pecego - Arquitetura e nuvem: o que muda?DNAD
 
06 - Giovanni Bassi - CQS, CQRS, DDD, DbC, DDDD
06 - Giovanni Bassi - CQS, CQRS, DDD, DbC, DDDD06 - Giovanni Bassi - CQS, CQRS, DDD, DbC, DDDD
06 - Giovanni Bassi - CQS, CQRS, DDD, DbC, DDDDDNAD
 
05 - Waldemir Cambiucci - Matriz de habilidades de um arquiteto TI
05 - Waldemir Cambiucci - Matriz de habilidades de um arquiteto TI05 - Waldemir Cambiucci - Matriz de habilidades de um arquiteto TI
05 - Waldemir Cambiucci - Matriz de habilidades de um arquiteto TIDNAD
 
02c - Vinicius Quaiato - Over Patternization, YAGNI, KISS
02c - Vinicius Quaiato - Over Patternization, YAGNI, KISS02c - Vinicius Quaiato - Over Patternization, YAGNI, KISS
02c - Vinicius Quaiato - Over Patternization, YAGNI, KISSDNAD
 
02b - Elemar Jr. - Examinando a Arquitetura Evolucionária
02b  - Elemar Jr. - Examinando a Arquitetura Evolucionária02b  - Elemar Jr. - Examinando a Arquitetura Evolucionária
02b - Elemar Jr. - Examinando a Arquitetura EvolucionáriaDNAD
 
04 - Felipe Oliveira - Think Decoupled! (SOA)
04 - Felipe Oliveira - Think Decoupled! (SOA)04 - Felipe Oliveira - Think Decoupled! (SOA)
04 - Felipe Oliveira - Think Decoupled! (SOA)DNAD
 
01 - Giovanni Bassi - Keynote
01 - Giovanni Bassi - Keynote01 - Giovanni Bassi - Keynote
01 - Giovanni Bassi - KeynoteDNAD
 

Plus de DNAD (14)

LT 07 - Glauber de Almeida - DRY
LT 07 - Glauber de Almeida - DRYLT 07 - Glauber de Almeida - DRY
LT 07 - Glauber de Almeida - DRY
 
LT 06 - Douglas Aguiar - Quem nao se comunica se trumbica
LT 06 - Douglas Aguiar - Quem nao se comunica se trumbicaLT 06 - Douglas Aguiar - Quem nao se comunica se trumbica
LT 06 - Douglas Aguiar - Quem nao se comunica se trumbica
 
LT 02 - Rodrigo Kumpera - Rodando c sharp
LT 02 - Rodrigo Kumpera - Rodando c sharpLT 02 - Rodrigo Kumpera - Rodando c sharp
LT 02 - Rodrigo Kumpera - Rodando c sharp
 
LT 01 - Rodrigo Yoshima - Business vsarchitecture
LT 01 - Rodrigo Yoshima - Business vsarchitectureLT 01 - Rodrigo Yoshima - Business vsarchitecture
LT 01 - Rodrigo Yoshima - Business vsarchitecture
 
LT 04 - Denis Ferrari - Como lidar com as dificuldades da primeira sprint - dnad
LT 04 - Denis Ferrari - Como lidar com as dificuldades da primeira sprint - dnadLT 04 - Denis Ferrari - Como lidar com as dificuldades da primeira sprint - dnad
LT 04 - Denis Ferrari - Como lidar com as dificuldades da primeira sprint - dnad
 
02a - Leandro Daniel - Examinando a arquitetura evolucionária
02a -  Leandro Daniel - Examinando a arquitetura evolucionária02a -  Leandro Daniel - Examinando a arquitetura evolucionária
02a - Leandro Daniel - Examinando a arquitetura evolucionária
 
07 - Osvaldo Daibert - Cenários para cache de dados distribuidos
07  - Osvaldo Daibert - Cenários para cache de dados distribuidos07  - Osvaldo Daibert - Cenários para cache de dados distribuidos
07 - Osvaldo Daibert - Cenários para cache de dados distribuidos
 
08 - Otavio Pecego - Arquitetura e nuvem: o que muda?
08 - Otavio Pecego - Arquitetura e nuvem: o que muda?08 - Otavio Pecego - Arquitetura e nuvem: o que muda?
08 - Otavio Pecego - Arquitetura e nuvem: o que muda?
 
06 - Giovanni Bassi - CQS, CQRS, DDD, DbC, DDDD
06 - Giovanni Bassi - CQS, CQRS, DDD, DbC, DDDD06 - Giovanni Bassi - CQS, CQRS, DDD, DbC, DDDD
06 - Giovanni Bassi - CQS, CQRS, DDD, DbC, DDDD
 
05 - Waldemir Cambiucci - Matriz de habilidades de um arquiteto TI
05 - Waldemir Cambiucci - Matriz de habilidades de um arquiteto TI05 - Waldemir Cambiucci - Matriz de habilidades de um arquiteto TI
05 - Waldemir Cambiucci - Matriz de habilidades de um arquiteto TI
 
02c - Vinicius Quaiato - Over Patternization, YAGNI, KISS
02c - Vinicius Quaiato - Over Patternization, YAGNI, KISS02c - Vinicius Quaiato - Over Patternization, YAGNI, KISS
02c - Vinicius Quaiato - Over Patternization, YAGNI, KISS
 
02b - Elemar Jr. - Examinando a Arquitetura Evolucionária
02b  - Elemar Jr. - Examinando a Arquitetura Evolucionária02b  - Elemar Jr. - Examinando a Arquitetura Evolucionária
02b - Elemar Jr. - Examinando a Arquitetura Evolucionária
 
04 - Felipe Oliveira - Think Decoupled! (SOA)
04 - Felipe Oliveira - Think Decoupled! (SOA)04 - Felipe Oliveira - Think Decoupled! (SOA)
04 - Felipe Oliveira - Think Decoupled! (SOA)
 
01 - Giovanni Bassi - Keynote
01 - Giovanni Bassi - Keynote01 - Giovanni Bassi - Keynote
01 - Giovanni Bassi - Keynote
 

Dernier

08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 

Dernier (20)

08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 

LT 03 - Juan Lopes - Complexidade algoritmos

  • 2.
  • 3.
  • 4. for(int i = 0; i < 30000; i++) s += “whatever”;
  • 5. var builder = new StringBuilder(); for(int i = 0; i < 30000; i++) builder.Append(“whatever”); s = builder.ToString();
  • 6. var builder = new StringBuilder(); builder.Append(“whatever”); builder.Append(“whatever”); s = builder.ToString();
  • 7.
  • 8. n tempo 5 175 10 700 15 1575 20 2800 25 4375 30 6300 35 8575 50 17500 tempo 20000 15000 10000 tempo 5000 0 5 10 15 20 25 30 35 50
  • 9. n for(int i = 0; i < ; i++) s += “whatever”; O(n)?
  • 10. for(int i = 0; i < ; i++) n s += “whatever”; i len(s) custo 0 0 L 1 L 2*L 2 2*L 3*L … n n*L (n+1)*L n²  n L Total: 2
  • 11. n for(int i = 0; i < ; i++) s += “whatever”; O(n²L)!
  • 12.
  • 13.
  • 14.
  • 15. Dr. Donald E. Knuth “Programmers waste enormous amounts of time thinking about, or worrying about, the speed of noncritical parts of their programs, and these attempts at efficiency actually have a strong negative impact when debugging and maintenance are considered. We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil. Yet we should not pass up our opportunities in that critical 3%.”
  • 16. Vilfredo Pareto 20% Alguma coisa Outra coisa 80%