SlideShare una empresa de Scribd logo
1 de 4
Descargar para leer sin conexión
Desbravando algoritmos: um guia abrangente para desenvolvedores
ISBN: 978-65-00-95118-9
Areprodução total ou parcial deste volume por quaisquer formas ou meios, sem o consentimento, por escrito, da Metaprogramador é ilegal e configura apropriação
indevida dos direitos intelectuais e patrimoniais dos autores, protegidos pela Lei 9.610 de 19/02/1998.
Editor: time da Metaprogramador
Revisão gramatical: time da Metaprogramador
Editoração eletrônica: time da Metaprogramador
Dados Internacionais de Catalogação na Publicação (CIP)
(Câmara Brasileira do Livro, SP, Brasil)
Sá, José
Desbravando algoritmos: um guia abrangente para
desenvolvedores/José Sá. – 1. ed. – São Paulo, 2024.
1 recurso online (151 p.); ePDF
Modo de acesso: WWW
Publicação digital (e-book) no formato PDF.
ISBN: 978-65-00-95118-9
Inclui bibliografia: p. 149.
ISBN: 978-65-00-95118-9
1. Algoritmos. 2. Lógica. 3. Ciência da computação. I. Título.
Índices para catálogo sistemático:
1. Algoritmos : Lógica de programação : Computadores : Ciência da computação
SUMÁRIO
Conceituação........................................................................................................................................................................................................................................7
Etimologia............................................................................................................................................................................................................................................7
Estruturação de algoritmos ..................................................................................................................................................................................................................8
Linguagem natural (linguagem desenvolvida naturalmente pelo ser humano)................................................................................................................................8
Fluxogramas.....................................................................................................................................................................................................................................9
Pseudocódigo .................................................................................................................................................................................................................................13
Fundamentos......................................................................................................................................................................................................................................15
Proposições categóricas..................................................................................................................................................................................................................20
Exercícios de fixação .....................................................................................................................................................................................................................23
Constantes e variáveis....................................................................................................................................................................................................................25
Atribuição.......................................................................................................................................................................................................................................27
Bloco de instruções ........................................................................................................................................................................................................................28
Expressões aritméticas ...................................................................................................................................................................................................................29
Expressões lógicas..........................................................................................................................................................................................................................30
Entrada e saída ...............................................................................................................................................................................................................................31
Exercícios de fixação .....................................................................................................................................................................................................................33
Comandos de condição...................................................................................................................................................................................................................34
Seleção simples (complexidade baixa das proposições)............................................................................................................................................................34
Seleção composta.......................................................................................................................................................................................................................37
Seleção de múltipla escolha.......................................................................................................................................................................................................38
Comandos de repetição ..................................................................................................................................................................................................................40
Estrutura enquanto .....................................................................................................................................................................................................................40
Estrutura repita...........................................................................................................................................................................................................................42
Estrutura para.............................................................................................................................................................................................................................43
Exercícios de fixação .....................................................................................................................................................................................................................45
Módulos (subprogramas) ...................................................................................................................................................................................................................46
Escopo de variáveis........................................................................................................................................................................................................................47
Passagem de parâmetros.................................................................................................................................................................................................................49
Exercícios de fixação .....................................................................................................................................................................................................................50
Recursividade.....................................................................................................................................................................................................................................51
Exercícios de Fixação.....................................................................................................................................................................................................................60
Vetores................................................................................................................................................................................................................................................61
Vetores unidimensionais (matriz de uma dimensão)......................................................................................................................................................................61
Vetores bidimensionais (matrizes) .................................................................................................................................................................................................63
Classificação...................................................................................................................................................................................................................................65
Pesquisa binária..............................................................................................................................................................................................................................67
Exercícios de fixação .....................................................................................................................................................................................................................68
Complexidade de algoritmos .............................................................................................................................................................................................................69
Notação O-grande ..........................................................................................................................................................................................................................70
Complexidade de tempo.................................................................................................................................................................................................................71
Contando operações na análise dos algoritmos..............................................................................................................................................................................75
Exercícios de fixação .....................................................................................................................................................................................................................77
Exercícios propostos ..........................................................................................................................................................................................................................78
Apêndice A – Resolução dos exercícios de fixação...........................................................................................................................................................................80
Apêndice B – Resolução dos exercícios propostos..........................................................................................................................................................................134
Bibliografia ......................................................................................................................................................................................................................................149
Índice remissivo...............................................................................................................................................................................................................................150

