SlideShare una empresa de Scribd logo
1 de 18
Descargar para leer sin conexión
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

Más contenido relacionado

La actualidad más candente

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
 

La actualidad más candente (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
 

Destacado

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
 

Destacado (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
 

Similar a 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
 

Similar a 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)
 

Más 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
 

Más 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
 

Último

Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 

Último (20)

Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 

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%