estructura de datos

Post on 16-Jan-2016

38 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

DESCRIPTION

ARREGLOS. ESTRUCTURA DE DATOS. ING.CIP .IVAN PETRLIK AZABACHE. ARREGLOS. ARREGLOS. Conjunto de espacios de memoria uno a continuacion del otro.Pertenece a un solo tipo de dato donde cada Espacio de memoria es identificado por un indice. TIPOS DE ARREGLOS. - PowerPoint PPT Presentation

TRANSCRIPT

ING.CIP .IVAN PETRLIK AZABACHE

ARREGLOSConjunto de espacios de memoria uno a continuacion del otro.Pertenece a un solo tipo de dato donde cada Espacio de memoria es identificado por un indice.

TIPOS DE ARREGLOSARREGLOS UNIDIMENSIONALES(VECTORES)

TIPOS DE ARREGLOS ARREGLOS BIDIMENSIONALES(MATRICES)

ARREGLO UNIDIMENSIONAL

EN UNA MISMA LINEA:  int x[ ] = new int [ 3 ] ; String nomb [ ] = new String [ 4 ] ;

EN DOS LINEAS: int x [ ] ; x = new int [ 3 ] ; String nomb[]; nomb=new String [ 4 ] ;

DECLARACION E ASIGNACION

En Una Misma Linea: int x[ ]= { 3,5,4,6 }; String

nomb[]={ “ivan”,”carlo”,”beto”,”wily”}; En mas de una Linea : int x [ ]= new int [ 3 ]; x [ 0 ] = 3 ; x [ 1 ] = 5 ; x [ 2 ] = 4 ; x [ 3 ] = 6 ;

ARREGLO BIDIMENSIONAL

EN UNA MISMA LINEA:  int x[ ] [ ] = new int [ 3 ] [3 ] ; String nomb [ ] [ ] = new String [ 4 ] [4 ] ;

EN DOS LINEAS: int x [ ] [ ] ; x = new int [ 3 ] [3 ] ; String nomb[] [ ] ; nomb=new String [ 4 ] [4 ] ;

DECLARACION E ASIGNACION

En Una Misma Linea: int x[ ] [ ] = { { 3 , 5} , {4 ,

6 } }; String nomb[] [ ] ={ {“ivan”,”carlo”},

{”beto”,”wily” }}; En mas de una Linea : int x [ ] [ ] = new int [ 2] [ 2] ; x [ 0 ] [0 ] = 3 ; x [ 1 ] [ 1] = 5 ;

top related