Más contenido relacionado

Último

Análise poema país de abril (Mauel alegre)
Análise poema país de abril (Mauel alegre)Análise poema país de abril (Mauel alegre)
Análise poema país de abril (Mauel alegre)ElliotFerreira
 
DeClara n.º 75 Abril 2024 - O Jornal digital do Agrupamento de Escolas Clara ...
DeClara n.º 75 Abril 2024 - O Jornal digital do Agrupamento de Escolas Clara ...DeClara n.º 75 Abril 2024 - O Jornal digital do Agrupamento de Escolas Clara ...
DeClara n.º 75 Abril 2024 - O Jornal digital do Agrupamento de Escolas Clara ...IsabelPereira2010
 
"É melhor praticar para a nota" - Como avaliar comportamentos em contextos de...
"É melhor praticar para a nota" - Como avaliar comportamentos em contextos de..."É melhor praticar para a nota" - Como avaliar comportamentos em contextos de...
"É melhor praticar para a nota" - Como avaliar comportamentos em contextos de...Rosalina Simão Nunes
 
PROJETO DE EXTENSÃO I - SERVIÇOS JURÍDICOS, CARTORÁRIOS E NOTARIAIS.pdf
PROJETO DE EXTENSÃO I - SERVIÇOS JURÍDICOS, CARTORÁRIOS E NOTARIAIS.pdfPROJETO DE EXTENSÃO I - SERVIÇOS JURÍDICOS, CARTORÁRIOS E NOTARIAIS.pdf
PROJETO DE EXTENSÃO I - SERVIÇOS JURÍDICOS, CARTORÁRIOS E NOTARIAIS.pdfHELENO FAVACHO
 
ENSINO RELIGIOSO 7º ANO INOVE NA ESCOLA.pdf
ENSINO RELIGIOSO 7º ANO INOVE NA ESCOLA.pdfENSINO RELIGIOSO 7º ANO INOVE NA ESCOLA.pdf
ENSINO RELIGIOSO 7º ANO INOVE NA ESCOLA.pdfLeloIurk1
 
Projeto_de_Extensão_Agronomia_adquira_ja_(91)_98764-0830.pdf
Projeto_de_Extensão_Agronomia_adquira_ja_(91)_98764-0830.pdfProjeto_de_Extensão_Agronomia_adquira_ja_(91)_98764-0830.pdf
Projeto_de_Extensão_Agronomia_adquira_ja_(91)_98764-0830.pdfHELENO FAVACHO
 
PROVA - ESTUDO CONTEMPORÂNEO E TRANSVERSAL: COMUNICAÇÃO ASSERTIVA E INTERPESS...
PROVA - ESTUDO CONTEMPORÂNEO E TRANSVERSAL: COMUNICAÇÃO ASSERTIVA E INTERPESS...PROVA - ESTUDO CONTEMPORÂNEO E TRANSVERSAL: COMUNICAÇÃO ASSERTIVA E INTERPESS...
PROVA - ESTUDO CONTEMPORÂNEO E TRANSVERSAL: COMUNICAÇÃO ASSERTIVA E INTERPESS...azulassessoria9
 
CRUZADINHA - Leitura e escrita dos números
CRUZADINHA   -   Leitura e escrita dos números CRUZADINHA   -   Leitura e escrita dos números
CRUZADINHA - Leitura e escrita dos números Mary Alvarenga
 
