SlideShare uma empresa Scribd logo
1 de 13
INE5408
Estruturas de Dados
Aula 6b
Listas Circulares
Listas Encadeadas Circulares
• Último elemento conecta ao primeiro.
• Implementação mais simples:
3
info próximo info próximo info próximo
nro dados
melão
doce
caro
maçã
azeda
cara
uva
irkh
barata
Listas Encadeadas Circulares
• Caso especial:
– Lista circular unitária.
• Atividade:
– Quais operações têm algoritmos diferentes?
– Qual é a posição mais indicada para inserir quando a posição não
importa ?
1
info próximo
nro dados
melão
doce
caro
Listas Encadeadas Circulares
• Alternativa para evitar mudança nos algoritmos
– nodo-sentinela funciona sempre como nodo sem informações
atachado à cabeça de lista
– lista é criada posuindo o nodo sentinela
– algoritmos não se modificam
4
info próximo info próximo info
nro dados
maçã
azeda
cara
uva
irkh
barata
melão
doce
caro
próximo
info próximo
Para que servem listas circulares?
• Modelagem e planejamento de rotas
circulares
– Caminho de retorno é diferente do de ida.
– Exemplo: rotas aéreas tipo volta-ao-mundo.
– Útil em sistemas de planejamento de itinerário e
de reserva global de passagens como Amadeus
Global Travel Distribution System
Para que servem listas circulares?
Para que servem listas circulares?
Para que servem listas circulares?
• Escalonamento de Processos (Process
Scheduling) em kernels de sistemas
operacionais multitarefa preemptivos.
– Exemplo: método round-robin (tradução:
sabiá-cíclico - não se preocupe: ninguém
usa) de escalonamento de processos com
fatia de tempo constante por processo.
Round Robin
CPU
Proc.#1
long int SomeFunction(); /*
int OtherFunction(); */ /* int
*/ CallingFunction() { long
int test1; register /* int */
test2; test1 = SomeFunction();
if (test1 > 0) test2 = 0; else
test2 = OtherFunction();
return test2; }.
Var1
Var2
Var3
Var4
Var5
Proc.#2
long int SomeFunction(); /*
int OtherFunction(); */ /* int
*/ CallingFunction() { long
int test1; register /* int */
test2; test1 = SomeFunction();
if (test1 > 0) test2 = 0; else
test2 = OtherFunction();
return test2; }.
Var1
Var2
Var3
Var4
Var5
Proc.#3
long int SomeFunction(); /*
int OtherFunction(); */ /* int
*/ CallingFunction() { long
int test1; register /* int */
test2; test1 = SomeFunction();
if (test1 > 0) test2 = 0; else
test2 = OtherFunction();
return test2; }.
Var1
Var2
Var3
Var4
Var5
Proc.#4
long int SomeFunction(); /*
int OtherFunction(); */ /* int
*/ CallingFunction() { long
int test1; register /* int */
test2; test1 = SomeFunction();
if (test1 > 0) test2 = 0; else
test2 = OtherFunction();
return test2; }.
Var1
Var2
Var3
Var4
Var5
long int SomeFunction(); /*
int OtherFunction(); */ /* int
*/ CallingFunction() { long
int test1; register /* int */
test2; test1 = SomeFunction();
if (test1 > 0) test2 = 0; else
test2 = OtherFunction();
return test2; }.
Var1
Var2
Var3
Var4
Var5
long int SomeFunction(); /*
int OtherFunction(); */ /* int
*/ CallingFunction() { long
int test1; register /* int */
test2; test1 = SomeFunction();
if (test1 > 0) test2 = 0; else
test2 = OtherFunction();
return test2; }.
Var1
Var2
Var3
Var4
Var5
long int SomeFunction(); /*
int OtherFunction(); */ /* int
*/ CallingFunction() { long
int test1; register /* int */
test2; test1 = SomeFunction();
if (test1 > 0) test2 = 0; else
test2 = OtherFunction();
return test2; }.
Var1
Var2
Var3
Var4
Var5
long int SomeFunction(); /*
int OtherFunction(); */ /* int
*/ CallingFunction() { long
int test1; register /* int */
test2; test1 = SomeFunction();
if (test1 > 0) test2 = 0; else
test2 = OtherFunction();
return test2; }.
Var1
Var2
Var3
Var4
Var5
Round Robin
CPU
Proc.#1
long int SomeFunction(); /*
int OtherFunction(); */ /* int
*/ CallingFunction() { long
int test1; register /* int */
test2; test1 = SomeFunction();
if (test1 > 0) test2 = 0; else
test2 = OtherFunction();
return test2; }.
Var1
Var2
Var3
Var4
Var5
Proc.#2
long int SomeFunction(); /*
int OtherFunction(); */ /* int
*/ CallingFunction() { long
int test1; register /* int */
test2; test1 = SomeFunction();
if (test1 > 0) test2 = 0; else
test2 = OtherFunction();
return test2; }.
Var1
Var2
Var3
Var4
Var5
Proc.#3
long int SomeFunction(); /*
int OtherFunction(); */ /* int
*/ CallingFunction() { long
int test1; register /* int */
test2; test1 = SomeFunction();
if (test1 > 0) test2 = 0; else
test2 = OtherFunction();
return test2; }.
Var1
Var2
Var3
Var4
Var5
Proc.#4
long int SomeFunction(); /*
int OtherFunction(); */ /* int
*/ CallingFunction() { long
int test1; register /* int */
test2; test1 = SomeFunction();
if (test1 > 0) test2 = 0; else
test2 = OtherFunction();
return test2; }.
Var1
Var2
Var3
Var4
Var5
long int SomeFunction(); /*
int OtherFunction(); */ /* int
*/ CallingFunction() { long
int test1; register /* int */
test2; test1 = SomeFunction();
if (test1 > 0) test2 = 0; else
test2 = OtherFunction();
return test2; }.
Var1
Var2
Var3
Var4
Var5
long int SomeFunction(); /*
int OtherFunction(); */ /* int
*/ CallingFunction() { long
int test1; register /* int */
test2; test1 = SomeFunction();
if (test1 > 0) test2 = 0; else
test2 = OtherFunction();
return test2; }.
Var1
Var2
Var3
Var4
Var5
long int SomeFunction(); /*
int OtherFunction(); */ /* int
*/ CallingFunction() { long
int test1; register /* int */
test2; test1 = SomeFunction();
if (test1 > 0) test2 = 0; else
test2 = OtherFunction();
return test2; }.
Var1
Var2
Var3
Var4
Var5
long int SomeFunction(); /*
int OtherFunction(); */ /* int
*/ CallingFunction() { long
int test1; register /* int */
test2; test1 = SomeFunction();
if (test1 > 0) test2 = 0; else
test2 = OtherFunction();
return test2; }.
Var1
Var2
Var3
Var4
Var5
Round Robin
CPU
Proc.#1
long int SomeFunction(); /*
int OtherFunction(); */ /* int
*/ CallingFunction() { long
int test1; register /* int */
test2; test1 = SomeFunction();
if (test1 > 0) test2 = 0; else
test2 = OtherFunction();
return test2; }.
Var1
Var2
Var3
Var4
Var5
Proc.#2
long int SomeFunction(); /*
int OtherFunction(); */ /* int
*/ CallingFunction() { long
int test1; register /* int */
test2; test1 = SomeFunction();
if (test1 > 0) test2 = 0; else
test2 = OtherFunction();
return test2; }.
Var1
Var2
Var3
Var4
Var5
Proc.#3
long int SomeFunction(); /*
int OtherFunction(); */ /* int
*/ CallingFunction() { long
int test1; register /* int */
test2; test1 = SomeFunction();
if (test1 > 0) test2 = 0; else
test2 = OtherFunction();
return test2; }.
Var1
Var2
Var3
Var4
Var5
Proc.#4
long int SomeFunction(); /*
int OtherFunction(); */ /* int
*/ CallingFunction() { long
int test1; register /* int */
test2; test1 = SomeFunction();
if (test1 > 0) test2 = 0; else
test2 = OtherFunction();
return test2; }.
Var1
Var2
Var3
Var4
Var5
long int SomeFunction(); /*
int OtherFunction(); */ /* int
*/ CallingFunction() { long
int test1; register /* int */
test2; test1 = SomeFunction();
if (test1 > 0) test2 = 0; else
test2 = OtherFunction();
return test2; }.
Var1
Var2
Var3
Var4
Var5
long int SomeFunction(); /*
int OtherFunction(); */ /* int
*/ CallingFunction() { long
int test1; register /* int */
test2; test1 = SomeFunction();
if (test1 > 0) test2 = 0; else
test2 = OtherFunction();
return test2; }.
Var1
Var2
Var3
Var4
Var5
long int SomeFunction(); /*
int OtherFunction(); */ /* int
*/ CallingFunction() { long
int test1; register /* int */
test2; test1 = SomeFunction();
if (test1 > 0) test2 = 0; else
test2 = OtherFunction();
return test2; }.
Var1
Var2
Var3
Var4
Var5
long int SomeFunction(); /*
int OtherFunction(); */ /* int
*/ CallingFunction() { long
int test1; register /* int */
test2; test1 = SomeFunction();
if (test1 > 0) test2 = 0; else
test2 = OtherFunction();
return test2; }.
Var1
Var2
Var3
Var4
Var5
Para que servem listas circulares?
• Sistemas de impressão que controlam várias
impressoras
– Realizam escalonamento de impressoras
(round-robin printing queue) por
disponibilidade para impressão de
documentos em uma fila de impressão
cíclica única para várias impressoras.
Para que servem listas circulares?

