Listas

  • Uploaded by: Luz Divina
  • 0
  • 0
  • August 2019
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Listas as PDF for free.

More details

  • Words: 236
  • Pages: 3
Autor: LUZ DIVINA BARRIOS ROJAS Struct nodo{ int num nodo *sig } procedimiento imprimir_salteada( nodo *cab) si cab== Null Escribir" Su lista llego vacia" Sino Si cab->sig== Null Escribir" Su lista esta vacia" Sino p<- cab q<-cab->sig MQ q!= null Esc p->num p<-p->sig Fin MQ Fin SI Fin Si fin imprimir_salteada -------------------------2 Struct nodo{ int num nodo *sig } int numeros_primos(nodo *cab) int c, s,i c<- -1 si cab== Null c<- -1 Sino Si cab->sig== Null c<- -1 sino c<-0 p<-cab MQ p!=NULL for i=1, i<- p->info-1, i++ if(p->info mod i=0) s=s+1 fin si fin para p<-p->sig fin MQ if (s=1) c<-C+1 fin si Fin si Fin si retornar(c) fin numeros_primos ------------------3. Struct nodo{ int num

nodo *sig } procedimiento triangulo(nodo *cab, int *can, int *ca, int *c) Si cab=NUll can<- -1 ca<- -1 c<- -1 Sino Si cab->sig=NULL can <- -1 ca<- -1 c<- -1 Sino Si cab->sig->sig = NULL can<- -1 ca<- -1 c<- -1 Sino p<-cab q<- p->sig t<-q->sig can<-0 c<- 0 ca<- 0 MQ t!= NULL Si (q->num==p->num) y (t->num==p->num) can<- can++ sino si (q->num==p->num) o (t->num==p->num) o (q->num==t->num) ca<- ca++ sino c<-c++ fin si finsi q<-q->sig p<- p->sig t<-t->sig fin MQ Fin si fin si fin si Fin triangulo 4. ----------------------------------------boolean numero_negativos( nodo *cab) boolean n<- false si cab=NUll n<-false sino n<- false p<-cab MQ p!=NULL Si p->info <0 n<-tru fin si p<-p->sig fin mq fin si retornar( n)

fin numero_negativo

Related Documents

Listas
April 2020 22
Listas
August 2019 49
Listas
June 2020 15
Listas
June 2020 14
Java-listas
December 2019 22

More Documents from "Laoska B."

Taller.txt
August 2019 21
Hibernateesquema.pdf
August 2019 21
Listas
August 2019 49
Heragest-pil.pdf
November 2019 16