A QUATRO MÃOS - MARILDA CASTANHA . pdf
A QUATRO MÃOS  -  MARILDA CASTANHA . pdfA QUATRO MÃOS  -  MARILDA CASTANHA . pdf
A QUATRO MÃOS - MARILDA CASTANHA . pdfAna Lemos
 
PROJETO DE EXTENSÃO I - TERAPIAS INTEGRATIVAS E COMPLEMENTARES.pdf
PROJETO DE EXTENSÃO I - TERAPIAS INTEGRATIVAS E COMPLEMENTARES.pdfPROJETO DE EXTENSÃO I - TERAPIAS INTEGRATIVAS E COMPLEMENTARES.pdf
PROJETO DE EXTENSÃO I - TERAPIAS INTEGRATIVAS E COMPLEMENTARES.pdfHELENO FAVACHO
 
ATIVIDADE - CHARGE.pptxDFGHJKLÇ~ÇLJHUFTDRSEDFGJHKLÇ
ATIVIDADE - CHARGE.pptxDFGHJKLÇ~ÇLJHUFTDRSEDFGJHKLÇATIVIDADE - CHARGE.pptxDFGHJKLÇ~ÇLJHUFTDRSEDFGJHKLÇ
ATIVIDADE - CHARGE.pptxDFGHJKLÇ~ÇLJHUFTDRSEDFGJHKLÇJaineCarolaineLima
 
Considere a seguinte situação fictícia: Durante uma reunião de equipe em uma...
Considere a seguinte situação fictícia:  Durante uma reunião de equipe em uma...Considere a seguinte situação fictícia:  Durante uma reunião de equipe em uma...
Considere a seguinte situação fictícia: Durante uma reunião de equipe em uma...azulassessoria9
 
Rota das Ribeiras Camp, Projeto Nós Propomos!
Rota das Ribeiras Camp, Projeto Nós Propomos!Rota das Ribeiras Camp, Projeto Nós Propomos!
Rota das Ribeiras Camp, Projeto Nós Propomos!Ilda Bicacro
 
Recomposiçao em matematica 1 ano 2024 - ESTUDANTE 1ª série.pdf
Recomposiçao em matematica 1 ano 2024 - ESTUDANTE 1ª série.pdfRecomposiçao em matematica 1 ano 2024 - ESTUDANTE 1ª série.pdf
Recomposiçao em matematica 1 ano 2024 - ESTUDANTE 1ª série.pdfFrancisco Márcio Bezerra Oliveira
 
Apresentação em Powerpoint do Bioma Catinga.pptx
Apresentação em Powerpoint do Bioma Catinga.pptxApresentação em Powerpoint do Bioma Catinga.pptx
Apresentação em Powerpoint do Bioma Catinga.pptxLusGlissonGud
 
Dicionário de Genealogia, autor Gilber Rubim Rangel
Dicionário de Genealogia, autor Gilber Rubim RangelDicionário de Genealogia, autor Gilber Rubim Rangel
Dicionário de Genealogia, autor Gilber Rubim RangelGilber Rubim Rangel
 
apostila projeto de vida 2 ano ensino médio
apostila projeto de vida 2 ano ensino médioapostila projeto de vida 2 ano ensino médio
apostila projeto de vida 2 ano ensino médiorosenilrucks
 
5 bloco 7 ano - Ensino Relogioso- Lideres Religiosos _ Passei Direto.pdf
5 bloco 7 ano - Ensino Relogioso- Lideres Religiosos _ Passei Direto.pdf5 bloco 7 ano - Ensino Relogioso- Lideres Religiosos _ Passei Direto.pdf
5 bloco 7 ano - Ensino Relogioso- Lideres Religiosos _ Passei Direto.pdfLeloIurk1
 
About Vila Galé- Cadeia Empresarial de Hotéis
About Vila Galé- Cadeia Empresarial de HotéisAbout Vila Galé- Cadeia Empresarial de Hotéis
About Vila Galé- Cadeia Empresarial de Hotéisines09cachapa
 

