13.12.2012 Views

Algoritmos e Estruturas de dados - Bibliotecas - UTFPR

Algoritmos e Estruturas de dados - Bibliotecas - UTFPR

Algoritmos e Estruturas de dados - Bibliotecas - UTFPR

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

✞<br />

1 // LISTA .H<br />

2 # ifn<strong>de</strong>f _LISTA_<br />

3 # <strong>de</strong>fine _LISTA_<br />

4 # inclu<strong>de</strong> < stdlib .h><br />

5 # inclu<strong>de</strong> <br />

6<br />

7 struct tipo_elemento {<br />

8 int valor ;<br />

9 struct tipo_elemento * proximo ;<br />

10 struct tipo_elemento * anterior ;<br />

11 };<br />

12 type<strong>de</strong>f struct {<br />

13 int qtd ;<br />

14 struct tipo_elemento *fim , * inicio ;<br />

15 } Tipo_Lista ;<br />

16 void inicializa_lista ( Tipo_Lista *a);<br />

17 void insere_lista ( Tipo_Lista *a, int v);<br />

18 void mostra_lista ( Tipo_Lista m);<br />

19 void mostra_elemento ( struct tipo_elemento * tmp );<br />

20 struct tipo_elemento * pesquisa_lista ( Tipo_Lista a, int alvo );<br />

21 void <strong>de</strong>saloca_todos_lista ( Tipo_Lista *a);<br />

22 void elimina ( Tipo_Lista *a, struct tipo_elemento * ponteiro_alvo );<br />

23 # endif<br />

✝ ✆<br />

Código:lista.h Código:lista.c<br />

(<strong>Bibliotecas</strong>) 11 / 18

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!