Mais conteúdo relacionado

Último

ATIVIDADE 1 - ESTRUTURA DE DADOS II - 52_2024.docx
ATIVIDADE 1 - ESTRUTURA DE DADOS II - 52_2024.docxATIVIDADE 1 - ESTRUTURA DE DADOS II - 52_2024.docx
ATIVIDADE 1 - ESTRUTURA DE DADOS II - 52_2024.docx2m Assessoria
 
Boas práticas de programação com Object Calisthenics
Boas práticas de programação com Object CalisthenicsBoas práticas de programação com Object Calisthenics
Boas práticas de programação com Object CalisthenicsDanilo Pinotti
 
ATIVIDADE 1 - LOGÍSTICA EMPRESARIAL - 52_2024.docx
ATIVIDADE 1 - LOGÍSTICA EMPRESARIAL - 52_2024.docxATIVIDADE 1 - LOGÍSTICA EMPRESARIAL - 52_2024.docx
ATIVIDADE 1 - LOGÍSTICA EMPRESARIAL - 52_2024.docx2m Assessoria
 
Programação Orientada a Objetos - 4 Pilares.pdf
Programação Orientada a Objetos - 4 Pilares.pdfProgramação Orientada a Objetos - 4 Pilares.pdf
Programação Orientada a Objetos - 4 Pilares.pdfSamaraLunas
 