Último (20)

Análise poema país de abril (Mauel alegre)
Análise poema país de abril (Mauel alegre)Análise poema país de abril (Mauel alegre)
Análise poema país de abril (Mauel alegre)
 
DeClara n.º 75 Abril 2024 - O Jornal digital do Agrupamento de Escolas Clara ...
DeClara n.º 75 Abril 2024 - O Jornal digital do Agrupamento de Escolas Clara ...DeClara n.º 75 Abril 2024 - O Jornal digital do Agrupamento de Escolas Clara ...
DeClara n.º 75 Abril 2024 - O Jornal digital do Agrupamento de Escolas Clara ...
 
"É melhor praticar para a nota" - Como avaliar comportamentos em contextos de...
"É melhor praticar para a nota" - Como avaliar comportamentos em contextos de..."É melhor praticar para a nota" - Como avaliar comportamentos em contextos de...
"É melhor praticar para a nota" - Como avaliar comportamentos em contextos de...
 
PROJETO DE EXTENSÃO I - SERVIÇOS JURÍDICOS, CARTORÁRIOS E NOTARIAIS.pdf
PROJETO DE EXTENSÃO I - SERVIÇOS JURÍDICOS, CARTORÁRIOS E NOTARIAIS.pdfPROJETO DE EXTENSÃO I - SERVIÇOS JURÍDICOS, CARTORÁRIOS E NOTARIAIS.pdf
PROJETO DE EXTENSÃO I - SERVIÇOS JURÍDICOS, CARTORÁRIOS E NOTARIAIS.pdf
 
ENSINO RELIGIOSO 7º ANO INOVE NA ESCOLA.pdf
ENSINO RELIGIOSO 7º ANO INOVE NA ESCOLA.pdfENSINO RELIGIOSO 7º ANO INOVE NA ESCOLA.pdf
ENSINO RELIGIOSO 7º ANO INOVE NA ESCOLA.pdf
 
Projeto_de_Extensão_Agronomia_adquira_ja_(91)_98764-0830.pdf
Projeto_de_Extensão_Agronomia_adquira_ja_(91)_98764-0830.pdfProjeto_de_Extensão_Agronomia_adquira_ja_(91)_98764-0830.pdf
Projeto_de_Extensão_Agronomia_adquira_ja_(91)_98764-0830.pdf
 
PROVA - ESTUDO CONTEMPORÂNEO E TRANSVERSAL: COMUNICAÇÃO ASSERTIVA E INTERPESS...
PROVA - ESTUDO CONTEMPORÂNEO E TRANSVERSAL: COMUNICAÇÃO ASSERTIVA E INTERPESS...PROVA - ESTUDO CONTEMPORÂNEO E TRANSVERSAL: COMUNICAÇÃO ASSERTIVA E INTERPESS...
PROVA - ESTUDO CONTEMPORÂNEO E TRANSVERSAL: COMUNICAÇÃO ASSERTIVA E INTERPESS...
 
CRUZADINHA - Leitura e escrita dos números
CRUZADINHA   -   Leitura e escrita dos números CRUZADINHA   -   Leitura e escrita dos números
CRUZADINHA - Leitura e escrita dos números
 
A QUATRO MÃOS - MARILDA CASTANHA . pdf
A QUATRO MÃOS  -  MARILDA CASTANHA . pdfA QUATRO MÃOS  -  MARILDA CASTANHA . pdf
A QUATRO MÃOS - MARILDA CASTANHA . pdf
 
Aula sobre o Imperialismo Europeu no século XIX
Aula sobre o Imperialismo Europeu no século XIXAula sobre o Imperialismo Europeu no século XIX
Aula sobre o Imperialismo Europeu no século XIX
 
