Documentos de Académico
Documentos de Profesional
Documentos de Cultura
Es t r uct ur a d e
D at os Bu sca r en est e si t i o
Pagina de Lectura
http://es.wikibooks.org/wiki/Estructuras_de_datos_din%C3%A1micas
Concepto de árbol.
https://sites.google.com/site/estdatjiq/home/unidad-iv 1/30
1/27/15 Unidad IV Estructuras no lineales - Estructura de Datos
Translate
En relación a su tamaño:
- Orden, es el número potencial de nodos hijos
que tiene un nodo padre (orden 2).
https://sites.google.com/site/estdatjiq/home/unidad-iv 2/30
1/27/15 Unidad IV Estructuras no lineales - Estructura de Datos
Clasificación de árboles.
- Árboles binarios.
o Distintos
o Similares
o Equivalentes
o Equilibrado
o Completo
- Árboles Multicaminos.
o B
o B+
o B*
o R
o 2-4
https://sites.google.com/site/estdatjiq/home/unidad-iv 3/30
1/27/15 Unidad IV Estructuras no lineales - Estructura de Datos
https://sites.google.com/site/estdatjiq/home/unidad-iv 4/30
1/27/15 Unidad IV Estructuras no lineales - Estructura de Datos
Número de nodos = 23 – 1 = 8 – 1 = 7
https://sites.google.com/site/estdatjiq/home/unidad-iv 5/30
1/27/15 Unidad IV Estructuras no lineales - Estructura de Datos
- Eliminación de un nodo.
- Recorrido del árbol.
- Balanceo del árbol.
Creación.
Dato
Der.
Izq.
Padre
- Padre,
- Dato,
- Izquierda y
- Derecha.
Dato
Der.
Izq.
https://sites.google.com/site/estdatjiq/home/unidad-iv 6/30
1/27/15 Unidad IV Estructuras no lineales - Estructura de Datos
- Dato,
- Izquierda y
- Derecha.
Object elemento;
//métodos
Inserción.
https://sites.google.com/site/estdatjiq/home/unidad-iv 8/30
1/27/15 Unidad IV Estructuras no lineales - Estructura de Datos
· Visitar la raíz
b) Recorrido en inorden
· Recorrer el subárbol izquierdo
· Visitar la raíz
c) Recorrido en postorden
· Visitar la raíz
https://sites.google.com/site/estdatjiq/home/unidad-iv 9/30
1/27/15 Unidad IV Estructuras no lineales - Estructura de Datos
Preorden (15,8,4,10,20,17,35)
4 null
5 (3) null
7 null
8 (4) null
11 null
12 (6) null
14 Null
15 (7) null
https://sites.google.com/site/estdatjiq/home/unidad-iv 10/30
1/27/15 Unidad IV Estructuras no lineales - Estructura de Datos
Inorden (4,8,10,15,17,20,35)
4 Null 4 (6)
7 Null 10 (8)
10 17 17.izq- 17.der->null(11)
>null
17 (12)
11 null 17 (12)
12 (11) 20 (10)
null
14 null 35 (14)
15 (13)
null
https://sites.google.com/site/estdatjiq/home/unidad-iv 11/30
1/27/15 Unidad IV Estructuras no lineales - Estructura de Datos
Postorden(4,10,8,17,35,20,15)
1 15 15.izq- 15 (1)
>8
15.der->20 (2)
2 8 8.izq->4 8 (3)
8.der->10 (4)
3 4 4.izq- 4 (5)
>null
4.der->null (6)
4 null
7 null
9 8 (3)
11 17 17.izq- 17(11)
>null
17.der->null(12)
12 null
13 (12) 17 (11)
null
15 null
https://sites.google.com/site/estdatjiq/home/unidad-iv 12/30
1/27/15 Unidad IV Estructuras no lineales - Estructura de Datos
16 (14) 35 (13)
null
17 20 (9)
18 15 (1)
Eliminación.
https://sites.google.com/site/estdatjiq/home/unidad-iv 13/30
1/27/15 Unidad IV Estructuras no lineales - Estructura de Datos
· Se pone a resp=resp.hijoi
· Se pone a resp=resp.hijod
· Si es así se pone a la
raíz=resp
· ant.hijoi=resp
https://sites.google.com/site/estdatjiq/home/unidad-iv 16/30
1/27/15 Unidad IV Estructuras no lineales - Estructura de Datos
· Si es así se pone a la
raíz=resp
· ant.hijoi=resp
https://sites.google.com/site/estdatjiq/home/unidad-iv 18/30
1/27/15 Unidad IV Estructuras no lineales - Estructura de Datos
· Se pone a resp=resp.hijoi
· Se pone a resp=resp.hijod
https://sites.google.com/site/estdatjiq/home/unidad-iv 19/30
1/27/15 Unidad IV Estructuras no lineales - Estructura de Datos
· Si es así se pone a la
raíz=resp
· ant.hijoi=resp
https://sites.google.com/site/estdatjiq/home/unidad-iv 20/30
1/27/15 Unidad IV Estructuras no lineales - Estructura de Datos
· Si es así se pone a la
raíz=resp
· ant.hijoi=resp
Balanceo.
aplicando recursividad:
https://sites.google.com/site/estdatjiq/home/unidad-iv 23/30
1/27/15 Unidad IV Estructuras no lineales - Estructura de Datos
4 5 8 10 15 17 20 35
i.
Lista,0,mitad-1= Lista,0,2
https://sites.google.com/site/estdatjiq/home/unidad-iv 24/30
1/27/15 Unidad IV Estructuras no lineales - Estructura de Datos
i.
Lista,mitad+1,final= Lista,4,7
e. Regresar al paso 2.
3 (Lista,0,0) (0+0)/2=0 4 Ya no s
condició
4 (Lista,2,2) (2+2)/2=2 8 Ya no s
condició
6 (Lista,4,4) (4+4)/2=4 15 Ya no s
condició
8 (Lista,7,7) (7+7)/2=7 35 Ya no s
condició
var_boolean=arbol.add(Object
https://sites.google.com/site/estdatjiq/home/unidad-iv 26/30
1/27/15 Unidad IV Estructuras no lineales - Estructura de Datos
elemento);
var_boolean=arbol.addFirst(Collection
colección);
arbol.clear();
arbol_destino=arbol.clone();
var_String=arbol.comparator();
var_boolean=arbol.contains(Object
elemento);
https://sites.google.com/site/estdatjiq/home/unidad-iv 27/30
1/27/15 Unidad IV Estructuras no lineales - Estructura de Datos
var_Object=arbol.first();
var_SortedSet=arbol.headSet(Object
elemento);
var_boolean=arbol.isEmpty();
var_Iterator=arbol.iterator();
var_Object=arbol.last();
var_boolean=arbol.remove(Object
elemento);
var_int=arbol.size();
var_sortedSet=arbol.subSet(Object
primero, Object último);
https://sites.google.com/site/estdatjiq/home/unidad-iv 29/30
1/27/15 Unidad IV Estructuras no lineales - Estructura de Datos
var_sortedSet=arbol.tailSet(Object
elemento);
arr_Object=arbol.toArray();
Comments
https://sites.google.com/site/estdatjiq/home/unidad-iv 30/30