Padrões de Projeto: Proxy e Command com exemplo
Padrões de Projeto: Proxy e Command com exemploPadrões de Projeto: Proxy e Command com exemplo
Padrões de Projeto: Proxy e Command com exemploDanilo Pinotti
 
ATIVIDADE 1 - CUSTOS DE PRODUÇÃO - 52_2024.docx
ATIVIDADE 1 - CUSTOS DE PRODUÇÃO - 52_2024.docxATIVIDADE 1 - CUSTOS DE PRODUÇÃO - 52_2024.docx
ATIVIDADE 1 - CUSTOS DE PRODUÇÃO - 52_2024.docx2m Assessoria
 
Luís Kitota AWS Discovery Day Ka Solution.pdf
Luís Kitota AWS Discovery Day Ka Solution.pdfLuís Kitota AWS Discovery Day Ka Solution.pdf
Luís Kitota AWS Discovery Day Ka Solution.pdfLuisKitota
 
ATIVIDADE 1 - GCOM - GESTÃO DA INFORMAÇÃO - 54_2024.docx
ATIVIDADE 1 - GCOM - GESTÃO DA INFORMAÇÃO - 54_2024.docxATIVIDADE 1 - GCOM - GESTÃO DA INFORMAÇÃO - 54_2024.docx
ATIVIDADE 1 - GCOM - GESTÃO DA INFORMAÇÃO - 54_2024.docx2m Assessoria
 