PROJETO DE EXTENSÃO I - TERAPIAS INTEGRATIVAS E COMPLEMENTARES.pdf
PROJETO DE EXTENSÃO I - TERAPIAS INTEGRATIVAS E COMPLEMENTARES.pdfPROJETO DE EXTENSÃO I - TERAPIAS INTEGRATIVAS E COMPLEMENTARES.pdf
PROJETO DE EXTENSÃO I - TERAPIAS INTEGRATIVAS E COMPLEMENTARES.pdf
 
ATIVIDADE - CHARGE.pptxDFGHJKLÇ~ÇLJHUFTDRSEDFGJHKLÇ
ATIVIDADE - CHARGE.pptxDFGHJKLÇ~ÇLJHUFTDRSEDFGJHKLÇATIVIDADE - CHARGE.pptxDFGHJKLÇ~ÇLJHUFTDRSEDFGJHKLÇ
ATIVIDADE - CHARGE.pptxDFGHJKLÇ~ÇLJHUFTDRSEDFGJHKLÇ
 
Considere a seguinte situação fictícia: Durante uma reunião de equipe em uma...
Considere a seguinte situação fictícia:  Durante uma reunião de equipe em uma...Considere a seguinte situação fictícia:  Durante uma reunião de equipe em uma...
Considere a seguinte situação fictícia: Durante uma reunião de equipe em uma...
 
Rota das Ribeiras Camp, Projeto Nós Propomos!
Rota das Ribeiras Camp, Projeto Nós Propomos!Rota das Ribeiras Camp, Projeto Nós Propomos!
Rota das Ribeiras Camp, Projeto Nós Propomos!
 
Recomposiçao em matematica 1 ano 2024 - ESTUDANTE 1ª série.pdf
Recomposiçao em matematica 1 ano 2024 - ESTUDANTE 1ª série.pdfRecomposiçao em matematica 1 ano 2024 - ESTUDANTE 1ª série.pdf
Recomposiçao em matematica 1 ano 2024 - ESTUDANTE 1ª série.pdf
 
Apresentação em Powerpoint do Bioma Catinga.pptx
Apresentação em Powerpoint do Bioma Catinga.pptxApresentação em Powerpoint do Bioma Catinga.pptx
Apresentação em Powerpoint do Bioma Catinga.pptx
 
Dicionário de Genealogia, autor Gilber Rubim Rangel
Dicionário de Genealogia, autor Gilber Rubim RangelDicionário de Genealogia, autor Gilber Rubim Rangel
Dicionário de Genealogia, autor Gilber Rubim Rangel
 
apostila projeto de vida 2 ano ensino médio
apostila projeto de vida 2 ano ensino médioapostila projeto de vida 2 ano ensino médio
apostila projeto de vida 2 ano ensino médio
 
5 bloco 7 ano - Ensino Relogioso- Lideres Religiosos _ Passei Direto.pdf
5 bloco 7 ano - Ensino Relogioso- Lideres Religiosos _ Passei Direto.pdf5 bloco 7 ano - Ensino Relogioso- Lideres Religiosos _ Passei Direto.pdf
5 bloco 7 ano - Ensino Relogioso- Lideres Religiosos _ Passei Direto.pdf
 
About Vila Galé- Cadeia Empresarial de Hotéis
About Vila Galé- Cadeia Empresarial de HotéisAbout Vila Galé- Cadeia Empresarial de Hotéis
About Vila Galé- Cadeia Empresarial de Hotéis
 

Destacado

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

