bcc 201 - introdução à programaçãoi estruturas homogêneas
TRANSCRIPT
![Page 1: BCC 201 - Introdução à ProgramaçãoI Estruturas Homogêneas](https://reader031.vdocuments.net/reader031/viewer/2022012504/617ed7dece2a1763696af336/html5/thumbnails/1.jpg)
1/28
BCC 201 - Introducao a ProgramacaoI
Estruturas Homogeneas (Vetores) II
Guillermo Camara-ChavezUFOP
![Page 2: BCC 201 - Introdução à ProgramaçãoI Estruturas Homogêneas](https://reader031.vdocuments.net/reader031/viewer/2022012504/617ed7dece2a1763696af336/html5/thumbnails/2.jpg)
2/28
Exercıcios I
Declaracao de um vetor de inteiros
i n t n o t a s [ 1 0 ] ;
Acessando um elemento do vetor: indicamos o nome do vetor e aposicao
n o t a s [ 6 ] = 8 ;
![Page 3: BCC 201 - Introdução à ProgramaçãoI Estruturas Homogêneas](https://reader031.vdocuments.net/reader031/viewer/2022012504/617ed7dece2a1763696af336/html5/thumbnails/3.jpg)
3/28
Exercıcios II
Leitura via teclado
i n t i , v e t o r [ 1 0 ] ;f o r ( i = 0 ; i < 1 0 ; i ++){
p r i n t f ("Inserir nota %d: " , i +1);s c a n f (" %d" , &n o t a s [ i ] ) ;
}. . .
Escrita do vetor
i n t i , v e t o r [ 1 0 ] ;. . .f o r ( i = 0 ; i < 1 0 ; i ++){
p r i n t f (" %d " , n o t a s [ i ] ) ;}. . .
![Page 4: BCC 201 - Introdução à ProgramaçãoI Estruturas Homogêneas](https://reader031.vdocuments.net/reader031/viewer/2022012504/617ed7dece2a1763696af336/html5/thumbnails/4.jpg)
4/28
Exercıcios I
Escreva um programa que leia 20 valores inteiros e os armazene emum vetor. Depois de ler os 20 valores, o programa deve percorrer ovetor e mostrar na tela apenas os numeros pares que foramarmazenados.
![Page 5: BCC 201 - Introdução à ProgramaçãoI Estruturas Homogêneas](https://reader031.vdocuments.net/reader031/viewer/2022012504/617ed7dece2a1763696af336/html5/thumbnails/5.jpg)
5/28
Exercıcios II
i n t main ( ){i n t numVet [ 2 0 ] , i ;f o r ( i = 0 ; i < 2 0 ; i ++){
p r i n t f ("Inserir numero %d \n" , i +1);s c a n f (" %d" , &numVet [ i ] ) ;
}f o r ( i = 0 ; i < 2 0 ; i ++){
i f ( numVet [ i ] % 2 == 0)p r i n t f (" %d " , numVet [ i ] ) ;
}r e t u r n 0 ;
}
![Page 6: BCC 201 - Introdução à ProgramaçãoI Estruturas Homogêneas](https://reader031.vdocuments.net/reader031/viewer/2022012504/617ed7dece2a1763696af336/html5/thumbnails/6.jpg)
6/28
Exercıcios III
Faca um programa que receba dez numeros inteiros e armazene-osem um vetor. O programa deve calcular e mostrar dois vetoresresultantes, sendo o primeiro com os numeros pares e o segundocom os numeros ımpares do vetor lido.
![Page 7: BCC 201 - Introdução à ProgramaçãoI Estruturas Homogêneas](https://reader031.vdocuments.net/reader031/viewer/2022012504/617ed7dece2a1763696af336/html5/thumbnails/7.jpg)
7/28
Exercıcios IV
i n t main ( ){i n t v e t [ 1 0 ] , par [ 1 0 ] , impar [ 1 0 ] ;i n t nPar = 0 nImpar = 0 , i ;f o r ( i = 0 ; i < 1 0 ; i ++){
p r i n t f ("Inserir numero %d \n" , i +1);s c a n f (" %d" , &v e t [ i ] ) ;
}f o r ( i = 0 ; i < 1 0 ; i ++){
i f ( v e t [ i ] % 2 == 0){par [ nPar ] = v e t [ i ] ;nPar++;
}e l s e {
impar [ nImpar ] = v e t [ i ] ;nImpar++;
}}. . .
}
![Page 8: BCC 201 - Introdução à ProgramaçãoI Estruturas Homogêneas](https://reader031.vdocuments.net/reader031/viewer/2022012504/617ed7dece2a1763696af336/html5/thumbnails/8.jpg)
8/28
Exercıcios V
i n t main ( ){. . .f o r ( i = 0 ; i < numPar ; i ++)
p r i n t f (" %d " , par [ i ] ) ;p r i n t f ("\n" ) ;f o r ( i = 0 ; i < numImpar ; i ++)
p r i n t f (" %d " , impar [ i ] ) ;r e t u r n 0 ;
}
![Page 9: BCC 201 - Introdução à ProgramaçãoI Estruturas Homogêneas](https://reader031.vdocuments.net/reader031/viewer/2022012504/617ed7dece2a1763696af336/html5/thumbnails/9.jpg)
9/28
Exercıcios VI
Faca um programa que leia um vetor de numeros inteiros de 10posicoes. O programa deve calcular e mostrar o maior elemento dovetor e em que posicao esse elemento se encontra
![Page 10: BCC 201 - Introdução à ProgramaçãoI Estruturas Homogêneas](https://reader031.vdocuments.net/reader031/viewer/2022012504/617ed7dece2a1763696af336/html5/thumbnails/10.jpg)
10/28
Exercıcios VII
i n t main ( ){i n t v e t [ 1 0 ] , i , maior , pos ;f o r ( i = 0 ; i < 1 0 ; i ++){
p r i n t f ("Inserir numero %d \n" , i +1);s c a n f (" %d" , &v e t [ i ] ) ;
}pos = 0 ;maior = v e t [ 0 ] ;f o r ( i = 1 ; i < 1 0 ; i ++){
i f ( v e t [ i ] > maior ){
maior = v e t [ i ] ;pos = i ;
}}p r i n t f ("O maior elemento %d
esta na posicao %d" , maior , pos ) ;r e t u r n 0 ;
}
![Page 11: BCC 201 - Introdução à ProgramaçãoI Estruturas Homogêneas](https://reader031.vdocuments.net/reader031/viewer/2022012504/617ed7dece2a1763696af336/html5/thumbnails/11.jpg)
11/28
Exercıcios VIII
Faca um algoritmo que leia um vetor V[60]. A seguir, troque o 1◦
elemento com o 31◦, o 2◦ com o 32◦, etc. Mostre no final o vetormodificado.
![Page 12: BCC 201 - Introdução à ProgramaçãoI Estruturas Homogêneas](https://reader031.vdocuments.net/reader031/viewer/2022012504/617ed7dece2a1763696af336/html5/thumbnails/12.jpg)
12/28
Exercıcios IX
i n t main ( ){i n t v e t [ 6 0 ] , i , tmp ;f o r ( i = 0 ; i < 6 0 ; i ++){
p r i n t f ("Inserir numero %d \n" , i +1);s c a n f (" %d" , &v e t [ i ] ) ;
}f o r ( i = 0 ; i < 3 0 ; i ++){
tmp = v e t [ i ] ;v e t [ i ] = v e t [ i +30] ;v e t [ i +30] = tmp ;
}f o r ( i = 0 ; i < 6 0 ; i ++)
p r i n t f (" %d \n" , v e t [ i ] ) ;r e t u r n 0 ;
}
![Page 13: BCC 201 - Introdução à ProgramaçãoI Estruturas Homogêneas](https://reader031.vdocuments.net/reader031/viewer/2022012504/617ed7dece2a1763696af336/html5/thumbnails/13.jpg)
13/28
Exercıcios X
Fazer um algoritmo que:
1. Leia n valores numericos e os armazene num arranjounidimensional v . O valor de n tambem deve ser lido.
2. Calcule e exiba o valor da serie:
S =n−1∑i=0
i + 1
vi
onde vi e o i-esimo valor armazenado na variavel v .
3. Calcule exiba quantos termos da serie tem o numeradorinferior ao denominador.
![Page 14: BCC 201 - Introdução à ProgramaçãoI Estruturas Homogêneas](https://reader031.vdocuments.net/reader031/viewer/2022012504/617ed7dece2a1763696af336/html5/thumbnails/14.jpg)
14/28
Exercıcios XI
i n t main ( ){i n t n , i , cont = 0 ;d o u b l e S = 0 , v [ 1 0 0 ] ;p r i n t f ("\n Indicar numero de elementos: " ) ;s c a n f (" %d" , &n ) ;p r i n t f ("\n Inserir %d numero: " , n ) ;f o r ( i = 0 ; i < n ; i ++)
s c a n f (" %lf" , &v [ i ] ) ;f o r ( i = 0 ; i < n ; i ++){
i f ( v [ i ] != 0){S += ( i / v [ i ] ) ;i f ( i < v [ i ] )
cont++;}
}p r i n t f (" %d termos com num inf ao den" , cont ) ;r e t u r n 0 ;
}
![Page 15: BCC 201 - Introdução à ProgramaçãoI Estruturas Homogêneas](https://reader031.vdocuments.net/reader031/viewer/2022012504/617ed7dece2a1763696af336/html5/thumbnails/15.jpg)
15/28
Ordenacao por BubbleSort (Metodo da bolha)
I E um dos piores metodos de ordenacao.
I E uma ordenacao por trocas.
I Implica repetidas comparacoes e, se necessario, troca de doiselementos adjacentes.
![Page 16: BCC 201 - Introdução à ProgramaçãoI Estruturas Homogêneas](https://reader031.vdocuments.net/reader031/viewer/2022012504/617ed7dece2a1763696af336/html5/thumbnails/16.jpg)
16/28
Ordenacao por BubbleSort (cont.)O metodo e ilustrado embaixo:
![Page 17: BCC 201 - Introdução à ProgramaçãoI Estruturas Homogêneas](https://reader031.vdocuments.net/reader031/viewer/2022012504/617ed7dece2a1763696af336/html5/thumbnails/17.jpg)
16/28
Ordenacao por BubbleSort (cont.)O metodo e ilustrado embaixo:
![Page 18: BCC 201 - Introdução à ProgramaçãoI Estruturas Homogêneas](https://reader031.vdocuments.net/reader031/viewer/2022012504/617ed7dece2a1763696af336/html5/thumbnails/18.jpg)
16/28
Ordenacao por BubbleSort (cont.)O metodo e ilustrado embaixo:
![Page 19: BCC 201 - Introdução à ProgramaçãoI Estruturas Homogêneas](https://reader031.vdocuments.net/reader031/viewer/2022012504/617ed7dece2a1763696af336/html5/thumbnails/19.jpg)
16/28
Ordenacao por BubbleSort (cont.)O metodo e ilustrado embaixo:
![Page 20: BCC 201 - Introdução à ProgramaçãoI Estruturas Homogêneas](https://reader031.vdocuments.net/reader031/viewer/2022012504/617ed7dece2a1763696af336/html5/thumbnails/20.jpg)
16/28
Ordenacao por BubbleSort (cont.)O metodo e ilustrado embaixo:
![Page 21: BCC 201 - Introdução à ProgramaçãoI Estruturas Homogêneas](https://reader031.vdocuments.net/reader031/viewer/2022012504/617ed7dece2a1763696af336/html5/thumbnails/21.jpg)
16/28
Ordenacao por BubbleSort (cont.)O metodo e ilustrado embaixo:
![Page 22: BCC 201 - Introdução à ProgramaçãoI Estruturas Homogêneas](https://reader031.vdocuments.net/reader031/viewer/2022012504/617ed7dece2a1763696af336/html5/thumbnails/22.jpg)
16/28
Ordenacao por BubbleSort (cont.)O metodo e ilustrado embaixo:
![Page 23: BCC 201 - Introdução à ProgramaçãoI Estruturas Homogêneas](https://reader031.vdocuments.net/reader031/viewer/2022012504/617ed7dece2a1763696af336/html5/thumbnails/23.jpg)
16/28
Ordenacao por BubbleSort (cont.)O metodo e ilustrado embaixo:
![Page 24: BCC 201 - Introdução à ProgramaçãoI Estruturas Homogêneas](https://reader031.vdocuments.net/reader031/viewer/2022012504/617ed7dece2a1763696af336/html5/thumbnails/24.jpg)
16/28
Ordenacao por BubbleSort (cont.)O metodo e ilustrado embaixo:
![Page 25: BCC 201 - Introdução à ProgramaçãoI Estruturas Homogêneas](https://reader031.vdocuments.net/reader031/viewer/2022012504/617ed7dece2a1763696af336/html5/thumbnails/25.jpg)
16/28
Ordenacao por BubbleSort (cont.)O metodo e ilustrado embaixo:
![Page 26: BCC 201 - Introdução à ProgramaçãoI Estruturas Homogêneas](https://reader031.vdocuments.net/reader031/viewer/2022012504/617ed7dece2a1763696af336/html5/thumbnails/26.jpg)
16/28
Ordenacao por BubbleSort (cont.)O metodo e ilustrado embaixo:
![Page 27: BCC 201 - Introdução à ProgramaçãoI Estruturas Homogêneas](https://reader031.vdocuments.net/reader031/viewer/2022012504/617ed7dece2a1763696af336/html5/thumbnails/27.jpg)
16/28
Ordenacao por BubbleSort (cont.)O metodo e ilustrado embaixo:
![Page 28: BCC 201 - Introdução à ProgramaçãoI Estruturas Homogêneas](https://reader031.vdocuments.net/reader031/viewer/2022012504/617ed7dece2a1763696af336/html5/thumbnails/28.jpg)
16/28
Ordenacao por BubbleSort (cont.)O metodo e ilustrado embaixo:
![Page 29: BCC 201 - Introdução à ProgramaçãoI Estruturas Homogêneas](https://reader031.vdocuments.net/reader031/viewer/2022012504/617ed7dece2a1763696af336/html5/thumbnails/29.jpg)
16/28
Ordenacao por BubbleSort (cont.)O metodo e ilustrado embaixo:
![Page 30: BCC 201 - Introdução à ProgramaçãoI Estruturas Homogêneas](https://reader031.vdocuments.net/reader031/viewer/2022012504/617ed7dece2a1763696af336/html5/thumbnails/30.jpg)
16/28
Ordenacao por BubbleSort (cont.)O metodo e ilustrado embaixo:
![Page 31: BCC 201 - Introdução à ProgramaçãoI Estruturas Homogêneas](https://reader031.vdocuments.net/reader031/viewer/2022012504/617ed7dece2a1763696af336/html5/thumbnails/31.jpg)
16/28
Ordenacao por BubbleSort (cont.)O metodo e ilustrado embaixo:
![Page 32: BCC 201 - Introdução à ProgramaçãoI Estruturas Homogêneas](https://reader031.vdocuments.net/reader031/viewer/2022012504/617ed7dece2a1763696af336/html5/thumbnails/32.jpg)
16/28
Ordenacao por BubbleSort (cont.)O metodo e ilustrado embaixo:
![Page 33: BCC 201 - Introdução à ProgramaçãoI Estruturas Homogêneas](https://reader031.vdocuments.net/reader031/viewer/2022012504/617ed7dece2a1763696af336/html5/thumbnails/33.jpg)
16/28
Ordenacao por BubbleSort (cont.)O metodo e ilustrado embaixo:
![Page 34: BCC 201 - Introdução à ProgramaçãoI Estruturas Homogêneas](https://reader031.vdocuments.net/reader031/viewer/2022012504/617ed7dece2a1763696af336/html5/thumbnails/34.jpg)
16/28
Ordenacao por BubbleSort (cont.)O metodo e ilustrado embaixo:
![Page 35: BCC 201 - Introdução à ProgramaçãoI Estruturas Homogêneas](https://reader031.vdocuments.net/reader031/viewer/2022012504/617ed7dece2a1763696af336/html5/thumbnails/35.jpg)
16/28
Ordenacao por BubbleSort (cont.)O metodo e ilustrado embaixo:
![Page 36: BCC 201 - Introdução à ProgramaçãoI Estruturas Homogêneas](https://reader031.vdocuments.net/reader031/viewer/2022012504/617ed7dece2a1763696af336/html5/thumbnails/36.jpg)
16/28
Ordenacao por BubbleSort (cont.)O metodo e ilustrado embaixo:
![Page 37: BCC 201 - Introdução à ProgramaçãoI Estruturas Homogêneas](https://reader031.vdocuments.net/reader031/viewer/2022012504/617ed7dece2a1763696af336/html5/thumbnails/37.jpg)
16/28
Ordenacao por BubbleSort (cont.)O metodo e ilustrado embaixo:
![Page 38: BCC 201 - Introdução à ProgramaçãoI Estruturas Homogêneas](https://reader031.vdocuments.net/reader031/viewer/2022012504/617ed7dece2a1763696af336/html5/thumbnails/38.jpg)
16/28
Ordenacao por BubbleSort (cont.)O metodo e ilustrado embaixo:
![Page 39: BCC 201 - Introdução à ProgramaçãoI Estruturas Homogêneas](https://reader031.vdocuments.net/reader031/viewer/2022012504/617ed7dece2a1763696af336/html5/thumbnails/39.jpg)
16/28
Ordenacao por BubbleSort (cont.)O metodo e ilustrado embaixo:
![Page 40: BCC 201 - Introdução à ProgramaçãoI Estruturas Homogêneas](https://reader031.vdocuments.net/reader031/viewer/2022012504/617ed7dece2a1763696af336/html5/thumbnails/40.jpg)
16/28
Ordenacao por BubbleSort (cont.)O metodo e ilustrado embaixo:
![Page 41: BCC 201 - Introdução à ProgramaçãoI Estruturas Homogêneas](https://reader031.vdocuments.net/reader031/viewer/2022012504/617ed7dece2a1763696af336/html5/thumbnails/41.jpg)
16/28
Ordenacao por BubbleSort (cont.)O metodo e ilustrado embaixo:
![Page 42: BCC 201 - Introdução à ProgramaçãoI Estruturas Homogêneas](https://reader031.vdocuments.net/reader031/viewer/2022012504/617ed7dece2a1763696af336/html5/thumbnails/42.jpg)
16/28
Ordenacao por BubbleSort (cont.)O metodo e ilustrado embaixo:
![Page 43: BCC 201 - Introdução à ProgramaçãoI Estruturas Homogêneas](https://reader031.vdocuments.net/reader031/viewer/2022012504/617ed7dece2a1763696af336/html5/thumbnails/43.jpg)
16/28
Ordenacao por BubbleSort (cont.)O metodo e ilustrado embaixo:
![Page 44: BCC 201 - Introdução à ProgramaçãoI Estruturas Homogêneas](https://reader031.vdocuments.net/reader031/viewer/2022012504/617ed7dece2a1763696af336/html5/thumbnails/44.jpg)
17/28
Ordenacao por BubbleSort (Metodo da bolha)
i n t main ( ){i n t a , b , temp , A [ 1 0 0 ] , n , i ;
p r i n t f ("\n Indicar numero de elementos: " ) ;s c a n f (" %d" , &n ) ;p r i n t f ("\n Inserir %d numero: " , n ) ;
f o r ( i = 0 ; i < n ; i ++)s c a n f (" %d" , &A [ i ] ) ;
. . .}
![Page 45: BCC 201 - Introdução à ProgramaçãoI Estruturas Homogêneas](https://reader031.vdocuments.net/reader031/viewer/2022012504/617ed7dece2a1763696af336/html5/thumbnails/45.jpg)
18/28
Ordenacao por BubbleSort (Metodo da bolha)
i n t main ( ){. . .f o r ( a = 1 ; a < n ; a++){
f o r ( b = n − 1 ; b >= a ; b−−){
i f (A [ b − 1 ] > A [ b ] ){ // i n t e r c a m b i a e l e m e n t o s //
temp = A [ b − 1 ] ;A [ b − 1 ] = A [ b ] ;A [ b ] = temp ;
}}
}f o r ( i = 0 ; i < n ; i ++)
p r i n t f (" %d " , A [ i ] ) ;r e t u r n 0 ;
}
![Page 46: BCC 201 - Introdução à ProgramaçãoI Estruturas Homogêneas](https://reader031.vdocuments.net/reader031/viewer/2022012504/617ed7dece2a1763696af336/html5/thumbnails/46.jpg)
19/28
Ordenacao por Selecao I
I Um dos algoritmos mais simples.
I Algoritmo:
1. Selecione o menor item do array
2. Troque-o com o item da primeira posicao do vetor
3. Repita essas duas operacoes com os n − 1 items restantes,depois com os n − 2 items, ate que reste apenas um elemento;
![Page 47: BCC 201 - Introdução à ProgramaçãoI Estruturas Homogêneas](https://reader031.vdocuments.net/reader031/viewer/2022012504/617ed7dece2a1763696af336/html5/thumbnails/47.jpg)
20/28
Ordenacao por Selecao
I O metodo e ilustrado a continuacao:
![Page 48: BCC 201 - Introdução à ProgramaçãoI Estruturas Homogêneas](https://reader031.vdocuments.net/reader031/viewer/2022012504/617ed7dece2a1763696af336/html5/thumbnails/48.jpg)
20/28
Ordenacao por Selecao
I O metodo e ilustrado a continuacao:
![Page 49: BCC 201 - Introdução à ProgramaçãoI Estruturas Homogêneas](https://reader031.vdocuments.net/reader031/viewer/2022012504/617ed7dece2a1763696af336/html5/thumbnails/49.jpg)
20/28
Ordenacao por Selecao
I O metodo e ilustrado a continuacao:
![Page 50: BCC 201 - Introdução à ProgramaçãoI Estruturas Homogêneas](https://reader031.vdocuments.net/reader031/viewer/2022012504/617ed7dece2a1763696af336/html5/thumbnails/50.jpg)
20/28
Ordenacao por Selecao
I O metodo e ilustrado a continuacao:
![Page 51: BCC 201 - Introdução à ProgramaçãoI Estruturas Homogêneas](https://reader031.vdocuments.net/reader031/viewer/2022012504/617ed7dece2a1763696af336/html5/thumbnails/51.jpg)
20/28
Ordenacao por Selecao
I O metodo e ilustrado a continuacao:
![Page 52: BCC 201 - Introdução à ProgramaçãoI Estruturas Homogêneas](https://reader031.vdocuments.net/reader031/viewer/2022012504/617ed7dece2a1763696af336/html5/thumbnails/52.jpg)
20/28
Ordenacao por Selecao
I O metodo e ilustrado a continuacao:
![Page 53: BCC 201 - Introdução à ProgramaçãoI Estruturas Homogêneas](https://reader031.vdocuments.net/reader031/viewer/2022012504/617ed7dece2a1763696af336/html5/thumbnails/53.jpg)
20/28
Ordenacao por Selecao
I O metodo e ilustrado a continuacao:
![Page 54: BCC 201 - Introdução à ProgramaçãoI Estruturas Homogêneas](https://reader031.vdocuments.net/reader031/viewer/2022012504/617ed7dece2a1763696af336/html5/thumbnails/54.jpg)
20/28
Ordenacao por Selecao
I O metodo e ilustrado a continuacao:
![Page 55: BCC 201 - Introdução à ProgramaçãoI Estruturas Homogêneas](https://reader031.vdocuments.net/reader031/viewer/2022012504/617ed7dece2a1763696af336/html5/thumbnails/55.jpg)
20/28
Ordenacao por Selecao
I O metodo e ilustrado a continuacao:
![Page 56: BCC 201 - Introdução à ProgramaçãoI Estruturas Homogêneas](https://reader031.vdocuments.net/reader031/viewer/2022012504/617ed7dece2a1763696af336/html5/thumbnails/56.jpg)
20/28
Ordenacao por Selecao
I O metodo e ilustrado a continuacao:
![Page 57: BCC 201 - Introdução à ProgramaçãoI Estruturas Homogêneas](https://reader031.vdocuments.net/reader031/viewer/2022012504/617ed7dece2a1763696af336/html5/thumbnails/57.jpg)
20/28
Ordenacao por Selecao
I O metodo e ilustrado a continuacao:
![Page 58: BCC 201 - Introdução à ProgramaçãoI Estruturas Homogêneas](https://reader031.vdocuments.net/reader031/viewer/2022012504/617ed7dece2a1763696af336/html5/thumbnails/58.jpg)
21/28
Ordenacao por Insercao
I Um dos metodos mais simples de ordenacao.
I Metodo preferido pelos jogadores de cartas.
I Algoritmo:
1. Para todos os elementos a partir de i = 2
1.1 Selecione o i-esimo item da secuencia1.2 Coloque-o no lugar apropriado na sequencia destino de acordo
con o criterio da ordenacao
![Page 59: BCC 201 - Introdução à ProgramaçãoI Estruturas Homogêneas](https://reader031.vdocuments.net/reader031/viewer/2022012504/617ed7dece2a1763696af336/html5/thumbnails/59.jpg)
22/28
Ordenacao por Insercao
I O metodo e ilustrado a contiucao:
![Page 60: BCC 201 - Introdução à ProgramaçãoI Estruturas Homogêneas](https://reader031.vdocuments.net/reader031/viewer/2022012504/617ed7dece2a1763696af336/html5/thumbnails/60.jpg)
22/28
Ordenacao por Insercao
I O metodo e ilustrado a contiucao:
![Page 61: BCC 201 - Introdução à ProgramaçãoI Estruturas Homogêneas](https://reader031.vdocuments.net/reader031/viewer/2022012504/617ed7dece2a1763696af336/html5/thumbnails/61.jpg)
22/28
Ordenacao por Insercao
I O metodo e ilustrado a contiucao:
![Page 62: BCC 201 - Introdução à ProgramaçãoI Estruturas Homogêneas](https://reader031.vdocuments.net/reader031/viewer/2022012504/617ed7dece2a1763696af336/html5/thumbnails/62.jpg)
22/28
Ordenacao por Insercao
I O metodo e ilustrado a contiucao:
![Page 63: BCC 201 - Introdução à ProgramaçãoI Estruturas Homogêneas](https://reader031.vdocuments.net/reader031/viewer/2022012504/617ed7dece2a1763696af336/html5/thumbnails/63.jpg)
22/28
Ordenacao por Insercao
I O metodo e ilustrado a contiucao:
![Page 64: BCC 201 - Introdução à ProgramaçãoI Estruturas Homogêneas](https://reader031.vdocuments.net/reader031/viewer/2022012504/617ed7dece2a1763696af336/html5/thumbnails/64.jpg)
22/28
Ordenacao por Insercao
I O metodo e ilustrado a contiucao:
![Page 65: BCC 201 - Introdução à ProgramaçãoI Estruturas Homogêneas](https://reader031.vdocuments.net/reader031/viewer/2022012504/617ed7dece2a1763696af336/html5/thumbnails/65.jpg)
22/28
Ordenacao por Insercao
I O metodo e ilustrado a contiucao:
![Page 66: BCC 201 - Introdução à ProgramaçãoI Estruturas Homogêneas](https://reader031.vdocuments.net/reader031/viewer/2022012504/617ed7dece2a1763696af336/html5/thumbnails/66.jpg)
22/28
Ordenacao por Insercao
I O metodo e ilustrado a contiucao:
![Page 67: BCC 201 - Introdução à ProgramaçãoI Estruturas Homogêneas](https://reader031.vdocuments.net/reader031/viewer/2022012504/617ed7dece2a1763696af336/html5/thumbnails/67.jpg)
22/28
Ordenacao por Insercao
I O metodo e ilustrado a contiucao:
![Page 68: BCC 201 - Introdução à ProgramaçãoI Estruturas Homogêneas](https://reader031.vdocuments.net/reader031/viewer/2022012504/617ed7dece2a1763696af336/html5/thumbnails/68.jpg)
22/28
Ordenacao por Insercao
I O metodo e ilustrado a contiucao:
![Page 69: BCC 201 - Introdução à ProgramaçãoI Estruturas Homogêneas](https://reader031.vdocuments.net/reader031/viewer/2022012504/617ed7dece2a1763696af336/html5/thumbnails/69.jpg)
22/28
Ordenacao por Insercao
I O metodo e ilustrado a contiucao:
![Page 70: BCC 201 - Introdução à ProgramaçãoI Estruturas Homogêneas](https://reader031.vdocuments.net/reader031/viewer/2022012504/617ed7dece2a1763696af336/html5/thumbnails/70.jpg)
22/28
Ordenacao por Insercao
I O metodo e ilustrado a contiucao:
![Page 71: BCC 201 - Introdução à ProgramaçãoI Estruturas Homogêneas](https://reader031.vdocuments.net/reader031/viewer/2022012504/617ed7dece2a1763696af336/html5/thumbnails/71.jpg)
22/28
Ordenacao por Insercao
I O metodo e ilustrado a contiucao:
![Page 72: BCC 201 - Introdução à ProgramaçãoI Estruturas Homogêneas](https://reader031.vdocuments.net/reader031/viewer/2022012504/617ed7dece2a1763696af336/html5/thumbnails/72.jpg)
22/28
Ordenacao por Insercao
I O metodo e ilustrado a contiucao:
![Page 73: BCC 201 - Introdução à ProgramaçãoI Estruturas Homogêneas](https://reader031.vdocuments.net/reader031/viewer/2022012504/617ed7dece2a1763696af336/html5/thumbnails/73.jpg)
23/28
Vetores e Ponteiros I
![Page 74: BCC 201 - Introdução à ProgramaçãoI Estruturas Homogêneas](https://reader031.vdocuments.net/reader031/viewer/2022012504/617ed7dece2a1763696af336/html5/thumbnails/74.jpg)
24/28
Vetores e Ponteiros II
![Page 75: BCC 201 - Introdução à ProgramaçãoI Estruturas Homogêneas](https://reader031.vdocuments.net/reader031/viewer/2022012504/617ed7dece2a1763696af336/html5/thumbnails/75.jpg)
25/28
Vetores e Ponteiros III
i n t main ( ){
i n t v [ 1 0 ] , i ;f o r ( i = 0 ; i < 1 0 ; i ++)
v [ i ] = 10∗ i ;// mostrandof o r ( i = 0 ; i < 1 0 ; i ++)
p r i n t f (" %d " , v [ i ] ) ;// mostrando 2f o r ( i = 0 ; i < 1 0 ; i ++)
p r i n t f (" %d " , ∗( v+i ) ) ;r e t u r n 0 ;
}
![Page 76: BCC 201 - Introdução à ProgramaçãoI Estruturas Homogêneas](https://reader031.vdocuments.net/reader031/viewer/2022012504/617ed7dece2a1763696af336/html5/thumbnails/76.jpg)
26/28
FIM