Último (8)

ATIVIDADE 1 - ESTRUTURA DE DADOS II - 52_2024.docx
ATIVIDADE 1 - ESTRUTURA DE DADOS II - 52_2024.docxATIVIDADE 1 - ESTRUTURA DE DADOS II - 52_2024.docx
ATIVIDADE 1 - ESTRUTURA DE DADOS II - 52_2024.docx
 
Boas práticas de programação com Object Calisthenics
Boas práticas de programação com Object CalisthenicsBoas práticas de programação com Object Calisthenics
Boas práticas de programação com Object Calisthenics
 
ATIVIDADE 1 - LOGÍSTICA EMPRESARIAL - 52_2024.docx
ATIVIDADE 1 - LOGÍSTICA EMPRESARIAL - 52_2024.docxATIVIDADE 1 - LOGÍSTICA EMPRESARIAL - 52_2024.docx
ATIVIDADE 1 - LOGÍSTICA EMPRESARIAL - 52_2024.docx
 
Programação Orientada a Objetos - 4 Pilares.pdf
Programação Orientada a Objetos - 4 Pilares.pdfProgramação Orientada a Objetos - 4 Pilares.pdf
Programação Orientada a Objetos - 4 Pilares.pdf
 
Padrões de Projeto: Proxy e Command com exemplo
Padrões de Projeto: Proxy e Command com exemploPadrões de Projeto: Proxy e Command com exemplo
Padrões de Projeto: Proxy e Command com exemplo
 
ATIVIDADE 1 - CUSTOS DE PRODUÇÃO - 52_2024.docx
ATIVIDADE 1 - CUSTOS DE PRODUÇÃO - 52_2024.docxATIVIDADE 1 - CUSTOS DE PRODUÇÃO - 52_2024.docx
ATIVIDADE 1 - CUSTOS DE PRODUÇÃO - 52_2024.docx
 
Luís Kitota AWS Discovery Day Ka Solution.pdf
Luís Kitota AWS Discovery Day Ka Solution.pdfLuís Kitota AWS Discovery Day Ka Solution.pdf
Luís Kitota AWS Discovery Day Ka Solution.pdf
 
ATIVIDADE 1 - GCOM - GESTÃO DA INFORMAÇÃO - 54_2024.docx
ATIVIDADE 1 - GCOM - GESTÃO DA INFORMAÇÃO - 54_2024.docxATIVIDADE 1 - GCOM - GESTÃO DA INFORMAÇÃO - 54_2024.docx
ATIVIDADE 1 - GCOM - GESTÃO DA INFORMAÇÃO - 54_2024.docx
 

Destaque

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
 