Destacado (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

livro_desbravando_algoritmos_sumario.pdf

  • 1.
  • 2. Desbravando algoritmos: um guia abrangente para desenvolvedores ISBN: 978-65-00-95118-9 Areprodução total ou parcial deste volume por quaisquer formas ou meios, sem o consentimento, por escrito, da Metaprogramador é ilegal e configura apropriação indevida dos direitos intelectuais e patrimoniais dos autores, protegidos pela Lei 9.610 de 19/02/1998. Editor: time da Metaprogramador Revisão gramatical: time da Metaprogramador Editoração eletrônica: time da Metaprogramador Dados Internacionais de Catalogação na Publicação (CIP) (Câmara Brasileira do Livro, SP, Brasil) Sá, José Desbravando algoritmos: um guia abrangente para desenvolvedores/José Sá. – 1. ed. – São Paulo, 2024. 1 recurso online (151 p.); ePDF Modo de acesso: WWW Publicação digital (e-book) no formato PDF. ISBN: 978-65-00-95118-9 Inclui bibliografia: p. 149. ISBN: 978-65-00-95118-9 1. Algoritmos. 2. Lógica. 3. Ciência da computação. I. Título. Índices para catálogo sistemático: 1. Algoritmos : Lógica de programação : Computadores : Ciência da computação
  • 3. SUMÁRIO Conceituação........................................................................................................................................................................................................................................7 Etimologia............................................................................................................................................................................................................................................7 Estruturação de algoritmos ..................................................................................................................................................................................................................8 Linguagem natural (linguagem desenvolvida naturalmente pelo ser humano)................................................................................................................................8 Fluxogramas.....................................................................................................................................................................................................................................9 Pseudocódigo .................................................................................................................................................................................................................................13 Fundamentos......................................................................................................................................................................................................................................15 Proposições categóricas..................................................................................................................................................................................................................20 Exercícios de fixação .....................................................................................................................................................................................................................23 Constantes e variáveis....................................................................................................................................................................................................................25 Atribuição.......................................................................................................................................................................................................................................27 Bloco de instruções ........................................................................................................................................................................................................................28 Expressões aritméticas ...................................................................................................................................................................................................................29 Expressões lógicas..........................................................................................................................................................................................................................30 Entrada e saída ...............................................................................................................................................................................................................................31 Exercícios de fixação .....................................................................................................................................................................................................................33 Comandos de condição...................................................................................................................................................................................................................34 Seleção simples (complexidade baixa das proposições)............................................................................................................................................................34 Seleção composta.......................................................................................................................................................................................................................37 Seleção de múltipla escolha.......................................................................................................................................................................................................38 Comandos de repetição ..................................................................................................................................................................................................................40 Estrutura enquanto .....................................................................................................................................................................................................................40 Estrutura repita...........................................................................................................................................................................................................................42 Estrutura para.............................................................................................................................................................................................................................43 Exercícios de fixação .....................................................................................................................................................................................................................45
  • 4. Módulos (subprogramas) ...................................................................................................................................................................................................................46 Escopo de variáveis........................................................................................................................................................................................................................47 Passagem de parâmetros.................................................................................................................................................................................................................49 Exercícios de fixação .....................................................................................................................................................................................................................50 Recursividade.....................................................................................................................................................................................................................................51 Exercícios de Fixação.....................................................................................................................................................................................................................60 Vetores................................................................................................................................................................................................................................................61 Vetores unidimensionais (matriz de uma dimensão)......................................................................................................................................................................61 Vetores bidimensionais (matrizes) .................................................................................................................................................................................................63 Classificação...................................................................................................................................................................................................................................65 Pesquisa binária..............................................................................................................................................................................................................................67 Exercícios de fixação .....................................................................................................................................................................................................................68 Complexidade de algoritmos .............................................................................................................................................................................................................69 Notação O-grande ..........................................................................................................................................................................................................................70 Complexidade de tempo.................................................................................................................................................................................................................71 Contando operações na análise dos algoritmos..............................................................................................................................................................................75 Exercícios de fixação .....................................................................................................................................................................................................................77 Exercícios propostos ..........................................................................................................................................................................................................................78 Apêndice A – Resolução dos exercícios de fixação...........................................................................................................................................................................80 Apêndice B – Resolução dos exercícios propostos..........................................................................................................................................................................134 Bibliografia ......................................................................................................................................................................................................................................149 Índice remissivo...............................................................................................................................................................................................................................150