Destaque (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...
 

Aula_6b_-_Listas_Circulares.ppt

  • 1. INE5408 Estruturas de Dados Aula 6b Listas Circulares
  • 2. Listas Encadeadas Circulares • Último elemento conecta ao primeiro. • Implementação mais simples: 3 info próximo info próximo info próximo nro dados melão doce caro maçã azeda cara uva irkh barata
  • 3. Listas Encadeadas Circulares • Caso especial: – Lista circular unitária. • Atividade: – Quais operações têm algoritmos diferentes? – Qual é a posição mais indicada para inserir quando a posição não importa ? 1 info próximo nro dados melão doce caro
  • 4. Listas Encadeadas Circulares • Alternativa para evitar mudança nos algoritmos – nodo-sentinela funciona sempre como nodo sem informações atachado à cabeça de lista – lista é criada posuindo o nodo sentinela – algoritmos não se modificam 4 info próximo info próximo info nro dados maçã azeda cara uva irkh barata melão doce caro próximo info próximo
  • 5. Para que servem listas circulares? • Modelagem e planejamento de rotas circulares – Caminho de retorno é diferente do de ida. – Exemplo: rotas aéreas tipo volta-ao-mundo. – Útil em sistemas de planejamento de itinerário e de reserva global de passagens como Amadeus Global Travel Distribution System
  • 6. Para que servem listas circulares?
  • 7. Para que servem listas circulares?
  • 8. Para que servem listas circulares? • Escalonamento de Processos (Process Scheduling) em kernels de sistemas operacionais multitarefa preemptivos. – Exemplo: método round-robin (tradução: sabiá-cíclico - não se preocupe: ninguém usa) de escalonamento de processos com fatia de tempo constante por processo.
  • 9. Round Robin CPU Proc.#1 long int SomeFunction(); /* int OtherFunction(); */ /* int */ CallingFunction() { long int test1; register /* int */ test2; test1 = SomeFunction(); if (test1 > 0) test2 = 0; else test2 = OtherFunction(); return test2; }. Var1 Var2 Var3 Var4 Var5 Proc.#2 long int SomeFunction(); /* int OtherFunction(); */ /* int */ CallingFunction() { long int test1; register /* int */ test2; test1 = SomeFunction(); if (test1 > 0) test2 = 0; else test2 = OtherFunction(); return test2; }. Var1 Var2 Var3 Var4 Var5 Proc.#3 long int SomeFunction(); /* int OtherFunction(); */ /* int */ CallingFunction() { long int test1; register /* int */ test2; test1 = SomeFunction(); if (test1 > 0) test2 = 0; else test2 = OtherFunction(); return test2; }. Var1 Var2 Var3 Var4 Var5 Proc.#4 long int SomeFunction(); /* int OtherFunction(); */ /* int */ CallingFunction() { long int test1; register /* int */ test2; test1 = SomeFunction(); if (test1 > 0) test2 = 0; else test2 = OtherFunction(); return test2; }. Var1 Var2 Var3 Var4 Var5 long int SomeFunction(); /* int OtherFunction(); */ /* int */ CallingFunction() { long int test1; register /* int */ test2; test1 = SomeFunction(); if (test1 > 0) test2 = 0; else test2 = OtherFunction(); return test2; }. Var1 Var2 Var3 Var4 Var5 long int SomeFunction(); /* int OtherFunction(); */ /* int */ CallingFunction() { long int test1; register /* int */ test2; test1 = SomeFunction(); if (test1 > 0) test2 = 0; else test2 = OtherFunction(); return test2; }. Var1 Var2 Var3 Var4 Var5 long int SomeFunction(); /* int OtherFunction(); */ /* int */ CallingFunction() { long int test1; register /* int */ test2; test1 = SomeFunction(); if (test1 > 0) test2 = 0; else test2 = OtherFunction(); return test2; }. Var1 Var2 Var3 Var4 Var5 long int SomeFunction(); /* int OtherFunction(); */ /* int */ CallingFunction() { long int test1; register /* int */ test2; test1 = SomeFunction(); if (test1 > 0) test2 = 0; else test2 = OtherFunction(); return test2; }. Var1 Var2 Var3 Var4 Var5
  • 10. Round Robin CPU Proc.#1 long int SomeFunction(); /* int OtherFunction(); */ /* int */ CallingFunction() { long int test1; register /* int */ test2; test1 = SomeFunction(); if (test1 > 0) test2 = 0; else test2 = OtherFunction(); return test2; }. Var1 Var2 Var3 Var4 Var5 Proc.#2 long int SomeFunction(); /* int OtherFunction(); */ /* int */ CallingFunction() { long int test1; register /* int */ test2; test1 = SomeFunction(); if (test1 > 0) test2 = 0; else test2 = OtherFunction(); return test2; }. Var1 Var2 Var3 Var4 Var5 Proc.#3 long int SomeFunction(); /* int OtherFunction(); */ /* int */ CallingFunction() { long int test1; register /* int */ test2; test1 = SomeFunction(); if (test1 > 0) test2 = 0; else test2 = OtherFunction(); return test2; }. Var1 Var2 Var3 Var4 Var5 Proc.#4 long int SomeFunction(); /* int OtherFunction(); */ /* int */ CallingFunction() { long int test1; register /* int */ test2; test1 = SomeFunction(); if (test1 > 0) test2 = 0; else test2 = OtherFunction(); return test2; }. Var1 Var2 Var3 Var4 Var5 long int SomeFunction(); /* int OtherFunction(); */ /* int */ CallingFunction() { long int test1; register /* int */ test2; test1 = SomeFunction(); if (test1 > 0) test2 = 0; else test2 = OtherFunction(); return test2; }. Var1 Var2 Var3 Var4 Var5 long int SomeFunction(); /* int OtherFunction(); */ /* int */ CallingFunction() { long int test1; register /* int */ test2; test1 = SomeFunction(); if (test1 > 0) test2 = 0; else test2 = OtherFunction(); return test2; }. Var1 Var2 Var3 Var4 Var5 long int SomeFunction(); /* int OtherFunction(); */ /* int */ CallingFunction() { long int test1; register /* int */ test2; test1 = SomeFunction(); if (test1 > 0) test2 = 0; else test2 = OtherFunction(); return test2; }. Var1 Var2 Var3 Var4 Var5 long int SomeFunction(); /* int OtherFunction(); */ /* int */ CallingFunction() { long int test1; register /* int */ test2; test1 = SomeFunction(); if (test1 > 0) test2 = 0; else test2 = OtherFunction(); return test2; }. Var1 Var2 Var3 Var4 Var5
  • 11. Round Robin CPU Proc.#1 long int SomeFunction(); /* int OtherFunction(); */ /* int */ CallingFunction() { long int test1; register /* int */ test2; test1 = SomeFunction(); if (test1 > 0) test2 = 0; else test2 = OtherFunction(); return test2; }. Var1 Var2 Var3 Var4 Var5 Proc.#2 long int SomeFunction(); /* int OtherFunction(); */ /* int */ CallingFunction() { long int test1; register /* int */ test2; test1 = SomeFunction(); if (test1 > 0) test2 = 0; else test2 = OtherFunction(); return test2; }. Var1 Var2 Var3 Var4 Var5 Proc.#3 long int SomeFunction(); /* int OtherFunction(); */ /* int */ CallingFunction() { long int test1; register /* int */ test2; test1 = SomeFunction(); if (test1 > 0) test2 = 0; else test2 = OtherFunction(); return test2; }. Var1 Var2 Var3 Var4 Var5 Proc.#4 long int SomeFunction(); /* int OtherFunction(); */ /* int */ CallingFunction() { long int test1; register /* int */ test2; test1 = SomeFunction(); if (test1 > 0) test2 = 0; else test2 = OtherFunction(); return test2; }. Var1 Var2 Var3 Var4 Var5 long int SomeFunction(); /* int OtherFunction(); */ /* int */ CallingFunction() { long int test1; register /* int */ test2; test1 = SomeFunction(); if (test1 > 0) test2 = 0; else test2 = OtherFunction(); return test2; }. Var1 Var2 Var3 Var4 Var5 long int SomeFunction(); /* int OtherFunction(); */ /* int */ CallingFunction() { long int test1; register /* int */ test2; test1 = SomeFunction(); if (test1 > 0) test2 = 0; else test2 = OtherFunction(); return test2; }. Var1 Var2 Var3 Var4 Var5 long int SomeFunction(); /* int OtherFunction(); */ /* int */ CallingFunction() { long int test1; register /* int */ test2; test1 = SomeFunction(); if (test1 > 0) test2 = 0; else test2 = OtherFunction(); return test2; }. Var1 Var2 Var3 Var4 Var5 long int SomeFunction(); /* int OtherFunction(); */ /* int */ CallingFunction() { long int test1; register /* int */ test2; test1 = SomeFunction(); if (test1 > 0) test2 = 0; else test2 = OtherFunction(); return test2; }. Var1 Var2 Var3 Var4 Var5
  • 12. Para que servem listas circulares? • Sistemas de impressão que controlam várias impressoras – Realizam escalonamento de impressoras (round-robin printing queue) por disponibilidade para impressão de documentos em uma fila de impressão cíclica única para várias impressoras.
  • 13. Para que servem listas circulares?