Logo Passei Direto

URJC _Universidad Rey Juan Carlos_ _ GRado Ingeniería en Sistemas Audiovisuales y multimedia _ ADA_Práctica para clase y apuntes de la asignatur_ _ 5_tablas_d

User badge image
Diego Pereira

en

Herramientas de estudio

Material
¡Estudia con miles de materiales!

Vista previa del material en texto

Tablas de Śımbolos
Programación de Sistemas de Telecomunicación
Informática II
Departamento de Sistemas Telemáticos y Computación
(GSyC)
Universidad Rey Juan Carlos
Noviembre 2019
GSyC - 2019 Tablas de Śımbolos 1
c©2016-2019 Grupo de Sistemas y Comunicaciones.
Algunos derechos reservados.
Este trabajo se distribuye bajo la licencia
Creative Commons Attribution Share-Alike
disponible en http://creativecommons.org/licenses/by-sa/2.1/es
GSyC - 2019 Tablas de Śımbolos 2
Contenidos
1 Tablas de Śımbolos
2 Implementación de TS mediante un array no ordenado
3 Implementación de TS mediante una lista enlazada no ordenada
4 Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
5 Iteración sobre todos los elementos de una colección
6 Implementación de TS mediante un Array ordenado
7 Implementación de TS mediante una lista enlazada ordenada
8 Implementación de TS mediante un árbol de búsqueda binaria (ABB)
9 Ejemplo de ejecución: Get en un ABB
10 Ejemplo de ejecución: Put en un ABB vaćıo
11 Ejemplo de ejecución: Put en un ABB
12 Borrado de un nodo en un ABB
GSyC - 2019 Tablas de Śımbolos 3
Tablas de Śımbolos
Contenidos
1 Tablas de Śımbolos
2 Implementación de TS mediante un array no ordenado
3 Implementación de TS mediante una lista enlazada no ordenada
4 Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
5 Iteración sobre todos los elementos de una colección
6 Implementación de TS mediante un Array ordenado
7 Implementación de TS mediante una lista enlazada ordenada
8 Implementación de TS mediante un árbol de búsqueda binaria (ABB)
9 Ejemplo de ejecución: Get en un ABB
10 Ejemplo de ejecución: Put en un ABB vaćıo
11 Ejemplo de ejecución: Put en un ABB
12 Borrado de un nodo en un ABB
GSyC - 2019 Tablas de Śımbolos 4
Tablas de Śımbolos
Tablas de śımbolos
La tabla de śımbolos es una estructura de datos también
conocida por los siguientes nombres: mapa, array asociativo,
diccionario.
La tabla de śımbolos es una estructura de datos que almacena
elementos compuestos por parejas (Clave, Valor).
Clave y Valor pueden ser tipos de datos cualesquiera.
GSyC - 2019 Tablas de Śımbolos 5
Tablas de Śımbolos
Usos de las tablas de śımbolos (I)
Lista de usuarios en Mini-Chat:
(Clave => EP, Valor => Nickname)
Listado de teléfonos:
(Clave => Nombre, Valor => No de teléfono)
Diccionario:
(Clave => Palabra, Valor => Definición)
DNS:
(Clave => Nombre de máquina, Valor => Dirección IP)
DNS inverso:
(Clave => Dirección IP, Valor => Nombre de máquina)
GSyC - 2019 Tablas de Śımbolos 6
Tablas de Śımbolos
Usos de las tablas de śımbolos (II)
Valoración bursátil:
(Clave => Valor bursátil, Valor => Cotización)
Intercambio de ficheros P2P:
(Clave => Fichero, Valor => Máquina)
Índice inverso de un libro:
(Clave => Vocablo, Value => Lista de números de página)
Catálogo de buscador Web:
(Clave => Palabra, Value => Sitios web )
GSyC - 2019 Tablas de Śımbolos 7
Tablas de Śımbolos
Operaciones permitidas
Las tablas de śımbolos se caracterizan porque disponen de las
siguientes operaciones básicas:
Put: Dado un nuevo elemento (Clave, Valor) como
parámetro, se añade éste a la tabla. Si ya exist́ıa un elemento
con la misma Clave, se sustituye su Valor asociado por el
especificado en la llamada a Put
Get: Dada una Clave como parámetro, devuelve el Valor
asociado a la misma en la tabla en caso de que exista un
elemento (Clave, Valor)
Delete: Dada un Clave como parámetro, se borra de la tabla,
si existe, el elemento (Clave, Valor)
Todas las tablas de śımbolos tienen al menos esas 3
operaciones, independientemente del tipo de datos que
almacenen.
GSyC - 2019 Tablas de Śımbolos 8
Tablas de Śımbolos
Especificación de la tabla de śımbolos
with Ada.Strings.Unbounded;
package Maps is
type Map is limited private;
procedure Get (M : Map;
Key : in ASU.Unbounded_String;
Value : out ASU.Unbounded_String;
Success : out Boolean);
procedure Put (M : in out Map;
Key : ASU.Unbounded_String;
Value : ASU.Unbounded_String);
procedure Delete (M : in out Map;
Key : in Asu.Unbounded_String;
Success : out Boolean);
function Map_Length (M : Map) return Natural;
--
-- Cursor Interface for iterating over Map elements
--
...
private
...
end Maps;
GSyC - 2019 Tablas de Śımbolos 9
Tablas de Śımbolos
Implementaciones de tablas de śımbolos
Mediante un Array no ordenado
Mediante una Lista enlazada no ordenada
Mediante un Array ordenado con búsqueda binaria
Mediante una Lista enlazada ordenada
Mediante un Árbol de búsqueda binaria (ABB)
GSyC - 2019 Tablas de Śımbolos 10
Implementación de TS mediante un array no ordenado
Contenidos
1 Tablas de Śımbolos
2 Implementación de TS mediante un array no ordenado
3 Implementación de TS mediante una lista enlazada no ordenada
4 Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
5 Iteración sobre todos los elementos de una colección
6 Implementación de TS mediante un Array ordenado
7 Implementación de TS mediante una lista enlazada ordenada
8 Implementación de TS mediante un árbol de búsqueda binaria (ABB)
9 Ejemplo de ejecución: Get en un ABB
10 Ejemplo de ejecución: Put en un ABB vaćıo
11 Ejemplo de ejecución: Put en un ABB
12 Borrado de un nodo en un ABB
GSyC - 2019 Tablas de Śımbolos 11
Implementación de TS mediante un array no ordenado
Implementación de TS mediante un array no ordenado
Put, Get y Delete requieren una búsqueda lineal en el Array:
en el peor caso hay que recorrer todos los elementos
El Array tiene un tamaño máximo fijado de antemano
GSyC - 2019 Tablas de Śımbolos 12
Implementación de TS mediante una lista enlazada no ordenada
Contenidos
1 Tablas de Śımbolos
2 Implementación de TS mediante un array no ordenado
3 Implementación de TS mediante una lista enlazada no ordenada
4 Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
5 Iteración sobre todos los elementos de una colección
6 Implementación de TS mediante un Array ordenado
7 Implementación de TS mediante una lista enlazada ordenada
8 Implementación de TS mediante un árbol de búsqueda binaria (ABB)
9 Ejemplo de ejecución: Get en un ABB
10 Ejemplo de ejecución: Put en un ABB vaćıo
11 Ejemplo de ejecución: Put en un ABB
12 Borrado de un nodo en un ABB
GSyC - 2019 Tablas de Śımbolos 13
Implementación de TS mediante una lista enlazada no ordenada
Tipos de datos
package Maps is
package ASU renames Ada.Strings.Unbounded;
type Map is limited private;
procedure Get (M : Map;
Key : in ASU.Unbounded_String;
Value : out ASU.Unbounded_String;
Success : out Boolean);
private
type Cell;
type Cell_A is access Cell;
type Cell is record
Key : ASU.Unbounded_String := ASU.Null_Unbounded_String;
Value : ASU.Unbounded_String := ASU.Null_Unbounded_String;
Next : Cell_A;
end record;
type Map is record
P_First : Cell_A;
Length : Natural := 0;
end record;
end Maps;
GSyC - 2019 Tablas de Śımbolos 14
Implementación de TS mediante una lista enlazada no ordenada
Comparación con la implementación mediante un Array no
ordenado
La lista enlazada puede crecer / contraerse
La búsqueda de un elemento (Get) no mejora respecto a la
implementación con un Array no ordenado: hay que buscar
linealmente la Clave
La inserción de un elemento (Put) tampoco mejora, pues
requiere buscar la Clave, ya que si existe hay que sustituir el
valor almacenado por el nuevo
El borrado de un elemento (Delete) tampoco mejora, pues,
de nuevo, hay que buscar la Clave
GSyC - 2019 Tablas de Śımbolos 15
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
Contenidos
1 Tablas de Śımbolos
2 Implementación de TS mediante un array no ordenado
3 Implementación de TS mediante una lista enlazada no ordenada
4 Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
5 Iteración sobre todos los elementos de una colección
6 Implementación de TS mediante unArray ordenado
7 Implementación de TS mediante una lista enlazada ordenada
8 Implementación de TS mediante un árbol de búsqueda binaria (ABB)
9 Ejemplo de ejecución: Get en un ABB
10 Ejemplo de ejecución: Put en un ABB vaćıo
11 Ejemplo de ejecución: Put en un ABB
12 Borrado de un nodo en un ABB
GSyC - 2019 Tablas de Śımbolos 16
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
Maps.Put (A_Map, ASU.To_Unbounded_String("facebook.com"), 
 ASU.To_Unbounded_String("69.63.189.16")); 1 
Maps.Get (A_Map, ASU.To_Unbounded_String(“www.urjc.es"), 
 Value, Success); 2 
Maps.Put (A_Map, ASU.To_Unbounded_String(“google.com"), 
 ASU.To_Unbounded_String(“66.249.92.104")); 
3 
Maps.Put (A_Map, ASU.To_Unbounded_String(“www.urjc.es"), 
 ASU.To_Unbounded_String(“212.128.240.25")); 
4 
Maps.Put (A_Map, ASU.To_Unbounded_String(“facebook.com"), 
 ASU.To_Unbounded_String(“69.63.189.11")); 
5 
Maps.Delete (A_Map, ASU.To_Unbounded_String(“google.com"),Success); 
6 
Maps.Delete (A_Map, ASU.To_Unbounded_String(“www.urjc.es"),Success); 7 
GSyC - 2019 Tablas de Śımbolos 17
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
A_Map.P_First	
  
0 
A_Map.Length 
Key	
  
Value 
Next	
  
Cell	
   Maps.Put (A_Map, ASU.To_Unbounded_String("facebook.com"), 
 ASU.To_Unbounded_String("69.63.189.16")); 1 
GSyC - 2019 Tablas de Śımbolos 18
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
  
0 
M.Length 
procedure Put (M : in out Map; 
 Key : ASU.Unbounded_String; 
 Value : ASU.Unbounded_String) is 
 P_Aux : Cell_A; 
 Success : Boolean; 
begin 
 P_Aux := M.P_First; 
 Success := False; 
 while not Success and P_Aux /= null loop 
 if P_Aux.Key = Key then 
 P_Aux.Value := Value; 
 Success := True; 
 end if; 
 P_Aux := P_Aux.Next; 
 end loop; 
 if not Success then 
 M.P_First:=new Cell'(Key, Value, M.P_First); 
 M.Length := M.Length + 1; 
 end if; 
end Put; 
P_Aux	
  
Key	
  
Value 
Next	
  
Cell	
   Maps.Put (A_Map, ASU.To_Unbounded_String("facebook.com"), 
 ASU.To_Unbounded_String("69.63.189.16")); 1 
? 
Success 
GSyC - 2019 Tablas de Śımbolos 19
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
  
0 
M.Length 
procedure Put (M : in out Map; 
 Key : ASU.Unbounded_String; 
 Value : ASU.Unbounded_String) is 
 P_Aux : Cell_A; 
 Success : Boolean; 
begin 
 P_Aux := M.P_First; 
 Success := False; 
 while not Success and P_Aux /= null loop 
 if P_Aux.Key = Key then 
 P_Aux.Value := Value; 
 Success := True; 
 end if; 
 P_Aux := P_Aux.Next; 
 end loop; 
 if not Success then 
 M.P_First:=new Cell'(Key, Value, M.P_First); 
 M.Length := M.Length + 1; 
 end if; 
end Put; 
P_Aux	
  
Key	
  
Value 
Next	
  
Cell	
   Maps.Put (A_Map, ASU.To_Unbounded_String("facebook.com"), 
 ASU.To_Unbounded_String("69.63.189.16")); 1 
? 
Success 
GSyC - 2019 Tablas de Śımbolos 20
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
  
0 
M.Length 
procedure Put (M : in out Map; 
 Key : ASU.Unbounded_String; 
 Value : ASU.Unbounded_String) is 
 P_Aux : Cell_A; 
 Success : Boolean; 
begin 
 P_Aux := M.P_First; 
 Success := False; 
 while not Success and P_Aux /= null loop 
 if P_Aux.Key = Key then 
 P_Aux.Value := Value; 
 Success := True; 
 end if; 
 P_Aux := P_Aux.Next; 
 end loop; 
 if not Success then 
 M.P_First:=new Cell'(Key, Value, M.P_First); 
 M.Length := M.Length + 1; 
 end if; 
end Put; 
P_Aux	
  
Key	
  
Value 
Next	
  
Cell	
   Maps.Put (A_Map, ASU.To_Unbounded_String("facebook.com"), 
 ASU.To_Unbounded_String("69.63.189.16")); 1 
False 
Success 
GSyC - 2019 Tablas de Śımbolos 21
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
  
0 
M.Length 
procedure Put (M : in out Map; 
 Key : ASU.Unbounded_String; 
 Value : ASU.Unbounded_String) is 
 P_Aux : Cell_A; 
 Success : Boolean; 
begin 
 P_Aux := M.P_First; 
 Success := False; 
 while not Success and P_Aux /= null loop 
 if P_Aux.Key = Key then 
 P_Aux.Value := Value; 
 Success := True; 
 end if; 
 P_Aux := P_Aux.Next; 
 end loop; 
 if not Success then 
 M.P_First:=new Cell'(Key, Value, M.P_First); 
 M.Length := M.Length + 1; 
 end if; 
end Put; False 
Success 
P_Aux	
  
Key	
  
Value 
Next	
  
Cell	
   Maps.Put (A_Map, ASU.To_Unbounded_String("facebook.com"), 
 ASU.To_Unbounded_String("69.63.189.16")); 1 
GSyC - 2019 Tablas de Śımbolos 22
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
  
0 
M.Length 
procedure Put (M : in out Map; 
 Key : ASU.Unbounded_String; 
 Value : ASU.Unbounded_String) is 
 P_Aux : Cell_A; 
 Success : Boolean; 
begin 
 P_Aux := M.P_First; 
 Success := False; 
 while not Success and P_Aux /= null loop 
 if P_Aux.Key = Key then 
 P_Aux.Value := Value; 
 Success := True; 
 end if; 
 P_Aux := P_Aux.Next; 
 end loop; 
 if not Success then 
 M.P_First:=new Cell'(Key, Value, M.P_First); 
 M.Length := M.Length + 1; 
 end if; 
end Put; False 
Success 
P_Aux	
  
Key	
  
Value 
Next	
  
Cell	
   Maps.Put (A_Map, ASU.To_Unbounded_String("facebook.com"), 
 ASU.To_Unbounded_String("69.63.189.16")); 1 
GSyC - 2019 Tablas de Śımbolos 23
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
  
0 
M.Length 
procedure Put (M : in out Map; 
 Key : ASU.Unbounded_String; 
 Value : ASU.Unbounded_String) is 
 P_Aux : Cell_A; 
 Success : Boolean; 
begin 
 P_Aux := M.P_First; 
 Success := False; 
 while not Success and P_Aux /= null loop 
 if P_Aux.Key = Key then 
 P_Aux.Value := Value; 
 Success := True; 
 end if; 
 P_Aux := P_Aux.Next; 
 end loop; 
 if not Success then 
 M.P_First:=new Cell'(Key, Value, M.P_First); 
 M.Length := M.Length + 1; 
 end if; 
end Put; False 
Success 
P_Aux	
  
Key	
  
Value 
Next	
  
Cell	
   Maps.Put (A_Map, ASU.To_Unbounded_String("facebook.com"), 
 ASU.To_Unbounded_String("69.63.189.16")); 1 
GSyC - 2019 Tablas de Śımbolos 24
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
  
0 
M.Length 
procedure Put (M : in out Map; 
 Key : ASU.Unbounded_String; 
 Value : ASU.Unbounded_String) is 
 P_Aux : Cell_A; 
 Success : Boolean; 
begin 
 P_Aux := M.P_First; 
 Success := False; 
 while not Success and P_Aux /= null loop 
 if P_Aux.Key = Key then 
 P_Aux.Value := Value; 
 Success := True; 
 end if; 
 P_Aux := P_Aux.Next; 
 end loop; 
 if not Success then 
 M.P_First:=new Cell'(Key, Value, M.P_First); 
 M.Length := M.Length + 1; 
 end if; 
end Put; False 
Success 
P_Aux	
  
Key	
  
Value 
Next	
  
cell	
   Maps.Put (A_Map, ASU.To_Unbounded_String("facebook.com"), 
 ASU.To_Unbounded_String("69.63.189.16")); 1 
GSyC - 2019 Tablas de Śımbolos 25
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
  
0 
M.Length 
procedure Put (M : in out Map; 
 Key : ASU.Unbounded_String; 
 Value : ASU.Unbounded_String) is 
 P_Aux : Cell_A; 
 Success : Boolean; 
begin 
 P_Aux := M.P_First; 
 Success := False; 
 while not Success and P_Aux /= null loop 
 if P_Aux.Key = Key then 
 P_Aux.Value := Value; 
 Success := True; 
 end if; 
 P_Aux := P_Aux.Next; 
 end loop; 
 if not Success then 
 M.P_First:=new Cell'(Key, Value, M.P_First); 
 M.Length := M.Length + 1; 
 end if; 
endPut; False 
Success 
P_Aux	
  
Key	
  
Value 
Next	
  
Cell	
   Maps.Put (A_Map, ASU.To_Unbounded_String("facebook.com"), 
 ASU.To_Unbounded_String("69.63.189.16")); 1 
“facebook.com"	
  
“69.63.189.16” 
GSyC - 2019 Tablas de Śımbolos 26
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
“facebook.com"	
  
“69.63.189.16” 
0 
M.Length 
procedure Put (M : in out Map; 
 Key : ASU.Unbounded_String; 
 Value : ASU.Unbounded_String) is 
 P_Aux : Cell_A; 
 Success : Boolean; 
begin 
 P_Aux := M.P_First; 
 Success := False; 
 while not Success and P_Aux /= null loop 
 if P_Aux.Key = Key then 
 P_Aux.Value := Value; 
 Success := True; 
 end if; 
 P_Aux := P_Aux.Next; 
 end loop; 
 if not Success then 
 M.P_First:=new Cell'(Key, Value, M.P_First); 
 M.Length := M.Length + 1; 
 end if; 
end Put; False 
Success 
P_Aux	
  
Key	
  
Value 
Next	
  
Cell	
   Maps.Put (A_Map, ASU.To_Unbounded_String("facebook.com"), 
 ASU.To_Unbounded_String("69.63.189.16")); 1 
M.P_First	
  
GSyC - 2019 Tablas de Śımbolos 27
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
   “facebook.com"	
  
“69.63.189.16” 
0 
M.Length 
procedure Put (M : in out Map; 
 Key : ASU.Unbounded_String; 
 Value : ASU.Unbounded_String) is 
 P_Aux : Cell_A; 
 Success : Boolean; 
begin 
 P_Aux := M.P_First; 
 Success := False; 
 while not Success and P_Aux /= null loop 
 if P_Aux.Key = Key then 
 P_Aux.Value := Value; 
 Success := True; 
 end if; 
 P_Aux := P_Aux.Next; 
 end loop; 
 if not Success then 
 M.P_First:=new Cell'(Key, Value, M.P_First); 
 M.Length := M.Length + 1; 
 end if; 
end Put; False 
Success 
P_Aux	
  
Key	
  
Value 
Next	
  
Cell	
   Maps.Put (A_Map, ASU.To_Unbounded_String("facebook.com"), 
 ASU.To_Unbounded_String("69.63.189.16")); 1 
GSyC - 2019 Tablas de Śımbolos 28
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
   “facebook.com"	
  
“69.63.189.16” 
0 
M.Length 
procedure Put (M : in out Map; 
 Key : ASU.Unbounded_String; 
 Value : ASU.Unbounded_String) is 
 P_Aux : Cell_A; 
 Success : Boolean; 
begin 
 P_Aux := M.P_First; 
 Success := False; 
 while not Success and P_Aux /= null loop 
 if P_Aux.Key = Key then 
 P_Aux.Value := Value; 
 Success := True; 
 end if; 
 P_Aux := P_Aux.Next; 
 end loop; 
 if not Success then 
 M.P_First:=new Cell'(Key, Value, M.P_First); 
 M.Length := M.Length + 1; 
 end if; 
end Put; False 
Success 
P_Aux	
  
Key	
  
Value 
Next	
  
Cell	
   Maps.Put (A_Map, ASU.To_Unbounded_String("facebook.com"), 
 ASU.To_Unbounded_String("69.63.189.16")); 1 
GSyC - 2019 Tablas de Śımbolos 29
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
   “facebook.com"	
  
“69.63.189.16” 
1 
M.Length 
procedure Put (M : in out Map; 
 Key : ASU.Unbounded_String; 
 Value : ASU.Unbounded_String) is 
 P_Aux : Cell_A; 
 Success : Boolean; 
begin 
 P_Aux := M.P_First; 
 Success := False; 
 while not Success and P_Aux /= null loop 
 if P_Aux.Key = Key then 
 P_Aux.Value := Value; 
 Success := True; 
 end if; 
 P_Aux := P_Aux.Next; 
 end loop; 
 if not Success then 
 M.P_First:=new Cell'(Key, Value, M.P_First); 
 M.Length := M.Length + 1; 
 end if; 
end Put; False 
Success 
P_Aux	
  
Key	
  
Value 
Next	
  
Cell	
   Maps.Put (A_Map, ASU.To_Unbounded_String("facebook.com"), 
 ASU.To_Unbounded_String("69.63.189.16")); 1 
GSyC - 2019 Tablas de Śımbolos 30
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
   “facebook.com"	
  
“69.63.189.16” 
1 
M.Length 
procedure Put (M : in out Map; 
 Key : ASU.Unbounded_String; 
 Value : ASU.Unbounded_String) is 
 P_Aux : Cell_A; 
 Success : Boolean; 
begin 
 P_Aux := M.P_First; 
 Success := False; 
 while not Success and P_Aux /= null loop 
 if P_Aux.Key = Key then 
 P_Aux.Value := Value; 
 Success := True; 
 end if; 
 P_Aux := P_Aux.Next; 
 end loop; 
 if not Success then 
 M.P_First:=new Cell'(Key, Value, M.P_First); 
 M.Length := M.Length + 1; 
 end if; 
end Put; False 
Success 
P_Aux	
  
Key	
  
Value 
Next	
  
Cell	
   Maps.Put (A_Map, ASU.To_Unbounded_String("facebook.com"), 
 ASU.To_Unbounded_String("69.63.189.16")); 1 
GSyC - 2019 Tablas de Śımbolos 31
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
   “facebook.com"	
  
“69.63.189.16” 
1 
M.Length 
procedure Put (M : in out Map; 
 Key : ASU.Unbounded_String; 
 Value : ASU.Unbounded_String) is 
 P_Aux : Cell_A; 
 Success : Boolean; 
begin 
 P_Aux := M.P_First; 
 Success := False; 
 while not Success and P_Aux /= null loop 
 if P_Aux.Key = Key then 
 P_Aux.Value := Value; 
 Success := True; 
 end if; 
 P_Aux := P_Aux.Next; 
 end loop; 
 if not Success then 
 M.P_First:=new Cell'(Key, Value, M.P_First); 
 M.Length := M.Length + 1; 
 end if; 
end Put; False 
Success 
P_Aux	
  
Key	
  
Value 
Next	
  
Cell	
   Maps.Put (A_Map, ASU.To_Unbounded_String("facebook.com"), 
 ASU.To_Unbounded_String("69.63.189.16")); 1 
GSyC - 2019 Tablas de Śımbolos 32
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
A_Map.P_First	
  
“facebook.com"	
  
“69.63.189.16” 
1 
A_Map.Length 
Key	
  
Value 
Next	
  
Cell	
   Maps.Get(A_Map, ASU.To_Unbounded_String(“www.urjc.es"), 
 Value, Success); 2 
GSyC - 2019 Tablas de Śımbolos 33
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First “facebook.com"	
  
“69.63.189.16” 
1 
M.Length 
procedure Get (M : in out Map; 
 Key : in ASU.Unbounded_String; 
 Value : out ASU.Unbounded_String; 
 Success: out Boolean) is 
 P_Aux : Cell_A; 
begin 
 Value := ASU.Null_Unbounded_String; 
 P_Aux := M.P_First; 
 Success := False; 
 while not Success and P_Aux /= null Loop 
 if P_Aux.Key = Key then 
 Value := P_Aux.Value; 
 Success := True; 
 end if; 
 P_Aux := P_Aux.Next; 
 end loop; 
end Get; 
P_Aux	
  
Key	
  
Value 
Next	
  
Cell	
  
? 
Value 
? 
Success 
Maps.Get(A_Map, ASU.To_Unbounded_String(“www.urjc.es"), 
 Value, Success); 2 
GSyC - 2019 Tablas de Śımbolos 34
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
   “facebook.com"	
  
“69.63.189.16” 
1 
M.Length 
P_Aux	
  
Key	
  
Value 
Next	
  
Cell	
  
procedure Get (M : in out Map; 
 Key : in ASU.Unbounded_String; 
 Value : out ASU.Unbounded_String; 
 Success: out Boolean) is 
 P_Aux : Cell_A; 
begin 
 Value := ASU.Null_Unbounded_String; 
 P_Aux := M.P_First; 
 Success := False; 
 while not Success and P_Aux /= null Loop 
 if P_Aux.Key = Key then 
 Value := P_Aux.Value; 
 Success := True; 
 end if; 
 P_Aux := P_Aux.Next; 
 end loop; 
end Get; 
? 
Value 
? 
Success 
Maps.Get(A_Map, ASU.To_Unbounded_String(“www.urjc.es"), 
 Value, Success); 2 
GSyC - 2019 Tablas de Śımbolos 35
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
   “facebook.com"	
  
“69.63.189.16” 
1 
M.Length 
P_Aux	
  
Key	
  
Value 
Next	
  
Cell	
  
procedure Get (M : in out Map; 
 Key : in ASU.Unbounded_String; 
 Value : out ASU.Unbounded_String; 
 Success: out Boolean) is 
 P_Aux : Cell_A; 
begin 
 Value := ASU.Null_Unbounded_String; 
 P_Aux := M.P_First; 
 Success := False; 
 while not Success andP_Aux /= null Loop 
 if P_Aux.Key = Key then 
 Value := P_Aux.Value; 
 Success := True; 
 end if; 
 P_Aux := P_Aux.Next; 
 end loop; 
end Get; 
? 
Success 
Null_Unbounded_String 
Value 
Maps.Get(A_Map, ASU.To_Unbounded_String(“www.urjc.es"), 
 Value, Success); 2 
GSyC - 2019 Tablas de Śımbolos 36
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
   “facebook.com"	
  
“69.63.189.16” 
1 
M.Length 
P_Aux	
  
Key	
  
Value 
Next	
  
Cell	
  
procedure Get (M : in out Map; 
 Key : in ASU.Unbounded_String; 
 Value : out ASU.Unbounded_String; 
 Success: out Boolean) is 
 P_Aux : Cell_A; 
begin 
 Value := ASU.Null_Unbounded_String; 
 P_Aux := M.P_First; 
 Success := False; 
 while not Success and P_Aux /= null Loop 
 if P_Aux.Key = Key then 
 Value := P_Aux.Value; 
 Success := True; 
 end if; 
 P_Aux := P_Aux.Next; 
 end loop; 
end Get; 
? 
Success 
Null_Unbounded_String 
Value 
Maps.Get(A_Map, ASU.To_Unbounded_String(“www.urjc.es"), 
 Value, Success); 2 
GSyC - 2019 Tablas de Śımbolos 37
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
   “facebook.com"	
  
“69.63.189.16” 
1 
M.Length 
Key	
  
Value 
Next	
  
Cell	
  
procedure Get (M : in out Map; 
 Key : in ASU.Unbounded_String; 
 Value : out ASU.Unbounded_String; 
 Success: out Boolean) is 
 P_Aux : Cell_A; 
begin 
 Value := ASU.Null_Unbounded_String; 
 P_Aux := M.P_First; 
 Success := False; 
 while not Success and P_Aux /= null Loop 
 if P_Aux.Key = Key then 
 Value := P_Aux.Value; 
 Success := True; 
 end if; 
 P_Aux := P_Aux.Next; 
 end loop; 
end Get; 
False 
Success 
Null_Unbounded_String 
Value 
P_Aux	
  
Maps.Get(A_Map, ASU.To_Unbounded_String(“www.urjc.es"), 
 Value, Success); 2 
GSyC - 2019 Tablas de Śımbolos 38
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
   “facebook.com"	
  
“69.63.189.16” 
1 
M.Length 
Key	
  
Value 
Next	
  
Cell	
  
procedure Get (M : in out Map; 
 Key : in ASU.Unbounded_String; 
 Value : out ASU.Unbounded_String; 
 Success: out Boolean) is 
 P_Aux : Cell_A; 
begin 
 Value := ASU.Null_Unbounded_String; 
 P_Aux := M.P_First; 
 Success := False; 
 while not Success and P_Aux /= null Loop 
 if P_Aux.Key = Key then 
 Value := P_Aux.Value; 
 Success := True; 
 end if; 
 P_Aux := P_Aux.Next; 
 end loop; 
end Get; 
False 
Success 
Null_Unbounded_String 
Value 
P_Aux	
  
Maps.Get(A_Map, ASU.To_Unbounded_String(“www.urjc.es"), 
 Value, Success); 2 
GSyC - 2019 Tablas de Śımbolos 39
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
   “facebook.com"	
  
“69.63.189.16” 
1 
M.Length 
Key	
  
Value 
Next	
  
Cell	
  
procedure Get (M : in out Map; 
 Key : in ASU.Unbounded_String; 
 Value : out ASU.Unbounded_String; 
 Success: out Boolean) is 
 P_Aux : Cell_A; 
begin 
 Value := ASU.Null_Unbounded_String; 
 P_Aux := M.P_First; 
 Success := False; 
 while not Success and P_Aux /= null Loop 
 if P_Aux.Key = Key then 
 Value := P_Aux.Value; 
 Success := True; 
 end if; 
 P_Aux := P_Aux.Next; 
 end loop; 
end Get; 
False 
Success 
Null_Unbounded_String 
Value 
P_Aux	
  
Maps.Get(A_Map, ASU.To_Unbounded_String(“www.urjc.es"), 
 Value, Success); 2 
GSyC - 2019 Tablas de Śımbolos 40
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First “facebook.com"	
  
“69.63.189.16” 
1 
M.Length 
Key	
  
Value 
Next	
  
Cell	
  
procedure Get (M : in out Map; 
 Key : in ASU.Unbounded_String; 
 Value : out ASU.Unbounded_String; 
 Success: out Boolean) is 
 P_Aux : Cell_A; 
begin 
 Value := ASU.Null_Unbounded_String; 
 P_Aux := M.P_First; 
 Success := False; 
 while not Success and P_Aux /= null Loop 
 if P_Aux.Key = Key then 
 Value := P_Aux.Value; 
 Success := True; 
 end if; 
 P_Aux := P_Aux.Next; 
 end loop; 
end Get; 
False 
Success 
Null_Unbounded_String 
Value 
P_Aux	
  
Maps.Get(A_Map, ASU.To_Unbounded_String(“www.urjc.es"), 
 Value, Success); 2 
GSyC - 2019 Tablas de Śımbolos 41
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
   “facebook.com"	
  
“69.63.189.16” 
1 
M.Length 
Key	
  
Value 
Next	
  
Cell	
  
procedure Get (M : in out Map; 
 Key : in ASU.Unbounded_String; 
 Value : out ASU.Unbounded_String; 
 Success: out Boolean) is 
 P_Aux : Cell_A; 
begin 
 Value := ASU.Null_Unbounded_String; 
 P_Aux := M.P_First; 
 Success := False; 
 while not Success and P_Aux /= null Loop 
 if P_Aux.Key = Key then 
 Value := P_Aux.Value; 
 Success := True; 
 end if; 
 P_Aux := P_Aux.Next; 
 end loop; 
end Get; 
False 
Success 
Null_Unbounded_String 
Value 
P_Aux	
  
Maps.Get(A_Map, ASU.To_Unbounded_String(“www.urjc.es"), 
 Value, Success); 2 
GSyC - 2019 Tablas de Śımbolos 42
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
   “facebook.com"	
  
“69.63.189.16” 
1 
M.Length 
Key	
  
Value 
Next	
  
Cell	
  
procedure Get (M : in out Map; 
 Key : in ASU.Unbounded_String; 
 Value : out ASU.Unbounded_String; 
 Success: out Boolean) is 
 P_Aux : Cell_A; 
begin 
 Value := ASU.Null_Unbounded_String; 
 P_Aux := M.P_First; 
 Success := False; 
 while not Success and P_Aux /= null Loop 
 if P_Aux.Key = Key then 
 Value := P_Aux.Value; 
 Success := True; 
 end if; 
 P_Aux := P_Aux.Next; 
 end loop; 
end Get; 
False 
Success 
Null_Unbounded_String 
Value 
P_Aux	
  
Maps.Get(A_Map, ASU.To_Unbounded_String(“www.urjc.es"), 
 Value, Success); 2 
GSyC - 2019 Tablas de Śımbolos 43
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
   “facebook.com"	
  
“69.63.189.16” 
1 
M.Length 
Key	
  
Value 
Next	
  
Cell	
  
procedure Get (M : in out Map; 
 Key : in ASU.Unbounded_String; 
 Value : out ASU.Unbounded_String; 
 Success: out Boolean) is 
 P_Aux : Cell_A; 
begin 
 Value := ASU.Null_Unbounded_String; 
 P_Aux := M.P_First; 
 Success := False; 
 while not Success and P_Aux /= null Loop 
 if P_Aux.Key = Key then 
 Value := P_Aux.Value; 
 Success := True; 
 end if; 
 P_Aux := P_Aux.Next; 
 end loop; 
end Get; 
False 
Success 
Null_Unbounded_String 
Value 
P_Aux	
  
Maps.Get(A_Map, ASU.To_Unbounded_String(“www.urjc.es"), 
 Value, Success); 2 
GSyC - 2019 Tablas de Śımbolos 44
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
   “facebook.com"	
  
“69.63.189.16” 
1 
M.Length 
Key	
  
Value 
Next	
  
Cell	
  
procedure Get (M : in out Map; 
 Key : in ASU.Unbounded_String; 
 Value : out ASU.Unbounded_String; 
 Success: out Boolean) is 
 P_Aux : Cell_A; 
begin 
 Value := ASU.Null_Unbounded_String; 
 P_Aux := M.P_First; 
 Success := False; 
 while not Success and P_Aux /= null Loop 
 if P_Aux.Key = Key then 
 Value := P_Aux.Value; 
 Success := True; 
 end if; 
 P_Aux := P_Aux.Next; 
 end loop; 
end Get; 
False 
Success 
Null_Unbounded_String 
Value 
P_Aux	
  
Maps.Get(A_Map, ASU.To_Unbounded_String(“www.urjc.es"), 
 Value, Success); 2 
GSyC - 2019 Tablas de Śımbolos 45
Ejemplo de ejecución(TS mediante lista enlazada no ordenada)
M.P_First	
   “facebook.com"	
  
“69.63.189.16” 
1 
M.Length 
Key	
  
Value 
Next	
  
Cell	
  
procedure Get (M : in out Map; 
 Key : in ASU.Unbounded_String; 
 Value : out ASU.Unbounded_String; 
 Success: out Boolean) is 
 P_Aux : Cell_A; 
begin 
 Value := ASU.Null_Unbounded_String; 
 P_Aux := M.P_First; 
 Success := False; 
 while not Success and P_Aux /= null Loop 
 if P_Aux.Key = Key then 
 Value := P_Aux.Value; 
 Success := True; 
 end if; 
 P_Aux := P_Aux.Next; 
 end loop; 
end Get; 
False 
Success 
Null_Unbounded_String 
Value 
P_Aux	
  
Maps.Get(A_Map, ASU.To_Unbounded_String(“www.urjc.es"), 
 Value, Success); 2 
GSyC - 2019 Tablas de Śımbolos 46
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
A_Map.P_First	
  
“facebook.com"	
  
“69.63.189.16” 
1 
A_Map.Length 
Key	
  
Value 
Next	
  
Cell	
   Maps.Put (A_Map, ASU.To_Unbounded_String(“google.com"), 
 ASU.To_Unbounded_String(“66.249.92.104")); 3 
GSyC - 2019 Tablas de Śımbolos 47
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
   “facebook.com"	
  
“69.63.189.16” 
1 
M.Length 
P_Aux	
  
Key	
  
Value 
Next	
  
Cell	
   Maps.Put (A_Map, ASU.To_Unbounded_String(“google.com"), 
 ASU.To_Unbounded_String(“66.249.92.104")); 3 
? 
Success 
procedure Put (M : in out Map; 
 Key : ASU.Unbounded_String; 
 Value : ASU.Unbounded_String) is 
 P_Aux : Cell_A; 
 Success : Boolean; 
begin 
 P_Aux := M.P_First; 
 Success := False; 
 while not Success and P_Aux /= null loop 
 if P_Aux.Key = Key then 
 P_Aux.Value := Value; 
 Success := True; 
 end if; 
 P_Aux := P_Aux.Next; 
 end loop; 
 if not Success then 
 M.P_First:=new Cell'(Key, Value, M.P_First); 
 M.Length := M.Length + 1; 
 end if; 
end Put; 
GSyC - 2019 Tablas de Śımbolos 48
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
   “facebook.com"	
  
“69.63.189.16” 
1 
M.Length 
P_Aux	
  
Key	
  
Value 
Next	
  
Cell	
   Maps.Put (A_Map, ASU.To_Unbounded_String(“google.com"), 
 ASU.To_Unbounded_String(“66.249.92.104")); 3 
? 
Success 
procedure Put (M : in out Map; 
 Key : ASU.Unbounded_String; 
 Value : ASU.Unbounded_String) is 
 P_Aux : Cell_A; 
 Success : Boolean; 
begin 
 P_Aux := M.P_First; 
 Success := False; 
 while not Success and P_Aux /= null loop 
 if P_Aux.Key = Key then 
 P_Aux.Value := Value; 
 Success := True; 
 end if; 
 P_Aux := P_Aux.Next; 
 end loop; 
 if not Success then 
 M.P_First:=new Cell'(Key, Value, M.P_First); 
 M.Length := M.Length + 1; 
 end if; 
end Put; 
GSyC - 2019 Tablas de Śımbolos 49
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
   “facebook.com"	
  
“69.63.189.16” 
1 
M.Length 
Key	
  
Value 
Next	
  
Cell	
   Maps.Put (A_Map, ASU.To_Unbounded_String(“google.com"), 
 ASU.To_Unbounded_String(“66.249.92.104")); 3 
False 
Success 
procedure Put (M : in out Map; 
 Key : ASU.Unbounded_String; 
 Value : ASU.Unbounded_String) is 
 P_Aux : Cell_A; 
 Success : Boolean; 
begin 
 P_Aux := M.P_First; 
 Success := False; 
 while not Success and P_Aux /= null loop 
 if P_Aux.Key = Key then 
 P_Aux.Value := Value; 
 Success := True; 
 end if; 
 P_Aux := P_Aux.Next; 
 end loop; 
 if not Success then 
 M.P_First:=new Cell'(Key, Value, M.P_First); 
 M.Length := M.Length + 1; 
 end if; 
end Put; 
P_Aux	
  
GSyC - 2019 Tablas de Śımbolos 50
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
   “facebook.com"	
  
“69.63.189.16” 
1 
M.Length 
Key	
  
Value 
Next	
  
Cell	
   Maps.Put (A_Map, ASU.To_Unbounded_String(“google.com"), 
 ASU.To_Unbounded_String(“66.249.92.104")); 3 
False 
Success 
procedure Put (M : in out Map; 
 Key : ASU.Unbounded_String; 
 Value : ASU.Unbounded_String) is 
 P_Aux : Cell_A; 
 Success : Boolean; 
begin 
 P_Aux := M.P_First; 
 Success := False; 
 while not Success and P_Aux /= null loop 
 if P_Aux.Key = Key then 
 P_Aux.Value := Value; 
 Success := True; 
 end if; 
 P_Aux := P_Aux.Next; 
 end loop; 
 if not Success then 
 M.P_First:=new Cell'(Key, Value, M.P_First); 
 M.Length := M.Length + 1; 
 end if; 
end Put; 
P_Aux	
  
GSyC - 2019 Tablas de Śımbolos 51
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
   “facebook.com"	
  
“69.63.189.16” 
1 
M.Length 
Key	
  
Value 
Next	
  
Cell	
   Maps.Put (A_Map, ASU.To_Unbounded_String(“google.com"), 
 ASU.To_Unbounded_String(“66.249.92.104")); 3 
False 
Success 
procedure Put (M : in out Map; 
 Key : ASU.Unbounded_String; 
 Value : ASU.Unbounded_String) is 
 P_Aux : Cell_A; 
 Success : Boolean; 
begin 
 P_Aux := M.P_First; 
 Success := False; 
 while not Success and P_Aux /= null loop 
 if P_Aux.Key = Key then 
 P_Aux.Value := Value; 
 Success := True; 
 end if; 
 P_Aux := P_Aux.Next; 
 end loop; 
 if not Success then 
 M.P_First:=new Cell'(Key, Value, M.P_First); 
 M.Length := M.Length + 1; 
 end if; 
end Put; 
P_Aux	
  
GSyC - 2019 Tablas de Śımbolos 52
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
   “facebook.com"	
  
“69.63.189.16” 
1 
M.Length 
Key	
  
Value 
Next	
  
Cell	
   Maps.Put (A_Map, ASU.To_Unbounded_String(“google.com"), 
 ASU.To_Unbounded_String(“66.249.92.104")); 3 
False 
Success 
procedure Put (M : in out Map; 
 Key : ASU.Unbounded_String; 
 Value : ASU.Unbounded_String) is 
 P_Aux : Cell_A; 
 Success : Boolean; 
begin 
 P_Aux := M.P_First; 
 Success := False; 
 while not Success and P_Aux /= null loop 
 if P_Aux.Key = Key then 
 P_Aux.Value := Value; 
 Success := True; 
 end if; 
 P_Aux := P_Aux.Next; 
 end loop; 
 if not Success then 
 M.P_First:=new Cell'(Key, Value, M.P_First); 
 M.Length := M.Length + 1; 
 end if; 
end Put; 
P_Aux	
  
GSyC - 2019 Tablas de Śımbolos 53
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
   “facebook.com"	
  
“69.63.189.16” 
1 
M.Length 
Key	
  
Value 
Next	
  
Cell	
   Maps.Put (A_Map, ASU.To_Unbounded_String(“google.com"), 
 ASU.To_Unbounded_String(“66.249.92.104")); 3 
False 
Success 
procedure Put (M : in out Map; 
 Key : ASU.Unbounded_String; 
 Value : ASU.Unbounded_String) is 
 P_Aux : Cell_A; 
 Success : Boolean; 
begin 
 P_Aux := M.P_First; 
 Success := False; 
 while not Success and P_Aux /= null loop 
 if P_Aux.Key = Key then 
 P_Aux.Value := Value; 
 Success := True; 
 end if; 
 P_Aux := P_Aux.Next; 
 end loop; 
 if not Success then 
 M.P_First:=new Cell'(Key, Value, M.P_First); 
 M.Length := M.Length + 1; 
 end if; 
end Put; 
P_Aux	
  
GSyC - 2019 Tablas de Śımbolos 54
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
   “facebook.com"	
  
“69.63.189.16” 
1 
M.Length 
Key	
  
Value 
Next	
  
Cell	
   Maps.Put (A_Map, ASU.To_Unbounded_String(“google.com"), 
 ASU.To_Unbounded_String(“66.249.92.104")); 3 
False 
Success 
procedure Put (M : in out Map; 
 Key : ASU.Unbounded_String; 
 Value : ASU.Unbounded_String) is 
 P_Aux : Cell_A; 
 Success : Boolean; 
begin 
 P_Aux := M.P_First; 
 Success := False; 
 while not Success and P_Aux /= null loop 
 if P_Aux.Key = Key then 
 P_Aux.Value := Value; 
 Success := True;end if; 
 P_Aux := P_Aux.Next; 
 end loop; 
 if not Success then 
 M.P_First:=new Cell'(Key, Value, M.P_First); 
 M.Length := M.Length + 1; 
 end if; 
end Put; 
P_Aux	
  
GSyC - 2019 Tablas de Śımbolos 55
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
   “facebook.com"	
  
“69.63.189.16” 
1 
M.Length 
Key	
  
Value 
Next	
  
Cell	
   Maps.Put (A_Map, ASU.To_Unbounded_String(“google.com"), 
 ASU.To_Unbounded_String(“66.249.92.104")); 3 
False 
Success 
procedure Put (M : in out Map; 
 Key : ASU.Unbounded_String; 
 Value : ASU.Unbounded_String) is 
 P_Aux : Cell_A; 
 Success : Boolean; 
begin 
 P_Aux := M.P_First; 
 Success := False; 
 while not Success and P_Aux /= null loop 
 if P_Aux.Key = Key then 
 P_Aux.Value := Value; 
 Success := True; 
 end if; 
 P_Aux := P_Aux.Next; 
 end loop; 
 if not Success then 
 M.P_First:=new Cell'(Key, Value, M.P_First); 
 M.Length := M.Length + 1; 
 end if; 
end Put; 
P_Aux	
  
GSyC - 2019 Tablas de Śımbolos 56
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
   “facebook.com"	
  
“69.63.189.16” 
1 
M.Length 
Key	
  
Value 
Next	
  
Cell	
   Maps.Put (A_Map, ASU.To_Unbounded_String(“google.com"), 
 ASU.To_Unbounded_String(“66.249.92.104")); 3 
False 
Success 
procedure Put (M : in out Map; 
 Key : ASU.Unbounded_String; 
 Value : ASU.Unbounded_String) is 
 P_Aux : Cell_A; 
 Success : Boolean; 
begin 
 P_Aux := M.P_First; 
 Success := False; 
 while not Success and P_Aux /= null loop 
 if P_Aux.Key = Key then 
 P_Aux.Value := Value; 
 Success := True; 
 end if; 
 P_Aux := P_Aux.Next; 
 end loop; 
 if not Success then 
 M.P_First:=new Cell'(Key, Value, M.P_First); 
 M.Length := M.Length + 1; 
 end if; 
end Put; 
P_Aux	
  
GSyC - 2019 Tablas de Śımbolos 57
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
   “facebook.com"	
  
“69.63.189.16” 
1 
M.Length 
Key	
  
Value 
Next	
  
Cell	
   Maps.Put (A_Map, ASU.To_Unbounded_String(“google.com"), 
 ASU.To_Unbounded_String(“66.249.92.104")); 3 
False 
Success 
procedure Put (M : in out Map; 
 Key : ASU.Unbounded_String; 
 Value : ASU.Unbounded_String) is 
 P_Aux : Cell_A; 
 Success : Boolean; 
begin 
 P_Aux := M.P_First; 
 Success := False; 
 while not Success and P_Aux /= null loop 
 if P_Aux.Key = Key then 
 P_Aux.Value := Value; 
 Success := True; 
 end if; 
 P_Aux := P_Aux.Next; 
 end loop; 
 if not Success then 
 M.P_First:=new Cell'(Key, Value, M.P_First); 
 M.Length := M.Length + 1; 
 end if; 
end Put; 
P_Aux	
  
GSyC - 2019 Tablas de Śımbolos 58
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
  
1 
M.Length 
Key	
  
Value 
Next	
  
Cell	
   Maps.Put (A_Map, ASU.To_Unbounded_String(“google.com"), 
 ASU.To_Unbounded_String(“66.249.92.104")); 3 
False 
Success 
procedure Put (M : in out Map; 
 Key : ASU.Unbounded_String; 
 Value : ASU.Unbounded_String) is 
 P_Aux : Cell_A; 
 Success : Boolean; 
begin 
 P_Aux := M.P_First; 
 Success := False; 
 while not Success and P_Aux /= null loop 
 if P_Aux.Key = Key then 
 P_Aux.Value := Value; 
 Success := True; 
 end if; 
 P_Aux := P_Aux.Next; 
 end loop; 
 if not Success then 
 M.P_First:=new Cell'(Key, Value, M.P_First); 
 M.Length := M.Length + 1; 
 end if; 
end Put; 
P_Aux	
  
“google.com"	
  
“66.249.92.104” 
“facebook.com"	
  
“69.63.189.16”	
  
GSyC - 2019 Tablas de Śımbolos 59
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
  
1 
M.Length 
Key	
  
Value 
Next	
  
Cell	
   Maps.Put (A_Map, ASU.To_Unbounded_String(“google.com"), 
 ASU.To_Unbounded_String(“66.249.92.104")); 3 
False 
Success 
procedure Put (M : in out Map; 
 Key : ASU.Unbounded_String; 
 Value : ASU.Unbounded_String) is 
 P_Aux : Cell_A; 
 Success : Boolean; 
begin 
 P_Aux := M.P_First; 
 Success := False; 
 while not Success and P_Aux /= null loop 
 if P_Aux.Key = Key then 
 P_Aux.Value := Value; 
 Success := True; 
 end if; 
 P_Aux := P_Aux.Next; 
 end loop; 
 if not Success then 
 M.P_First:=new Cell'(Key, Value, M.P_First); 
 M.Length := M.Length + 1; 
 end if; 
end Put; 
P_Aux	
  
“google.com"	
  
“66.249.92.104” 
“facebook.com"	
  
“69.63.189.16”	
  
GSyC - 2019 Tablas de Śımbolos 60
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
  
1 
M.Length 
Key	
  
Value 
Next	
  
Cell	
   Maps.Put (A_Map, ASU.To_Unbounded_String(“google.com"), 
 ASU.To_Unbounded_String(“66.249.92.104")); 3 
False 
Success 
procedure Put (M : in out Map; 
 Key : ASU.Unbounded_String; 
 Value : ASU.Unbounded_String) is 
 P_Aux : Cell_A; 
 Success : Boolean; 
begin 
 P_Aux := M.P_First; 
 Success := False; 
 while not Success and P_Aux /= null loop 
 if P_Aux.Key = Key then 
 P_Aux.Value := Value; 
 Success := True; 
 end if; 
 P_Aux := P_Aux.Next; 
 end loop; 
 if not Success then 
 M.P_First:=new Cell'(Key, Value, M.P_First); 
 M.Length := M.Length + 1; 
 end if; 
end Put; 
P_Aux	
  
“google.com"	
  
“66.249.92.104” 
“facebook.com"	
  
“69.63.189.16”	
  
GSyC - 2019 Tablas de Śımbolos 61
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
  
1 
M.Length 
Key	
  
Value 
Next	
  
Cell	
   Maps.Put (A_Map, ASU.To_Unbounded_String(“google.com"), 
 ASU.To_Unbounded_String(“66.249.92.104")); 3 
False 
Success 
procedure Put (M : in out Map; 
 Key : ASU.Unbounded_String; 
 Value : ASU.Unbounded_String) is 
 P_Aux : Cell_A; 
 Success : Boolean; 
begin 
 P_Aux := M.P_First; 
 Success := False; 
 while not Success and P_Aux /= null loop 
 if P_Aux.Key = Key then 
 P_Aux.Value := Value; 
 Success := True; 
 end if; 
 P_Aux := P_Aux.Next; 
 end loop; 
 if not Success then 
 M.P_First:=new Cell'(Key, Value, M.P_First); 
 M.Length := M.Length + 1; 
 end if; 
end Put; 
P_Aux	
  
“google.com"	
  
“66.249.92.104” 
“facebook.com"	
  
“69.63.189.16”	
  
GSyC - 2019 Tablas de Śımbolos 62
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
  
2 
M.Length 
Key	
  
Value 
Next	
  
Cell	
   Maps.Put (A_Map, ASU.To_Unbounded_String(“google.com"), 
 ASU.To_Unbounded_String(“66.249.92.104")); 3 
False 
Success 
procedure Put (M : in out Map; 
 Key : ASU.Unbounded_String; 
 Value : ASU.Unbounded_String) is 
 P_Aux : Cell_A; 
 Success : Boolean; 
begin 
 P_Aux := M.P_First; 
 Success := False; 
 while not Success and P_Aux /= null loop 
 if P_Aux.Key = Key then 
 P_Aux.Value := Value; 
 Success := True; 
 end if; 
 P_Aux := P_Aux.Next; 
 end loop; 
 if not Success then 
 M.P_First:=new Cell'(Key, Value, M.P_First); 
 M.Length := M.Length + 1; 
 end if; 
end Put; 
P_Aux	
  
“google.com"	
  
“66.249.92.104” 
“facebook.com"	
  
“69.63.189.16”	
  
GSyC - 2019 Tablas de Śımbolos 63
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
  
2 
M.Length 
Key	
  
Value 
Next	
  
Cell	
   Maps.Put (A_Map, ASU.To_Unbounded_String(“google.com"), 
 ASU.To_Unbounded_String(“66.249.92.104")); 3 
False 
Success 
procedure Put (M : in out Map; 
 Key : ASU.Unbounded_String; 
 Value : ASU.Unbounded_String) is 
 P_Aux : Cell_A; 
 Success : Boolean; 
begin 
 P_Aux := M.P_First; 
 Success := False;while not Success and P_Aux /= null loop 
 if P_Aux.Key = Key then 
 P_Aux.Value := Value; 
 Success := True; 
 end if; 
 P_Aux := P_Aux.Next; 
 end loop; 
 if not Success then 
 M.P_First:=new Cell'(Key, Value, M.P_First); 
 M.Length := M.Length + 1; 
 end if; 
end Put; 
P_Aux	
  
“google.com"	
  
“66.249.92.104” 
“facebook.com"	
  
“69.63.189.16”	
  
GSyC - 2019 Tablas de Śımbolos 64
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
2 
M.Length 
Key	
  
Value 
Next	
  
Cell	
   Maps.Put (A_Map, ASU.To_Unbounded_String(“google.com"), 
 ASU.To_Unbounded_String(“66.249.92.104")); 3 
False 
Success 
procedure Put (M : in out Map; 
 Key : ASU.Unbounded_String; 
 Value : ASU.Unbounded_String) is 
 P_Aux : Cell_A; 
 Success : Boolean; 
begin 
 P_Aux := M.P_First; 
 Success := False; 
 while not Success and P_Aux /= null loop 
 if P_Aux.Key = Key then 
 P_Aux.Value := Value; 
 Success := True; 
 end if; 
 P_Aux := P_Aux.Next; 
 end loop; 
 if not Success then 
 M.P_First:=new Cell'(Key, Value, M.P_First); 
 M.Length := M.Length + 1; 
 end if; 
end Put; 
P_Aux	
  
“google.com"	
  
“66.249.92.104” 
“facebook.com"	
  
“69.63.189.16”	
  
M.P_First	
  
GSyC - 2019 Tablas de Śımbolos 65
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
“google.com"	
  
“66.249.92.104” 
2 
A_Map.Length 
“facebook.com"	
  
“69.63.189.16”	
  
Key	
  
Value 
Next	
  
Cell	
   Maps.Put (A_Map, ASU.To_Unbounded_String(“www.urjc.es"), 
 ASU.To_Unbounded_String(“212.128.240.25")); 4 
A_M.P_First	
  
GSyC - 2019 Tablas de Śımbolos 66
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
   “google.com"	
  
“66.249.92.104” 
2 
M.Length 
P_Aux	
  
“facebook.com"	
  
“69.63.189.16”	
  
Key	
  
Value 
Next	
  
Cell	
   Maps.Put (A_Map, ASU.To_Unbounded_String(“www.urjc.es"), 
 ASU.To_Unbounded_String(“212.128.240.25")); 4 
? 
Success 
procedure Put (M : in out Map; 
 Key : ASU.Unbounded_String; 
 Value : ASU.Unbounded_String) is 
 P_Aux : Cell_A; 
 Success : Boolean; 
begin 
 P_Aux := M.P_First; 
 Success := False; 
 while not Success and P_Aux /= null loop 
 if P_Aux.Key = Key then 
 P_Aux.Value := Value; 
 Success := True; 
 end if; 
 P_Aux := P_Aux.Next; 
 end loop; 
 if not Success then 
 M.P_First:=new Cell'(Key, Value, M.P_First); 
 M.Length := M.Length + 1; 
 end if; 
end Put; 
GSyC - 2019 Tablas de Śımbolos 67
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
“google.com"	
  
“66.249.92.104” 
2 
M.Length 
P_Aux	
  
“facebook.com"	
  
“69.63.189.16”	
  
Key	
  
Value 
Next	
  
Cell	
   Maps.Put (A_Map, ASU.To_Unbounded_String(“www.urjc.es"), 
 ASU.To_Unbounded_String(“212.128.240.25")); 4 
? 
Success 
procedure Put (M : in out Map; 
 Key : ASU.Unbounded_String; 
 Value : ASU.Unbounded_String) is 
 P_Aux : Cell_A; 
 Success : Boolean; 
begin 
 P_Aux := M.P_First; 
 Success := False; 
 while not Success and P_Aux /= null loop 
 if P_Aux.Key = Key then 
 P_Aux.Value := Value; 
 Success := True; 
 end if; 
 P_Aux := P_Aux.Next; 
 end loop; 
 if not Success then 
 M.P_First:=new Cell'(Key, Value, M.P_First); 
 M.Length := M.Length + 1; 
 end if; 
end Put; 
M.P_First	
  
GSyC - 2019 Tablas de Śımbolos 68
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
“google.com"	
  
“66.249.92.104” 
2 
M.Length 
“facebook.com"	
  
“69.63.189.16”	
  
Key	
  
Value 
Next	
  
Cell	
   Maps.Put (A_Map, ASU.To_Unbounded_String(“www.urjc.es"), 
 ASU.To_Unbounded_String(“212.128.240.25")); 4 
False 
Success 
procedure Put (M : in out Map; 
 Key : ASU.Unbounded_String; 
 Value : ASU.Unbounded_String) is 
 P_Aux : Cell_A; 
 Success : Boolean; 
begin 
 P_Aux := M.P_First; 
 Success := False; 
 while not Success and P_Aux /= null loop 
 if P_Aux.Key = Key then 
 P_Aux.Value := Value; 
 Success := True; 
 end if; 
 P_Aux := P_Aux.Next; 
 end loop; 
 if not Success then 
 M.P_First:=new Cell'(Key, Value, M.P_First); 
 M.Length := M.Length + 1; 
 end if; 
end Put; 
P_Aux	
  
M.P_First	
  
GSyC - 2019 Tablas de Śımbolos 69
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
   “google.com"	
  
“66.249.92.104” 
2 
M.Length 
“facebook.com"	
  
“69.63.189.16”	
  
Key	
  
Value 
Next	
  
Cell	
   Maps.Put (A_Map, ASU.To_Unbounded_String(“www.urjc.es"), 
 ASU.To_Unbounded_String(“212.128.240.25")); 4 
False 
Success 
procedure Put (M : in out Map; 
 Key : ASU.Unbounded_String; 
 Value : ASU.Unbounded_String) is 
 P_Aux : Cell_A; 
 Success : Boolean; 
begin 
 P_Aux := M.P_First; 
 Success := False; 
 while not Success and P_Aux /= null loop 
 if P_Aux.Key = Key then 
 P_Aux.Value := Value; 
 Success := True; 
 end if; 
 P_Aux := P_Aux.Next; 
 end loop; 
 if not Success then 
 M.P_First:=new Cell'(Key, Value, M.P_First); 
 M.Length := M.Length + 1; 
 end if; 
end Put; 
P_Aux	
  
GSyC - 2019 Tablas de Śımbolos 70
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
“google.com"	
  
“66.249.92.104” 
2 
M.Length 
“facebook.com"	
  
“69.63.189.16”	
  
Key	
  
Value 
Next	
  
Cell	
   Maps.Put (A_Map, ASU.To_Unbounded_String(“www.urjc.es"), 
 ASU.To_Unbounded_String(“212.128.240.25")); 4 
False 
Success 
procedure Put (M : in out Map; 
 Key : ASU.Unbounded_String; 
 Value : ASU.Unbounded_String) is 
 P_Aux : Cell_A; 
 Success : Boolean; 
begin 
 P_Aux := M.P_First; 
 Success := False; 
 while not Success and P_Aux /= null loop 
 if P_Aux.Key = Key then 
 P_Aux.Value := Value; 
 Success := True; 
 end if; 
 P_Aux := P_Aux.Next; 
 end loop; 
 if not Success then 
 M.P_First:=new Cell'(Key, Value, M.P_First); 
 M.Length := M.Length + 1; 
 end if; 
end Put; 
P_Aux	
  
M.P_First	
  
GSyC - 2019 Tablas de Śımbolos 71
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
“google.com"	
  
“66.249.92.104” 
2 
M.Length 
“facebook.com"	
  
“69.63.189.16”	
  
Key	
  
Value 
Next	
  
Cell	
   Maps.Put (A_Map, ASU.To_Unbounded_String(“www.urjc.es"), 
 ASU.To_Unbounded_String(“212.128.240.25")); 4 
False 
Success 
procedure Put (M : in out Map; 
 Key : ASU.Unbounded_String; 
 Value : ASU.Unbounded_String) is 
 P_Aux : Cell_A; 
 Success : Boolean; 
begin 
 P_Aux := M.P_First; 
 Success := False; 
 while not Success and P_Aux /= null loop 
 if P_Aux.Key = Key then 
 P_Aux.Value := Value; 
 Success := True; 
 end if; 
 P_Aux := P_Aux.Next; 
 end loop; 
 if not Success then 
 M.P_First:=new Cell'(Key, Value, M.P_First); 
 M.Length := M.Length + 1; 
 end if; 
end Put; 
P_Aux	
  
M.P_First	
  
GSyC - 2019 Tablas de Śımbolos 72
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
“google.com"	
  
“66.249.92.104” 
2 
M.Length 
“facebook.com"	
  
“69.63.189.16”	
  
Key	
  
Value 
Next	
  
Cell	
   Maps.Put (A_Map, ASU.To_Unbounded_String(“www.urjc.es"), 
 ASU.To_Unbounded_String(“212.128.240.25")); 4 
False 
Success 
procedure Put (M : in out Map; 
 Key : ASU.Unbounded_String; 
 Value : ASU.Unbounded_String) is 
 P_Aux : Cell_A; 
 Success : Boolean; 
begin 
 P_Aux := M.P_First; 
 Success := False; 
 while not Success and P_Aux /= null loop 
 if P_Aux.Key = Key then 
 P_Aux.Value := Value; 
 Success := True; 
 end if; 
 P_Aux := P_Aux.Next;end loop; 
 if not Success then 
 M.P_First:=new Cell'(Key, Value, M.P_First); 
 M.Length := M.Length + 1; 
 end if; 
end Put; 
P_Aux	
  
M.P_First	
  
GSyC - 2019 Tablas de Śımbolos 73
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
“google.com"	
  
“66.249.92.104” 
2 
M.Length 
“facebook.com"	
  
“69.63.189.16”	
  
Key	
  
Value 
Next	
  
Cell	
   Maps.Put (A_Map, ASU.To_Unbounded_String(“www.urjc.es"), 
 ASU.To_Unbounded_String(“212.128.240.25")); 4 
False 
Success 
procedure Put (M : in out Map; 
 Key : ASU.Unbounded_String; 
 Value : ASU.Unbounded_String) is 
 P_Aux : Cell_A; 
 Success : Boolean; 
begin 
 P_Aux := M.P_First; 
 Success := False; 
 while not Success and P_Aux /= null loop 
 if P_Aux.Key = Key then 
 P_Aux.Value := Value; 
 Success := True; 
 end if; 
 P_Aux := P_Aux.Next; 
 end loop; 
 if not Success then 
 M.P_First:=new Cell'(Key, Value, M.P_First); 
 M.Length := M.Length + 1; 
 end if; 
end Put; 
P_Aux	
  
M.P_First	
  
GSyC - 2019 Tablas de Śımbolos 74
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
“google.com"	
  
“66.249.92.104” 
2 
M.Length 
“facebook.com"	
  
“69.63.189.16”	
  
Key	
  
Value 
Next	
  
Cell	
   Maps.Put (A_Map, ASU.To_Unbounded_String(“www.urjc.es"), 
 ASU.To_Unbounded_String(“212.128.240.25")); 4 
False 
Success 
procedure Put (M : in out Map; 
 Key : ASU.Unbounded_String; 
 Value : ASU.Unbounded_String) is 
 P_Aux : Cell_A; 
 Success : Boolean; 
begin 
 P_Aux := M.P_First; 
 Success := False; 
 while not Success and P_Aux /= null loop 
 if P_Aux.Key = Key then 
 P_Aux.Value := Value; 
 Success := True; 
 end if; 
 P_Aux := P_Aux.Next; 
 end loop; 
 if not Success then 
 M.P_First:=new Cell'(Key, Value, M.P_First); 
 M.Length := M.Length + 1; 
 end if; 
end Put; 
P_Aux	
  
M.P_First	
  
GSyC - 2019 Tablas de Śımbolos 75
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
“google.com"	
  
“66.249.92.104” 
2 
M.Length 
“facebook.com"	
  
“69.63.189.16”	
  
Key	
  
Value 
Next	
  
Cell	
   Maps.Put (A_Map, ASU.To_Unbounded_String(“www.urjc.es"), 
 ASU.To_Unbounded_String(“212.128.240.25")); 4 
False 
Success 
procedure Put (M : in out Map; 
 Key : ASU.Unbounded_String; 
 Value : ASU.Unbounded_String) is 
 P_Aux : Cell_A; 
 Success : Boolean; 
begin 
 P_Aux := M.P_First; 
 Success := False; 
 while not Success and P_Aux /= null loop 
 if P_Aux.Key = Key then 
 P_Aux.Value := Value; 
 Success := True; 
 end if; 
 P_Aux := P_Aux.Next; 
 end loop; 
 if not Success then 
 M.P_First:=new Cell'(Key, Value, M.P_First); 
 M.Length := M.Length + 1; 
 end if; 
end Put; 
P_Aux	
  
M.P_First	
  
GSyC - 2019 Tablas de Śımbolos 76
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
“google.com"	
  
“66.249.92.104” 
2 
M.Length 
“facebook.com"	
  
“69.63.189.16”	
  
Key	
  
Value 
Next	
  
Cell	
   Maps.Put (A_Map, ASU.To_Unbounded_String(“www.urjc.es"), 
 ASU.To_Unbounded_String(“212.128.240.25")); 4 
False 
Success 
procedure Put (M : in out Map; 
 Key : ASU.Unbounded_String; 
 Value : ASU.Unbounded_String) is 
 P_Aux : Cell_A; 
 Success : Boolean; 
begin 
 P_Aux := M.P_First; 
 Success := False; 
 while not Success and P_Aux /= null loop 
 if P_Aux.Key = Key then 
 P_Aux.Value := Value; 
 Success := True; 
 end if; 
 P_Aux := P_Aux.Next; 
 end loop; 
 if not Success then 
 M.P_First:=new Cell'(Key, Value, M.P_First); 
 M.Length := M.Length + 1; 
 end if; 
end Put; 
P_Aux	
  
M.P_First	
  
GSyC - 2019 Tablas de Śımbolos 77
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
“google.com"	
  
“66.249.92.104” 
2 
M.Length 
“facebook.com"	
  
“69.63.189.16”	
  
Key	
  
Value 
Next	
  
Cell	
   Maps.Put (A_Map, ASU.To_Unbounded_String(“www.urjc.es"), 
 ASU.To_Unbounded_String(“212.128.240.25")); 4 
False 
Success 
procedure Put (M : in out Map; 
 Key : ASU.Unbounded_String; 
 Value : ASU.Unbounded_String) is 
 P_Aux : Cell_A; 
 Success : Boolean; 
begin 
 P_Aux := M.P_First; 
 Success := False; 
 while not Success and P_Aux /= null loop 
 if P_Aux.Key = Key then 
 P_Aux.Value := Value; 
 Success := True; 
 end if; 
 P_Aux := P_Aux.Next; 
 end loop; 
 if not Success then 
 M.P_First:=new Cell'(Key, Value, M.P_First); 
 M.Length := M.Length + 1; 
 end if; 
end Put; 
P_Aux	
  
M.P_First	
  
GSyC - 2019 Tablas de Śımbolos 78
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
“google.com"	
  
“66.249.92.104” 
2 
M.Length 
“facebook.com"	
  
“69.63.189.16”	
  
Key	
  
Value 
Next	
  
Cell	
   Maps.Put (A_Map, ASU.To_Unbounded_String(“www.urjc.es"), 
 ASU.To_Unbounded_String(“212.128.240.25")); 4 
False 
Success 
procedure Put (M : in out Map; 
 Key : ASU.Unbounded_String; 
 Value : ASU.Unbounded_String) is 
 P_Aux : Cell_A; 
 Success : Boolean; 
begin 
 P_Aux := M.P_First; 
 Success := False; 
 while not Success and P_Aux /= null loop 
 if P_Aux.Key = Key then 
 P_Aux.Value := Value; 
 Success := True; 
 end if; 
 P_Aux := P_Aux.Next; 
 end loop; 
 if not Success then 
 M.P_First:=new Cell'(Key, Value, M.P_First); 
 M.Length := M.Length + 1; 
 end if; 
end Put; 
P_Aux	
  
M.P_First	
  
GSyC - 2019 Tablas de Śımbolos 79
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
“google.com"	
  
“66.249.92.104” 
2 
M.Length 
“facebook.com"	
  
“69.63.189.16”	
  
Key	
  
Value 
Next	
  
Cell	
   Maps.Put (A_Map, ASU.To_Unbounded_String(“www.urjc.es"), 
 ASU.To_Unbounded_String(“212.128.240.25")); 4 
False 
Success 
procedure Put (M : in out Map; 
 Key : ASU.Unbounded_String; 
 Value : ASU.Unbounded_String) is 
 P_Aux : Cell_A; 
 Success : Boolean; 
begin 
 P_Aux := M.P_First; 
 Success := False; 
 while not Success and P_Aux /= null loop 
 if P_Aux.Key = Key then 
 P_Aux.Value := Value; 
 Success := True; 
 end if; 
 P_Aux := P_Aux.Next; 
 end loop; 
 if not Success then 
 M.P_First:=new Cell'(Key, Value, M.P_First); 
 M.Length := M.Length + 1; 
 end if; 
end Put; 
P_Aux	
  
M.P_First	
  
GSyC - 2019 Tablas de Śımbolos 80
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
“google.com"	
  
“66.249.92.104” 
2 
M.Length 
“facebook.com"	
  
“69.63.189.16”	
  
Key	
  
Value 
Next	
  
Cell	
   Maps.Put (A_Map, ASU.To_Unbounded_String(“www.urjc.es"), 
 ASU.To_Unbounded_String(“212.128.240.25")); 4 
False 
Success 
procedure Put (M : in out Map; 
 Key : ASU.Unbounded_String; 
 Value : ASU.Unbounded_String) is 
 P_Aux : Cell_A; 
 Success : Boolean; 
begin 
 P_Aux := M.P_First; 
 Success := False; 
 while not Success and P_Aux /= null loop 
 if P_Aux.Key = Key then 
 P_Aux.Value := Value; 
 Success := True; 
 end if; 
 P_Aux := P_Aux.Next; 
 end loop; 
 if not Success then 
 M.P_First:=new Cell'(Key, Value, M.P_First); 
 M.Length := M.Length + 1; 
 end if; 
end Put; 
P_Aux	
  
M.P_First	
  
GSyC - 2019 Tablas de Śımbolos 81
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
“google.com"	
  
“66.249.92.104” 
2 
M.Length 
“facebook.com"	
  
“69.63.189.16”	
  
Key	
  
Value 
Next	
  
Cell	
   Maps.Put (A_Map, ASU.To_Unbounded_String(“www.urjc.es"), 
 ASU.To_Unbounded_String(“212.128.240.25")); 4 
False 
Success 
procedure Put (M : in out Map;Key : ASU.Unbounded_String; 
 Value : ASU.Unbounded_String) is 
 P_Aux : Cell_A; 
 Success : Boolean; 
begin 
 P_Aux := M.P_First; 
 Success := False; 
 while not Success and P_Aux /= null loop 
 if P_Aux.Key = Key then 
 P_Aux.Value := Value; 
 Success := True; 
 end if; 
 P_Aux := P_Aux.Next; 
 end loop; 
 if not Success then 
 M.P_First:=new Cell'(Key, Value, M.P_First); 
 M.Length := M.Length + 1; 
 end if; 
end Put; 
P_Aux	
  
M.P_First	
  
GSyC - 2019 Tablas de Śımbolos 82
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
“google.com"	
  
“66.249.92.104” 
2 
M.Length 
“facebook.com"	
  
“69.63.189.16”	
  
Key	
  
Value 
Next	
  
Cell	
   Maps.Put (A_Map, ASU.To_Unbounded_String(“www.urjc.es"), 
 ASU.To_Unbounded_String(“212.128.240.25")); 4 
False 
Success 
procedure Put (M : in out Map; 
 Key : ASU.Unbounded_String; 
 Value : ASU.Unbounded_String) is 
 P_Aux : Cell_A; 
 Success : Boolean; 
begin 
 P_Aux := M.P_First; 
 Success := False; 
 while not Success and P_Aux /= null loop 
 if P_Aux.Key = Key then 
 P_Aux.Value := Value; 
 Success := True; 
 end if; 
 P_Aux := P_Aux.Next; 
 end loop; 
 if not Success then 
 M.P_First:=new Cell'(Key, Value, M.P_First); 
 M.Length := M.Length + 1; 
 end if; 
end Put; 
P_Aux	
  
M.P_First	
  
GSyC - 2019 Tablas de Śımbolos 83
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
2 
M.Length 
Key	
  
Value 
Next	
  
Cell	
   Maps.Put (A_Map, ASU.To_Unbounded_String(“www.urjc.es"), 
 ASU.To_Unbounded_String(“212.128.240.25")); 4 
False 
Success 
procedure Put (M : in out Map; 
 Key : ASU.Unbounded_String; 
 Value : ASU.Unbounded_String) is 
 P_Aux : Cell_A; 
 Success : Boolean; 
begin 
 P_Aux := M.P_First; 
 Success := False; 
 while not Success and P_Aux /= null loop 
 if P_Aux.Key = Key then 
 P_Aux.Value := Value; 
 Success := True; 
 end if; 
 P_Aux := P_Aux.Next; 
 end loop; 
 if not Success then 
 M.P_First:=new Cell'(Key, Value, M.P_First); 
 M.Length := M.Length + 1; 
 end if; 
end Put; 
P_Aux	
  
“www.urjc.es"	
  
“212.128.240.25” 
“google.com"	
  
“66.249.92.104”	
  
“facebook.com"	
  
“69.63.189.16”	
  
M.P_First	
  
GSyC - 2019 Tablas de Śımbolos 84
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
2 
M.Length 
Key	
  
Value 
Next	
  
Cell	
   Maps.Put (A_Map, ASU.To_Unbounded_String(“www.urjc.es"), 
 ASU.To_Unbounded_String(“212.128.240.25")); 4 
False 
Success 
procedure Put (M : in out Map; 
 Key : ASU.Unbounded_String; 
 Value : ASU.Unbounded_String) is 
 P_Aux : Cell_A; 
 Success : Boolean; 
begin 
 P_Aux := M.P_First; 
 Success := False; 
 while not Success and P_Aux /= null loop 
 if P_Aux.Key = Key then 
 P_Aux.Value := Value; 
 Success := True; 
 end if; 
 P_Aux := P_Aux.Next; 
 end loop; 
 if not Success then 
 M.P_First:=new Cell'(Key, Value, M.P_First); 
 M.Length := M.Length + 1; 
 end if; 
end Put; 
P_Aux	
  
“www.urjc.es"	
  
“212.128.240.25” 
“google.com"	
  
“66.249.92.104”	
  
“facebook.com"	
  
“69.63.189.16”	
  
M.P_First	
  
GSyC - 2019 Tablas de Śımbolos 85
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
2 
M.Length 
Key	
  
Value 
Next	
  
Cell	
   Maps.Put (A_Map, ASU.To_Unbounded_String(“www.urjc.es"), 
 ASU.To_Unbounded_String(“212.128.240.25")); 4 
False 
Success 
procedure Put (M : in out Map; 
 Key : ASU.Unbounded_String; 
 Value : ASU.Unbounded_String) is 
 P_Aux : Cell_A; 
 Success : Boolean; 
begin 
 P_Aux := M.P_First; 
 Success := False; 
 while not Success and P_Aux /= null loop 
 if P_Aux.Key = Key then 
 P_Aux.Value := Value; 
 Success := True; 
 end if; 
 P_Aux := P_Aux.Next; 
 end loop; 
 if not Success then 
 M.P_First:=new Cell'(Key, Value, M.P_First); 
 M.Length := M.Length + 1; 
 end if; 
end Put; 
P_Aux	
  
“www.urjc.es"	
  
“212.128.240.25” 
“google.com"	
  
“66.249.92.104”	
  
“facebook.com"	
  
“69.63.189.16”	
  
M.P_First	
  
GSyC - 2019 Tablas de Śımbolos 86
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
2 
M.Length 
Key	
  
Value 
Next	
  
Cell	
   Maps.Put (A_Map, ASU.To_Unbounded_String(“www.urjc.es"), 
 ASU.To_Unbounded_String(“212.128.240.25")); 4 
False 
Success 
procedure Put (M : in out Map; 
 Key : ASU.Unbounded_String; 
 Value : ASU.Unbounded_String) is 
 P_Aux : Cell_A; 
 Success : Boolean; 
begin 
 P_Aux := M.P_First; 
 Success := False; 
 while not Success and P_Aux /= null loop 
 if P_Aux.Key = Key then 
 P_Aux.Value := Value; 
 Success := True; 
 end if; 
 P_Aux := P_Aux.Next; 
 end loop; 
 if not Success then 
 M.P_First:=new Cell'(Key, Value, M.P_First); 
 M.Length := M.Length + 1; 
 end if; 
end Put; 
P_Aux	
  
“www.urjc.es"	
  
“212.128.240.25” 
“google.com"	
  
“66.249.92.104”	
  
“facebook.com"	
  
“69.63.189.16”	
  
M.P_First	
  
GSyC - 2019 Tablas de Śımbolos 87
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
3 
M.Length 
Key	
  
Value 
Next	
  
Cell	
   Maps.Put (A_Map, ASU.To_Unbounded_String(“www.urjc.es"), 
 ASU.To_Unbounded_String(“212.128.240.25")); 4 
False 
Success 
procedure Put (M : in out Map; 
 Key : ASU.Unbounded_String; 
 Value : ASU.Unbounded_String) is 
 P_Aux : Cell_A; 
 Success : Boolean; 
begin 
 P_Aux := M.P_First; 
 Success := False; 
 while not Success and P_Aux /= null loop 
 if P_Aux.Key = Key then 
 P_Aux.Value := Value; 
 Success := True; 
 end if; 
 P_Aux := P_Aux.Next; 
 end loop; 
 if not Success then 
 M.P_First:=new Cell'(Key, Value, M.P_First); 
 M.Length := M.Length + 1; 
 end if; 
end Put; 
P_Aux	
  
“www.urjc.es"	
  
“212.128.240.25” 
“google.com"	
  
“66.249.92.104”	
  
“facebook.com"	
  
“69.63.189.16”	
  
M.P_First	
  
GSyC - 2019 Tablas de Śımbolos 88
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
3 
M.Length 
Key	
  
Value 
Next	
  
Cell	
   Maps.Put (A_Map, ASU.To_Unbounded_String(“www.urjc.es"), 
 ASU.To_Unbounded_String(“212.128.240.25")); 4 
False 
Success 
procedure Put (M : in out Map; 
 Key : ASU.Unbounded_String; 
 Value : ASU.Unbounded_String) is 
 P_Aux : Cell_A; 
 Success : Boolean; 
begin 
 P_Aux := M.P_First; 
 Success := False; 
 while not Success and P_Aux /= null loop 
 if P_Aux.Key = Key then 
 P_Aux.Value := Value; 
 Success := True; 
 end if; 
 P_Aux := P_Aux.Next; 
 end loop; 
 if not Success then 
 M.P_First:=new Cell'(Key, Value, M.P_First); 
 M.Length := M.Length + 1; 
 end if; 
end Put; 
P_Aux	
  
“www.urjc.es"	
  
“212.128.240.25” 
“google.com"	
  
“66.249.92.104”	
  
“facebook.com"	
  
“69.63.189.16”	
  
M.P_First	
  
GSyC - 2019 Tablas de Śımbolos 89
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
3 
M.Length 
Key	
  
Value 
Next	
  
Cell	
   Maps.Put (A_Map, ASU.To_Unbounded_String(“www.urjc.es"), 
 ASU.To_Unbounded_String(“212.128.240.25")); 4 
False 
Success 
procedure Put (M : in out Map; 
 Key : ASU.Unbounded_String; 
 Value : ASU.Unbounded_String) is 
 P_Aux : Cell_A; 
 Success : Boolean; 
begin 
 P_Aux := M.P_First; 
 Success := False; 
 while not Success and P_Aux /= null loop 
 if P_Aux.Key = Key then 
 P_Aux.Value := Value; 
 Success := True; 
 end if; 
 P_Aux := P_Aux.Next; 
 end loop; 
 if not Success then 
 M.P_First:=new Cell'(Key,Value, M.P_First); 
 M.Length := M.Length + 1; 
 end if; 
end Put; 
P_Aux	
  
“www.urjc.es"	
  
“212.128.240.25” 
“google.com"	
  
“66.249.92.104”	
  
“facebook.com"	
  
“69.63.189.16”	
  
M.P_First	
  
GSyC - 2019 Tablas de Śımbolos 90
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
“www.urjc.es"	
  
“212.128.240.25” 
3 
A_Map.Length 
“google.com"	
  
“66.249.92.104”	
  
“facebook.com"	
  
“69.63.189.16”	
  
Key	
  
Value 
Next	
  
Cell	
   Maps.Put (A_Map, ASU.To_Unbounded_String(“facebook.com"), 
 ASU.To_Unbounded_String(“69.63.189.11")); 5 
A_Map.P_First	
  
GSyC - 2019 Tablas de Śımbolos 91
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
“www.urjc.es"	
  
“212.128.240.25” 
3 
M.Length 
“google.com"	
  
“66.249.92.104”	
  
P_Aux	
  
“facebook.com"	
  
“69.63.189.16”	
  
Key	
  
Value 
Next	
  
Cell	
   Maps.Put (A_Map, ASU.To_Unbounded_String(“facebook.com"), 
 ASU.To_Unbounded_String(“69.63.189.11")); 5 
? 
Success 
procedure Put (M : in out Map; 
 Key : ASU.Unbounded_String; 
 Value : ASU.Unbounded_String) is 
 P_Aux : Cell_A; 
 Success : Boolean; 
begin 
 P_Aux := M.P_First; 
 Success := False; 
 while not Success and P_Aux /= null loop 
 if P_Aux.Key = Key then 
 P_Aux.Value := Value; 
 Success := True; 
 end if; 
 P_Aux := P_Aux.Next; 
 end loop; 
 if not Success then 
 M.P_First:=new Cell'(Key, Value, M.P_First); 
 M.Length := M.Length + 1; 
 end if; 
end Put; 
M.P_First	
  
GSyC - 2019 Tablas de Śımbolos 92
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
   “www.urjc.es"	
  
“212.128.240.25” 
3 
M.Length 
“google.com"	
  
“66.249.92.104”	
  
P_Aux	
  
“facebook.com"	
  
“69.63.189.16”	
  
Key	
  
Value 
Next	
  
Cell	
   Maps.Put (A_Map, ASU.To_Unbounded_String(“facebook.com"), 
 ASU.To_Unbounded_String(“69.63.189.11")); 5 
? 
Success 
procedure Put (M : in out Map; 
 Key : ASU.Unbounded_String; 
 Value : ASU.Unbounded_String) is 
 P_Aux : Cell_A; 
 Success : Boolean; 
begin 
 P_Aux := M.P_First; 
 Success := False; 
 while not Success and P_Aux /= null loop 
 if P_Aux.Key = Key then 
 P_Aux.Value := Value; 
 Success := True; 
 end if; 
 P_Aux := P_Aux.Next; 
 end loop; 
 if not Success then 
 M.P_First:=new Cell'(Key, Value, M.P_First); 
 M.Length := M.Length + 1; 
 end if; 
end Put; 
GSyC - 2019 Tablas de Śımbolos 93
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
   “www.urjc.es"	
  
“212.128.240.25” 
3 
M.Length 
“google.com"	
  
“66.249.92.104”	
  
“facebook.com"	
  
“69.63.189.16”	
  
Key	
  
Value 
Next	
  
Cell	
   Maps.Put (A_Map, ASU.To_Unbounded_String(“facebook.com"), 
 ASU.To_Unbounded_String(“69.63.189.11")); 5 
False 
Success 
procedure Put (M : in out Map; 
 Key : ASU.Unbounded_String; 
 Value : ASU.Unbounded_String) is 
 P_Aux : Cell_A; 
 Success : Boolean; 
begin 
 P_Aux := M.P_First; 
 Success := False; 
 while not Success and P_Aux /= null loop 
 if P_Aux.Key = Key then 
 P_Aux.Value := Value; 
 Success := True; 
 end if; 
 P_Aux := P_Aux.Next; 
 end loop; 
 if not Success then 
 M.P_First:=new Cell'(Key, Value, M.P_First); 
 M.Length := M.Length + 1; 
 end if; 
end Put; 
P_Aux	
  
GSyC - 2019 Tablas de Śımbolos 94
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
   “www.urjc.es"	
  
“212.128.240.25” 
3 
M.Length 
“google.com"	
  
“66.249.92.104”	
  
“facebook.com"	
  
“69.63.189.16”	
  
Key	
  
Value 
Next	
  
Cell	
   Maps.Put (A_Map, ASU.To_Unbounded_String(“facebook.com"), 
 ASU.To_Unbounded_String(“69.63.189.11")); 5 
False 
Success 
procedure Put (M : in out Map; 
 Key : ASU.Unbounded_String; 
 Value : ASU.Unbounded_String) is 
 P_Aux : Cell_A; 
 Success : Boolean; 
begin 
 P_Aux := M.P_First; 
 Success := False; 
 while not Success and P_Aux /= null loop 
 if P_Aux.Key = Key then 
 P_Aux.Value := Value; 
 Success := True; 
 end if; 
 P_Aux := P_Aux.Next; 
 end loop; 
 if not Success then 
 M.P_First:=new Cell'(Key, Value, M.P_First); 
 M.Length := M.Length + 1; 
 end if; 
end Put; 
P_Aux	
  
GSyC - 2019 Tablas de Śımbolos 95
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
“www.urjc.es"	
  
“212.128.240.25” 
3 
M.Length 
“google.com"	
  
“66.249.92.104”	
  
“facebook.com"	
  
“69.63.189.16”	
  
Key	
  
Value 
Next	
  
Cell	
   Maps.Put (A_Map, ASU.To_Unbounded_String(“facebook.com"), 
 ASU.To_Unbounded_String(“69.63.189.11")); 5 
False 
Success 
procedure Put (M : in out Map; 
 Key : ASU.Unbounded_String; 
 Value : ASU.Unbounded_String) is 
 P_Aux : Cell_A; 
 Success : Boolean; 
begin 
 P_Aux := M.P_First; 
 Success := False; 
 while not Success and P_Aux /= null loop 
 if P_Aux.Key = Key then 
 P_Aux.Value := Value; 
 Success := True; 
 end if; 
 P_Aux := P_Aux.Next; 
 end loop; 
 if not Success then 
 M.P_First:=new Cell'(Key, Value, M.P_First); 
 M.Length := M.Length + 1; 
 end if; 
end Put; 
P_Aux	
  
M.P_First	
  
GSyC - 2019 Tablas de Śımbolos 96
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
“www.urjc.es"	
  
“212.128.240.25” 
3 
M.Length 
“google.com"	
  
“66.249.92.104”	
  
“facebook.com"	
  
“69.63.189.16”	
  
Key	
  
Value 
Next	
  
Cell	
   Maps.Put (A_Map, ASU.To_Unbounded_String(“facebook.com"), 
 ASU.To_Unbounded_String(“69.63.189.11")); 5 
False 
Success 
procedure Put (M : in out Map; 
 Key : ASU.Unbounded_String; 
 Value : ASU.Unbounded_String) is 
 P_Aux : Cell_A; 
 Success : Boolean; 
begin 
 P_Aux := M.P_First; 
 Success := False; 
 while not Success and P_Aux /= null loop 
 if P_Aux.Key = Key then 
 P_Aux.Value := Value; 
 Success := True; 
 end if; 
 P_Aux := P_Aux.Next; 
 end loop; 
 if not Success then 
 M.P_First:=new Cell'(Key, Value, M.P_First); 
 M.Length := M.Length + 1; 
 end if; 
end Put; 
P_Aux	
  
M.P_First	
  
GSyC - 2019 Tablas de Śımbolos 97
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
   “www.urjc.es"	
  
“212.128.240.25” 
3 
M.Length 
“google.com"	
  
“66.249.92.104”	
  
“facebook.com"	
  
“69.63.189.16”	
  
Key	
  
Value 
Next	
  
Cell	
   Maps.Put (A_Map, ASU.To_Unbounded_String(“facebook.com"), 
 ASU.To_Unbounded_String(“69.63.189.11")); 5 
False 
Success 
procedure Put (M : in out Map; 
 Key : ASU.Unbounded_String; 
 Value : ASU.Unbounded_String) is 
 P_Aux : Cell_A; 
 Success : Boolean; 
begin 
 P_Aux := M.P_First; 
 Success := False; 
 while not Success and P_Aux /= null loop 
 if P_Aux.Key = Key then 
 P_Aux.Value := Value; 
 Success := True; 
 end if; 
 P_Aux := P_Aux.Next; 
 end loop; 
 if not Success then 
 M.P_First:=new Cell'(Key, Value, M.P_First); 
 M.Length := M.Length + 1; 
 end if; 
end Put; 
P_Aux	
  
GSyC - 2019 Tablas de Śımbolos 98
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
  “www.urjc.es"	
  
“212.128.240.25” 
3 
M.Length 
“google.com"	
  
“66.249.92.104”	
  
“facebook.com"	
  
“69.63.189.16”	
  
Key	
  
Value 
Next	
  
Cell	
   Maps.Put (A_Map, ASU.To_Unbounded_String(“facebook.com"), 
 ASU.To_Unbounded_String(“69.63.189.11")); 5 
False 
Success 
procedure Put (M : in out Map; 
 Key : ASU.Unbounded_String; 
 Value : ASU.Unbounded_String) is 
 P_Aux : Cell_A; 
 Success : Boolean; 
begin 
 P_Aux := M.P_First;Success := False; 
 while not Success and P_Aux /= null loop 
 if P_Aux.Key = Key then 
 P_Aux.Value := Value; 
 Success := True; 
 end if; 
 P_Aux := P_Aux.Next; 
 end loop; 
 if not Success then 
 M.P_First:=new Cell'(Key, Value, M.P_First); 
 M.Length := M.Length + 1; 
 end if; 
end Put; 
P_Aux	
  
GSyC - 2019 Tablas de Śımbolos 99
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
  “www.urjc.es"	
  
“212.128.240.25” 
3 
M.Length 
“google.com"	
  
“66.249.92.104”	
  
“facebook.com"	
  
“69.63.189.16”	
  
Key	
  
Value 
Next	
  
Cell	
   Maps.Put (A_Map, ASU.To_Unbounded_String(“facebook.com"), 
 ASU.To_Unbounded_String(“69.63.189.11")); 5 
False 
Success 
procedure Put (M : in out Map; 
 Key : ASU.Unbounded_String; 
 Value : ASU.Unbounded_String) is 
 P_Aux : Cell_A; 
 Success : Boolean; 
begin 
 P_Aux := M.P_First; 
 Success := False; 
 while not Success and P_Aux /= null loop 
 if P_Aux.Key = Key then 
 P_Aux.Value := Value; 
 Success := True; 
 end if; 
 P_Aux := P_Aux.Next; 
 end loop; 
 if not Success then 
 M.P_First:=new Cell'(Key, Value, M.P_First); 
 M.Length := M.Length + 1; 
 end if; 
end Put; 
P_Aux	
  
GSyC - 2019 Tablas de Śımbolos 100
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
  “www.urjc.es"	
  
“212.128.240.25” 
3 
M.Length 
“google.com"	
  
“66.249.92.104”	
  
“facebook.com"	
  
“69.63.189.16”	
  
Key	
  
Value 
Next	
  
Cell	
   Maps.Put (A_Map, ASU.To_Unbounded_String(“facebook.com"), 
 ASU.To_Unbounded_String(“69.63.189.11")); 5 
False 
Success 
procedure Put (M : in out Map; 
 Key : ASU.Unbounded_String; 
 Value : ASU.Unbounded_String) is 
 P_Aux : Cell_A; 
 Success : Boolean; 
begin 
 P_Aux := M.P_First; 
 Success := False; 
 while not Success and P_Aux /= null loop 
 if P_Aux.Key = Key then 
 P_Aux.Value := Value; 
 Success := True; 
 end if; 
 P_Aux := P_Aux.Next; 
 end loop; 
 if not Success then 
 M.P_First:=new Cell'(Key, Value, M.P_First); 
 M.Length := M.Length + 1; 
 end if; 
end Put; 
P_Aux	
  
GSyC - 2019 Tablas de Śımbolos 101
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
  “www.urjc.es"	
  
“212.128.240.25” 
3 
M.Length 
“google.com"	
  
“66.249.92.104”	
  
“facebook.com"	
  
“69.63.189.16”	
  
Key	
  
Value 
Next	
  
Cell	
   Maps.Put (A_Map, ASU.To_Unbounded_String(“facebook.com"), 
 ASU.To_Unbounded_String(“69.63.189.11")); 5 
False 
Success 
procedure Put (M : in out Map; 
 Key : ASU.Unbounded_String; 
 Value : ASU.Unbounded_String) is 
 P_Aux : Cell_A; 
 Success : Boolean; 
begin 
 P_Aux := M.P_First; 
 Success := False; 
 while not Success and P_Aux /= null loop 
 if P_Aux.Key = Key then 
 P_Aux.Value := Value; 
 Success := True; 
 end if; 
 P_Aux := P_Aux.Next; 
 end loop; 
 if not Success then 
 M.P_First:=new Cell'(Key, Value, M.P_First); 
 M.Length := M.Length + 1; 
 end if; 
end Put; 
P_Aux	
  
GSyC - 2019 Tablas de Śımbolos 102
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
  “www.urjc.es"	
  
“212.128.240.25” 
3 
M.Length 
“google.com"	
  
“66.249.92.104”	
  
“facebook.com"	
  
“69.63.189.16”	
  
Key	
  
Value 
Next	
  
Cell	
   Maps.Put (A_Map, ASU.To_Unbounded_String(“facebook.com"), 
 ASU.To_Unbounded_String(“69.63.189.11")); 5 
False 
Success 
procedure Put (M : in out Map; 
 Key : ASU.Unbounded_String; 
 Value : ASU.Unbounded_String) is 
 P_Aux : Cell_A; 
 Success : Boolean; 
begin 
 P_Aux := M.P_First; 
 Success := False; 
 while not Success and P_Aux /= null loop 
 if P_Aux.Key = Key then 
 P_Aux.Value := Value; 
 Success := True; 
 end if; 
 P_Aux := P_Aux.Next; 
 end loop; 
 if not Success then 
 M.P_First:=new Cell'(Key, Value, M.P_First); 
 M.Length := M.Length + 1; 
 end if; 
end Put; 
P_Aux	
  
GSyC - 2019 Tablas de Śımbolos 103
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
  “www.urjc.es"	
  
“212.128.240.25” 
3 
M.Length 
“google.com"	
  
“66.249.92.104”	
  
“facebook.com"	
  
“69.63.189.16”	
  
Key	
  
Value 
Next	
  
Cell	
   Maps.Put (A_Map, ASU.To_Unbounded_String(“facebook.com"), 
 ASU.To_Unbounded_String(“69.63.189.11")); 5 
False 
Success 
procedure Put (M : in out Map; 
 Key : ASU.Unbounded_String; 
 Value : ASU.Unbounded_String) is 
 P_Aux : Cell_A; 
 Success : Boolean; 
begin 
 P_Aux := M.P_First; 
 Success := False; 
 while not Success and P_Aux /= null loop 
 if P_Aux.Key = Key then 
 P_Aux.Value := Value; 
 Success := True; 
 end if; 
 P_Aux := P_Aux.Next; 
 end loop; 
 if not Success then 
 M.P_First:=new Cell'(Key, Value, M.P_First); 
 M.Length := M.Length + 1; 
 end if; 
end Put; 
P_Aux	
  
GSyC - 2019 Tablas de Śımbolos 104
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
  “www.urjc.es"	
  
“212.128.240.25” 
3 
M.Length 
“google.com"	
  
“66.249.92.104”	
  
“facebook.com"	
  
“69.63.189.16”	
  
Key	
  
Value 
Next	
  
Cell	
   Maps.Put (A_Map, ASU.To_Unbounded_String(“facebook.com"), 
 ASU.To_Unbounded_String(“69.63.189.11")); 5 
False 
Success 
procedure Put (M : in out Map; 
 Key : ASU.Unbounded_String; 
 Value : ASU.Unbounded_String) is 
 P_Aux : Cell_A; 
 Success : Boolean; 
begin 
 P_Aux := M.P_First; 
 Success := False; 
 while not Success and P_Aux /= null loop 
 if P_Aux.Key = Key then 
 P_Aux.Value := Value; 
 Success := True; 
 end if; 
 P_Aux := P_Aux.Next; 
 end loop; 
 if not Success then 
 M.P_First:=new Cell'(Key, Value, M.P_First); 
 M.Length := M.Length + 1; 
 end if; 
end Put; 
P_Aux	
  
GSyC - 2019 Tablas de Śımbolos 105
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
  “www.urjc.es"	
  
“212.128.240.25” 
3 
M.Length 
“google.com"	
  
“66.249.92.104”	
  
“facebook.com"	
  
“69.63.189.16”	
  
Key	
  
Value 
Next	
  
Cell	
   Maps.Put (A_Map, ASU.To_Unbounded_String(“facebook.com"), 
 ASU.To_Unbounded_String(“69.63.189.11")); 5 
False 
Success 
procedure Put (M : in out Map; 
 Key : ASU.Unbounded_String; 
 Value : ASU.Unbounded_String) is 
 P_Aux : Cell_A; 
 Success : Boolean; 
begin 
 P_Aux := M.P_First; 
 Success := False; 
 while not Success and P_Aux /= null loop 
 if P_Aux.Key = Key then 
 P_Aux.Value := Value; 
 Success := True; 
 end if; 
 P_Aux := P_Aux.Next; 
 end loop; 
 if not Success then 
 M.P_First:=new Cell'(Key, Value, M.P_First); 
 M.Length := M.Length + 1; 
 end if; 
end Put; 
P_Aux	
  
GSyC - 2019 Tablas de Śımbolos 106
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
  “www.urjc.es"	
  
“212.128.240.25” 
3 
M.Length 
“google.com"	
  
“66.249.92.104”	
  
“facebook.com"	
  
“69.63.189.16”	
  
Key	
  
Value 
Next	
  
Cell	
   Maps.Put (A_Map, ASU.To_Unbounded_String(“facebook.com"), 
 ASU.To_Unbounded_String(“69.63.189.11")); 5 
False 
Success 
procedure Put (M : in out Map; 
 Key : ASU.Unbounded_String; 
 Value : ASU.Unbounded_String) is 
 P_Aux : Cell_A; 
 Success : Boolean; 
begin 
 P_Aux := M.P_First; 
 Success := False; 
 while not Success and P_Aux /= null loop 
 if P_Aux.Key = Key then 
 P_Aux.Value := Value; 
 Success := True; 
 end if; 
 P_Aux := P_Aux.Next; 
 end loop; 
 if not Success then 
 M.P_First:=new Cell'(Key, Value, M.P_First);M.Length := M.Length + 1; 
 end if; 
end Put; 
P_Aux	
  
GSyC - 2019 Tablas de Śımbolos 107
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
  “www.urjc.es"	
  
“212.128.240.25” 
3 
M.Length 
“google.com"	
  
“66.249.92.104”	
  
“facebook.com"	
  
“69.63.189.11”	
  
Key	
  
Value 
Next	
  
Cell	
   Maps.Put (A_Map, ASU.To_Unbounded_String(“facebook.com"), 
 ASU.To_Unbounded_String(“69.63.189.11")); 5 
False 
Success 
procedure Put (M : in out Map; 
 Key : ASU.Unbounded_String; 
 Value : ASU.Unbounded_String) is 
 P_Aux : Cell_A; 
 Success : Boolean; 
begin 
 P_Aux := M.P_First; 
 Success := False; 
 while not Success and P_Aux /= null loop 
 if P_Aux.Key = Key then 
 P_Aux.Value := Value; 
 Success := True; 
 end if; 
 P_Aux := P_Aux.Next; 
 end loop; 
 if not Success then 
 M.P_First:=new Cell'(Key, Value, M.P_First); 
 M.Length := M.Length + 1; 
 end if; 
end Put; 
P_Aux	
  
GSyC - 2019 Tablas de Śımbolos 108
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
  “www.urjc.es"	
  
“212.128.240.25” 
3 
M.Length 
“google.com"	
  
“66.249.92.104”	
  
“facebook.com"	
  
“69.63.189.11”	
  
Key	
  
Value 
Next	
  
Cell	
   Maps.Put (A_Map, ASU.To_Unbounded_String(“facebook.com"), 
 ASU.To_Unbounded_String(“69.63.189.11")); 5 
False 
Success 
procedure Put (M : in out Map; 
 Key : ASU.Unbounded_String; 
 Value : ASU.Unbounded_String) is 
 P_Aux : Cell_A; 
 Success : Boolean; 
begin 
 P_Aux := M.P_First; 
 Success := False; 
 while not Success and P_Aux /= null loop 
 if P_Aux.Key = Key then 
 P_Aux.Value := Value; 
 Success := True; 
 end if; 
 P_Aux := P_Aux.Next; 
 end loop; 
 if not Success then 
 M.P_First:=new Cell'(Key, Value, M.P_First); 
 M.Length := M.Length + 1; 
 end if; 
end Put; 
P_Aux	
  
GSyC - 2019 Tablas de Śımbolos 109
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
  “www.urjc.es"	
  
“212.128.240.25” 
3 
M.Length 
“google.com"	
  
“66.249.92.104”	
  
“facebook.com"	
  
“69.63.189.11”	
  
Key	
  
Value 
Next	
  
Cell	
   Maps.Put (A_Map, ASU.To_Unbounded_String(“facebook.com"), 
 ASU.To_Unbounded_String(“69.63.189.11")); 5 
True 
Success 
procedure Put (M : in out Map; 
 Key : ASU.Unbounded_String; 
 Value : ASU.Unbounded_String) is 
 P_Aux : Cell_A; 
 Success : Boolean; 
begin 
 P_Aux := M.P_First; 
 Success := False; 
 while not Success and P_Aux /= null loop 
 if P_Aux.Key = Key then 
 P_Aux.Value := Value; 
 Success := True; 
 end if; 
 P_Aux := P_Aux.Next; 
 end loop; 
 if not Success then 
 M.P_First:=new Cell'(Key, Value, M.P_First); 
 M.Length := M.Length + 1; 
 end if; 
end Put; 
P_Aux	
  
GSyC - 2019 Tablas de Śımbolos 110
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
  “www.urjc.es"	
  
“212.128.240.25” 
3 
M.Length 
“google.com"	
  
“66.249.92.104”	
  
“facebook.com"	
  
“69.63.189.11”	
  
Key	
  
Value 
Next	
  
Cell	
   Maps.Put (A_Map, ASU.To_Unbounded_String(“facebook.com"), 
 ASU.To_Unbounded_String(“69.63.189.11")); 5 
True 
Success 
procedure Put (M : in out Map; 
 Key : ASU.Unbounded_String; 
 Value : ASU.Unbounded_String) is 
 P_Aux : Cell_A; 
 Success : Boolean; 
begin 
 P_Aux := M.P_First; 
 Success := False; 
 while not Success and P_Aux /= null loop 
 if P_Aux.Key = Key then 
 P_Aux.Value := Value; 
 Success := True; 
 end if; 
 P_Aux := P_Aux.Next; 
 end loop; 
 if not Success then 
 M.P_First:=new Cell'(Key, Value, M.P_First); 
 M.Length := M.Length + 1; 
 end if; 
end Put; 
P_Aux	
  
GSyC - 2019 Tablas de Śımbolos 111
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
  “www.urjc.es"	
  
“212.128.240.25” 
3 
M.Length 
“google.com"	
  
“66.249.92.104”	
  
“facebook.com"	
  
“69.63.189.11”	
  
Key	
  
Value 
Next	
  
Cell	
   Maps.Put (A_Map, ASU.To_Unbounded_String(“facebook.com"), 
 ASU.To_Unbounded_String(“69.63.189.11")); 5 
True 
Success 
procedure Put (M : in out Map; 
 Key : ASU.Unbounded_String; 
 Value : ASU.Unbounded_String) is 
 P_Aux : Cell_A; 
 Success : Boolean; 
begin 
 P_Aux := M.P_First; 
 Success := False; 
 while not Success and P_Aux /= null loop 
 if P_Aux.Key = Key then 
 P_Aux.Value := Value; 
 Success := True; 
 end if; 
 P_Aux := P_Aux.Next; 
 end loop; 
 if not Success then 
 M.P_First:=new Cell'(Key, Value, M.P_First); 
 M.Length := M.Length + 1; 
 end if; 
end Put; 
P_Aux	
  
GSyC - 2019 Tablas de Śımbolos 112
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
  “www.urjc.es"	
  
“212.128.240.25” 
3 
M.Length 
“google.com"	
  
“66.249.92.104”	
  
“facebook.com"	
  
“69.63.189.11”	
  
Key	
  
Value 
Next	
  
Cell	
   Maps.Put (A_Map, ASU.To_Unbounded_String(“facebook.com"), 
 ASU.To_Unbounded_String(“69.63.189.11")); 5 
True 
Success 
procedure Put (M : in out Map; 
 Key : ASU.Unbounded_String; 
 Value : ASU.Unbounded_String) is 
 P_Aux : Cell_A; 
 Success : Boolean; 
begin 
 P_Aux := M.P_First; 
 Success := False; 
 while not Success and P_Aux /= null loop 
 if P_Aux.Key = Key then 
 P_Aux.Value := Value; 
 Success := True; 
 end if; 
 P_Aux := P_Aux.Next; 
 end loop; 
 if not Success then 
 M.P_First:=new Cell'(Key, Value, M.P_First); 
 M.Length := M.Length + 1; 
 end if; 
end Put; 
P_Aux	
  
GSyC - 2019 Tablas de Śımbolos 113
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
  “www.urjc.es"	
  
“212.128.240.25” 
3 
M.Length 
“google.com"	
  
“66.249.92.104”	
  
“facebook.com"	
  
“69.63.189.11”	
  
Key	
  
Value 
Next	
  
Cell	
   Maps.Put (A_Map, ASU.To_Unbounded_String(“facebook.com"), 
 ASU.To_Unbounded_String(“69.63.189.11")); 5 
True 
Success 
procedure Put (M : in out Map; 
 Key : ASU.Unbounded_String; 
 Value : ASU.Unbounded_String) is 
 P_Aux : Cell_A; 
 Success : Boolean; 
begin 
 P_Aux := M.P_First; 
 Success := False; 
 while not Success and P_Aux /= null loop 
 if P_Aux.Key = Key then 
 P_Aux.Value := Value; 
 Success := True; 
 end if; 
 P_Aux := P_Aux.Next; 
 end loop; 
 if not Success then 
 M.P_First:=new Cell'(Key, Value, M.P_First); 
 M.Length := M.Length + 1; 
 end if; 
end Put; 
P_Aux	
  
GSyC - 2019 Tablas de Śımbolos 114
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
  “www.urjc.es"	
  
“212.128.240.25” 
3 
M.Length 
“google.com"	
  
“66.249.92.104”	
  
“facebook.com"	
  
“69.63.189.11”	
  
Key	
  
Value 
Next	
  
Cell	
   Maps.Put (A_Map, ASU.To_Unbounded_String(“facebook.com"), 
 ASU.To_Unbounded_String(“69.63.189.11")); 5 
True 
Success 
procedure Put (M : in out Map; 
 Key : ASU.Unbounded_String; 
 Value : ASU.Unbounded_String) is 
 P_Aux : Cell_A; 
 Success : Boolean; 
begin 
 P_Aux := M.P_First; 
 Success := False; 
 while not Success and P_Aux /= null loop 
 if P_Aux.Key = Key then 
 P_Aux.Value := Value; 
 Success := True; 
 end if; 
 P_Aux := P_Aux.Next; 
 end loop; 
 if not Success then 
 M.P_First:=new Cell'(Key, Value, M.P_First); 
 M.Length := M.Length + 1; 
 end if; 
end Put; 
P_Aux	
  
GSyC - 2019 Tablas de Śımbolos 115
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
  “www.urjc.es"	
  
“212.128.240.25” 
3 
M.Length 
“google.com"	
  
“66.249.92.104”	
  
“facebook.com"“69.63.189.11”	
  
Key	
  
Value 
Next	
  
Cell	
   Maps.Put (A_Map, ASU.To_Unbounded_String(“facebook.com"), 
 ASU.To_Unbounded_String(“69.63.189.11")); 5 
True 
Success 
procedure Put (M : in out Map; 
 Key : ASU.Unbounded_String; 
 Value : ASU.Unbounded_String) is 
 P_Aux : Cell_A; 
 Success : Boolean; 
begin 
 P_Aux := M.P_First; 
 Success := False; 
 while not Success and P_Aux /= null loop 
 if P_Aux.Key = Key then 
 P_Aux.Value := Value; 
 Success := True; 
 end if; 
 P_Aux := P_Aux.Next; 
 end loop; 
 if not Success then 
 M.P_First:=new Cell'(Key, Value, M.P_First); 
 M.Length := M.Length + 1; 
 end if; 
end Put; 
P_Aux	
  
GSyC - 2019 Tablas de Śımbolos 116
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
  “www.urjc.es"	
  
“212.128.240.25” 
3 
M.Length 
“google.com"	
  
“66.249.92.104”	
  
“facebook.com"	
  
“69.63.189.11”	
  
Key	
  
Value 
Next	
  
Cell	
   Maps.Put (A_Map, ASU.To_Unbounded_String(“facebook.com"), 
 ASU.To_Unbounded_String(“69.63.189.11")); 5 
True 
Success 
procedure Put (M : in out Map; 
 Key : ASU.Unbounded_String; 
 Value : ASU.Unbounded_String) is 
 P_Aux : Cell_A; 
 Success : Boolean; 
begin 
 P_Aux := M.P_First; 
 Success := False; 
 while not Success and P_Aux /= null loop 
 if P_Aux.Key = Key then 
 P_Aux.Value := Value; 
 Success := True; 
 end if; 
 P_Aux := P_Aux.Next; 
 end loop; 
 if not Success then 
 M.P_First:=new Cell'(Key, Value, M.P_First); 
 M.Length := M.Length + 1; 
 end if; 
end Put; 
P_Aux	
  
GSyC - 2019 Tablas de Śımbolos 117
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
  “www.urjc.es"	
  
“212.128.240.25” 
3 
M.Length 
“google.com"	
  
“66.249.92.104”	
  
“facebook.com"	
  
“69.63.189.11”	
  
Key	
  
Value 
Next	
  
Cell	
   Maps.Put (A_Map, ASU.To_Unbounded_String(“facebook.com"), 
 ASU.To_Unbounded_String(“69.63.189.11")); 5 
True 
Success 
procedure Put (M : in out Map; 
 Key : ASU.Unbounded_String; 
 Value : ASU.Unbounded_String) is 
 P_Aux : Cell_A; 
 Success : Boolean; 
begin 
 P_Aux := M.P_First; 
 Success := False; 
 while not Success and P_Aux /= null loop 
 if P_Aux.Key = Key then 
 P_Aux.Value := Value; 
 Success := True; 
 end if; 
 P_Aux := P_Aux.Next; 
 end loop; 
 if not Success then 
 M.P_First:=new Cell'(Key, Value, M.P_First); 
 M.Length := M.Length + 1; 
 end if; 
end Put; 
P_Aux	
  
GSyC - 2019 Tablas de Śımbolos 118
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
A_Map.P_First	
  
“www.urjc.es"	
  
“212.128.240.25” 
3 
A_Map.Length 
“google.com"	
  
“66.249.92.104”	
  
“facebook.com"	
  
“69.63.189.11”	
  
Maps.Delete(A_Map,ASU.To_Unbounded_String(“google.com"),Success); 
6 
GSyC - 2019 Tablas de Śımbolos 119
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
  “www.urjc.es"	
  
“212.128.240.25” 
3 
M.Length 
“google.com"	
  
“66.249.92.104”	
  
“facebook.com"	
  
“69.63.189.11”	
  
procedure Delete (M : in out Map; 
 Key : in Asu.Unbounded_String; 
 Success : out Boolean) is 
 P_Current : Cell_A; 
 P_Previous : Cell_A; 
begin 
 Success := False; 
 P_Previous := null; 
 P_Current := M.P_First; 
 while not Success and P_Current /= null loop 
 if P_Current.Key = Key then 
 Success := True; 
 M.Length := M.Length - 1; 
 if P_Previous /= null then 
 P_Previous.Next := P_Current.Next; 
 end if; 
 if M.P_First = P_Current then 
 M.P_First := M.P_First.Next; 
 end if; 
 -- Liberar si no hay Garbage Collector 
 P_Current:=null; 
 else 
 P_Previous := P_Current; 
 P_Current := P_Current.Next; 
 end if; 
 end loop; 
 end Delete; 
P_Previous	
  
P_Current	
  
? 
Success 
Maps.Delete(A_Map,ASU.To_Unbounded_String(“google.com"),Success); 
6 
GSyC - 2019 Tablas de Śımbolos 120
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
  “www.urjc.es"	
  
“212.128.240.25” 
3 
M.Length 
“google.com"	
  
“66.249.92.104”	
  
“facebook.com"	
  
“69.63.189.11”	
  
procedure Delete (M : in out Map; 
 Key : in Asu.Unbounded_String; 
 Success: out Boolean) is 
 P_Current : Cell_A; 
 P_Previous : Cell_A; 
 begin 
 Success := False; 
 P_Previous := null; 
 P_Current := M.P_First; 
 while not Success and P_Current /= null loop 
 if P_Current.Key = Key then 
 Success := True; 
 M.Length := M.Length - 1; 
 if P_Previous /= null then 
 P_Previous.Next := P_Current.Next; 
 end if; 
 if M.P_First = P_Current then 
 M.P_First := M.P_First.Next; 
 end if; 
 -- Liberar si no hay Garbage Collector 
 P_Current:=null; 
 else 
 P_Previous := P_Current; 
 P_Current := P_Current.Next; 
 end if; 
 end loop; 
 end Delete; 
P_Previous	
  
False 
Success 
P_Current	
  
Maps.Delete(A_Map,ASU.To_Unbounded_String(“google.com"),Success); 
6 
GSyC - 2019 Tablas de Śımbolos 121
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
  “www.urjc.es"	
  
“212.128.240.25” 
3 
M.Length 
“google.com"	
  
“66.249.92.104”	
  
“facebook.com"	
  
“69.63.189.11”	
  
procedure Delete (M : in out Map; 
 Key : in Asu.Unbounded_String; 
 Success: out Boolean) is 
 P_Current : Cell_A; 
 P_Previous : Cell_A; 
 begin 
 Success := False; 
 P_Previous := null; 
 P_Current := M.P_First; 
 while not Success and P_Current /= null loop 
 if P_Current.Key = Key then 
 Success := True; 
 M.Length := M.Length - 1; 
 if P_Previous /= null then 
 P_Previous.Next := P_Current.Next; 
 end if; 
 if M.P_First = P_Current then 
 M.P_First := M.P_First.Next; 
 end if; 
 -- Liberar si no hay Garbage Collector 
 P_Current:=null; 
 else 
 P_Previous := P_Current; 
 P_Current := P_Current.Next; 
 end if; 
 end loop; 
 end Delete; 
P_Previous	
  
False 
Success 
P_Current	
  
Maps.Delete(A_Map,ASU.To_Unbounded_String(“google.com"),Success); 
6 
GSyC - 2019 Tablas de Śımbolos 122
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
  “www.urjc.es"	
  
“212.128.240.25” 
3 
M.Length 
“google.com"	
  
“66.249.92.104”	
  
“facebook.com"	
  
“69.63.189.11”	
  
procedure Delete (M : in out Map; 
 Key : in Asu.Unbounded_String; 
 Success: out Boolean) is 
 P_Current : Cell_A; 
 P_Previous : Cell_A; 
 begin 
 Success := False; 
 P_Previous := null; 
 P_Current := M.P_First; 
 while not Success and P_Current /= null loop 
 if P_Current.Key = Key then 
 Success := True; 
 M.Length := M.Length - 1; 
 if P_Previous /= null then 
 P_Previous.Next := P_Current.Next; 
 end if; 
 if M.P_First = P_Current then 
 M.P_First := M.P_First.Next; 
 end if; 
 -- Liberar si no hay Garbage Collector 
 P_Current:=null; 
 else 
 P_Previous := P_Current; 
 P_Current := P_Current.Next; 
 end if; 
 end loop; 
 end Delete; 
P_Previous	
  
False 
Success 
P_Current	
  
Maps.Delete(A_Map,ASU.To_Unbounded_String(“google.com"),Success);6 
GSyC - 2019 Tablas de Śımbolos 123
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
  “www.urjc.es"	
  
“212.128.240.25” 
3 
M.Length 
“google.com"	
  
“66.249.92.104”	
  
“facebook.com"	
  
“69.63.189.11”	
  
procedure Delete (M : in out Map; 
 Key : in Asu.Unbounded_String; 
 Success: out Boolean) is 
 P_Current : Cell_A; 
 P_Previous : Cell_A; 
 begin 
 Success := False; 
 P_Previous := null; 
 P_Current := M.P_First; 
 while not Success and P_Current /= null loop 
 if P_Current.Key = Key then 
 Success := True; 
 M.Length := M.Length - 1; 
 if P_Previous /= null then 
 P_Previous.Next := P_Current.Next; 
 end if; 
 if M.P_First = P_Current then 
 M.P_First := M.P_First.Next; 
 end if; 
 -- Liberar si no hay Garbage Collector 
 P_Current:=null; 
 else 
 P_Previous := P_Current; 
 P_Current := P_Current.Next; 
 end if; 
 end loop; 
 end Delete; 
False 
Success 
P_Current	
  
P_Previous	
  
Maps.Delete(A_Map,ASU.To_Unbounded_String(“google.com"),Success); 
6 
GSyC - 2019 Tablas de Śımbolos 124
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
  “www.urjc.es"	
  
“212.128.240.25” 
3 
M.Length 
“google.com"	
  
“66.249.92.104”	
  
“facebook.com"	
  
“69.63.189.11”	
  
procedure Delete (M : in out Map; 
 Key : in Asu.Unbounded_String; 
 Success: out Boolean) is 
 P_Current : Cell_A; 
 P_Previous : Cell_A; 
 begin 
 Success := False; 
 P_Previous := null; 
 P_Current := M.P_First; 
 while not Success and P_Current /= null loop 
 if P_Current.Key = Key then 
 Success := True; 
 M.Length := M.Length - 1; 
 if P_Previous /= null then 
 P_Previous.Next := P_Current.Next; 
 end if; 
 if M.P_First = P_Current then 
 M.P_First := M.P_First.Next; 
 end if; 
 -- Liberar si no hay Garbage Collector 
 P_Current:=null; 
 else 
 P_Previous := P_Current; 
 P_Current := P_Current.Next; 
 end if; 
 end loop; 
 end Delete; 
False 
Success 
P_Current	
  
P_Previous	
  
Maps.Delete(A_Map,ASU.To_Unbounded_String(“google.com"),Success); 
6 
GSyC - 2019 Tablas de Śımbolos 125
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
  “www.urjc.es"	
  
“212.128.240.25” 
3 
M.Length 
“google.com"	
  
“66.249.92.104”	
  
“facebook.com"	
  
“69.63.189.11”	
  
procedure Delete (M : in out Map; 
 Key : in Asu.Unbounded_String; 
 Success: out Boolean) is 
 P_Current : Cell_A; 
 P_Previous : Cell_A; 
 begin 
 Success := False; 
 P_Previous := null; 
 P_Current := M.P_First; 
 while not Success and P_Current /= null loop 
 if P_Current.Key = Key then 
 Success := True; 
 M.Length := M.Length - 1; 
 if P_Previous /= null then 
 P_Previous.Next := P_Current.Next; 
 end if; 
 if M.P_First = P_Current then 
 M.P_First := M.P_First.Next; 
 end if; 
 -- Liberar si no hay Garbage Collector 
 P_Current:=null; 
 else 
 P_Previous := P_Current; 
 P_Current := P_Current.Next; 
 end if; 
 end loop; 
 end Delete; 
P_Previous	
  
False 
Success 
P_Current	
  
Maps.Delete(A_Map,ASU.To_Unbounded_String(“google.com"),Success); 
6 
GSyC - 2019 Tablas de Śımbolos 126
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
  “www.urjc.es"	
  
“212.128.240.25” 
3 
M.Length 
“google.com"	
  
“66.249.92.104”	
  
“facebook.com"	
  
“69.63.189.11”	
  
procedure Delete (M : in out Map; 
 Key : in Asu.Unbounded_String; 
 Success: out Boolean) is 
 P_Current : Cell_A; 
 P_Previous : Cell_A; 
 begin 
 Success := False; 
 P_Previous := null; 
 P_Current := M.P_First; 
 while not Success and P_Current /= null loop 
 if P_Current.Key = Key then 
 Success := True; 
 M.Length := M.Length - 1; 
 if P_Previous /= null then 
 P_Previous.Next := P_Current.Next; 
 end if; 
 if M.P_First = P_Current then 
 M.P_First := M.P_First.Next; 
 end if; 
 -- Liberar si no hay Garbage Collector 
 P_Current:=null; 
 else 
 P_Previous := P_Current; 
 P_Current := P_Current.Next; 
 end if; 
 end loop; 
 end Delete; 
P_Previous	
  
False 
Success 
P_Current	
  
Maps.Delete(A_Map,ASU.To_Unbounded_String(“google.com"),Success); 
6 
GSyC - 2019 Tablas de Śımbolos 127
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
  “www.urjc.es"	
  
“212.128.240.25” 
3 
M.Length 
“google.com"	
  
“66.249.92.104”	
  
“facebook.com"	
  
“69.63.189.11”	
  
procedure Delete (M : in out Map; 
 Key : in Asu.Unbounded_String; 
 Success: out Boolean) is 
 P_Current : Cell_A; 
 P_Previous : Cell_A; 
 begin 
 Success := False; 
 P_Previous := null; 
 P_Current := M.P_First; 
 while not Success and P_Current /= null loop 
 if P_Current.Key = Key then 
 Success := True; 
 M.Length := M.Length - 1; 
 if P_Previous /= null then 
 P_Previous.Next := P_Current.Next; 
 end if; 
 if M.P_First = P_Current then 
 M.P_First := M.P_First.Next; 
 end if; 
 -- Liberar si no hay Garbage Collector 
 P_Current:=null; 
 else 
 P_Previous := P_Current; 
 P_Current := P_Current.Next; 
 end if; 
 end loop; 
 end Delete; 
P_Previous	
  
False 
Success 
P_Current	
  
Maps.Delete(A_Map,ASU.To_Unbounded_String(“google.com"),Success); 
6 
GSyC - 2019 Tablas de Śımbolos 128
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
  “www.urjc.es"	
  
“212.128.240.25” 
3 
M.Length 
“google.com"	
  
“66.249.92.104”	
  
“facebook.com"	
  
“69.63.189.11”	
  
procedure Delete (M : in out Map; 
 Key : in Asu.Unbounded_String; 
 Success: out Boolean) is 
 P_Current : Cell_A; 
 P_Previous : Cell_A; 
 begin 
 Success := False; 
 P_Previous := null; 
 P_Current := M.P_First; 
 while not Success and P_Current /= null loop 
 if P_Current.Key = Key then 
 Success := True; 
 M.Length := M.Length - 1; 
 if P_Previous /= null then 
 P_Previous.Next := P_Current.Next; 
 end if; 
 if M.P_First = P_Current then 
 M.P_First := M.P_First.Next; 
 end if; 
 -- Liberar si no hay Garbage Collector 
 P_Current:=null; 
 else 
 P_Previous := P_Current; 
 P_Current := P_Current.Next; 
 end if; 
 end loop; 
 end Delete; 
P_Previous	
  
False 
Success 
P_Current	
  
Maps.Delete(A_Map,ASU.To_Unbounded_String(“google.com"),Success); 
6 
GSyC - 2019 Tablas de Śımbolos 129
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
  “www.urjc.es"	
  
“212.128.240.25” 
3 
M.Length 
“google.com"	
  
“66.249.92.104”	
  
“facebook.com"	
  
“69.63.189.11”	
  
procedure Delete (M : in out Map; 
 Key : in Asu.Unbounded_String; 
 Success: out Boolean) is 
 P_Current : Cell_A; 
 P_Previous : Cell_A; 
 begin 
 Success:= False; 
 P_Previous := null; 
 P_Current := M.P_First; 
 while not Success and P_Current /= null loop 
 if P_Current.Key = Key then 
 Success := True; 
 M.Length := M.Length - 1; 
 if P_Previous /= null then 
 P_Previous.Next := P_Current.Next; 
 end if; 
 if M.P_First = P_Current then 
 M.P_First := M.P_First.Next; 
 end if; 
 -- Liberar si no hay Garbage Collector 
 P_Current:=null; 
 else 
 P_Previous := P_Current; 
 P_Current := P_Current.Next; 
 end if; 
 end loop; 
 end Delete; 
P_Previous	
  
False 
Success 
P_Current	
  
Maps.Delete(A_Map,ASU.To_Unbounded_String(“google.com"),Success); 
6 
GSyC - 2019 Tablas de Śımbolos 130
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
  “www.urjc.es"	
  
“212.128.240.25” 
3 
M.Length 
“google.com"	
  
“66.249.92.104”	
  
“facebook.com"	
  
“69.63.189.11”	
  
procedure Delete (M : in out Map; 
 Key : in Asu.Unbounded_String; 
 Success: out Boolean) is 
 P_Current : Cell_A; 
 P_Previous : Cell_A; 
 begin 
 Success := False; 
 P_Previous := null; 
 P_Current := M.P_First; 
 while not Success and P_Current /= null loop 
 if P_Current.Key = Key then 
 Success := True; 
 M.Length := M.Length - 1; 
 if P_Previous /= null then 
 P_Previous.Next := P_Current.Next; 
 end if; 
 if M.P_First = P_Current then 
 M.P_First := M.P_First.Next; 
 end if; 
 -- Liberar si no hay Garbage Collector 
 P_Current:=null; 
 else 
 P_Previous := P_Current; 
 P_Current := P_Current.Next; 
 end if; 
 end loop; 
 end Delete; 
P_Previous	
  
False 
Success 
P_Current	
  
Maps.Delete(A_Map,ASU.To_Unbounded_String(“google.com"),Success); 
6 
GSyC - 2019 Tablas de Śımbolos 131
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
  “www.urjc.es"	
  
“212.128.240.25” 
2 
M.Length 
“google.com"	
  
“66.249.92.104”	
  
“facebook.com"	
  
“69.63.189.11”	
  
procedure Delete (M : in out Map; 
 Key : in Asu.Unbounded_String; 
 Success: out Boolean) is 
 P_Current : Cell_A; 
 P_Previous : Cell_A; 
 begin 
 Success := False; 
 P_Previous := null; 
 P_Current := M.P_First; 
 while not Success and P_Current /= null loop 
 if P_Current.Key = Key then 
 Success := True; 
 M.Length := M.Length - 1; 
 if P_Previous /= null then 
 P_Previous.Next := P_Current.Next; 
 end if; 
 if M.P_First = P_Current then 
 M.P_First := M.P_First.Next; 
 end if; 
 -- Liberar si no hay Garbage Collector 
 P_Current:=null; 
 else 
 P_Previous := P_Current; 
 P_Current := P_Current.Next; 
 end if; 
 end loop; 
 end Delete; 
P_Previous	
  
True 
Success 
P_Current	
  
Maps.Delete(A_Map,ASU.To_Unbounded_String(“google.com"),Success); 
6 
GSyC - 2019 Tablas de Śımbolos 132
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
  “www.urjc.es"	
  
“212.128.240.25” 
2 
M.Length 
“google.com"	
  
“66.249.92.104”	
  
“facebook.com"	
  
“69.63.189.11”	
  
procedure Delete (M : in out Map; 
 Key : in Asu.Unbounded_String; 
 Success: out Boolean) is 
 P_Current : Cell_A; 
 P_Previous : Cell_A; 
 begin 
 Success := False; 
 P_Previous := null; 
 P_Current := M.P_First; 
 while not Success and P_Current /= null loop 
 if P_Current.Key = Key then 
 Success := True; 
 M.Length := M.Length - 1; 
 if P_Previous /= null then 
 P_Previous.Next := P_Current.Next; 
 end if; 
 if M.P_First = P_Current then 
 M.P_First := M.P_First.Next; 
 end if; 
 -- Liberar si no hay Garbage Collector 
 P_Current:=null; 
 else 
 P_Previous := P_Current; 
 P_Current := P_Current.Next; 
 end if; 
 end loop; 
 end Delete; 
P_Previous	
  
True 
Success 
P_Current	
  
Maps.Delete(A_Map,ASU.To_Unbounded_String(“google.com"),Success); 
6 
GSyC - 2019 Tablas de Śımbolos 133
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
  “www.urjc.es"	
  
“212.128.240.25” 
2 
M.Length 
“google.com"	
  
“66.249.92.104”	
  
“facebook.com"	
  
“69.63.189.11”	
  
procedure Delete (M : in out Map; 
 Key : in Asu.Unbounded_String; 
 Success: out Boolean) is 
 P_Current : Cell_A; 
 P_Previous : Cell_A; 
 begin 
 Success := False; 
 P_Previous := null; 
 P_Current := M.P_First; 
 while not Success and P_Current /= null loop 
 if P_Current.Key = Key then 
 Success := True; 
 M.Length := M.Length - 1; 
 if P_Previous /= null then 
 P_Previous.Next := P_Current.Next; 
 end if; 
 if M.P_First = P_Current then 
 M.P_First := M.P_First.Next; 
 end if; 
 -- Liberar si no hay Garbage Collector 
 P_Current:=null; 
 else 
 P_Previous := P_Current; 
 P_Current := P_Current.Next; 
 end if; 
 end loop; 
 end Delete; 
True 
Success 
P_Current	
  
P_Previous	
  
Maps.Delete(A_Map,ASU.To_Unbounded_String(“google.com"),Success); 
6 
GSyC - 2019 Tablas de Śımbolos 134
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
  “www.urjc.es"	
  
“212.128.240.25” 
2 
M.Length 
“google.com"	
  
“66.249.92.104”	
  
“facebook.com"	
  
“69.63.189.11”	
  
procedure Delete (M : in out Map; 
 Key : in Asu.Unbounded_String; 
 Success: out Boolean) is 
 P_Current : Cell_A; 
 P_Previous : Cell_A; 
 begin 
 Success := False; 
 P_Previous := null; 
 P_Current := M.P_First; 
 while not Success and P_Current /= null loop 
 if P_Current.Key = Key then 
 Success := True; 
 M.Length := M.Length - 1; 
 if P_Previous /= null then 
 P_Previous.Next := P_Current.Next; 
 end if; 
 if M.P_First = P_Current then 
 M.P_First := M.P_First.Next; 
 end if; 
 -- Liberar si no hay Garbage Collector 
 P_Current:=null; 
 else 
 P_Previous := P_Current; 
 P_Current := P_Current.Next; 
 end if; 
 end loop; 
 end Delete; 
True 
Success 
P_Current	
  
P_Previous	
  
Maps.Delete(A_Map,ASU.To_Unbounded_String(“google.com"),Success); 
6 
GSyC - 2019 Tablas de Śımbolos 135
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
  “www.urjc.es"	
  
“212.128.240.25” 
2 
M.Length 
“google.com"	
  
“66.249.92.104”	
  
“facebook.com"	
  
“69.63.189.11”	
  
procedure Delete (M : in out Map; 
 Key : in Asu.Unbounded_String; 
 Success: out Boolean) is 
 P_Current : Cell_A; 
 P_Previous : Cell_A; 
 begin 
 Success := False; 
 P_Previous := null; 
 P_Current := M.P_First; 
 while not Success and P_Current /= null loop 
 if P_Current.Key = Key then 
 Success := True; 
 M.Length := M.Length - 1; 
 if P_Previous /= null then 
 P_Previous.Next := P_Current.Next; 
 end if; 
 if M.P_First = P_Current then 
 M.P_First := M.P_First.Next; 
 end if; 
 -- Liberarsi no hay Garbage Collector 
 P_Current:=null; 
 else 
 P_Previous := P_Current; 
 P_Current := P_Current.Next; 
 end if; 
 end loop; 
 end Delete; 
True 
Success 
P_Current	
  
P_Previous	
  
Maps.Delete(A_Map,ASU.To_Unbounded_String(“google.com"),Success); 
6 
GSyC - 2019 Tablas de Śımbolos 136
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
  “www.urjc.es"	
  
“212.128.240.25” 
2 
M.Length 
“google.com"	
  
“66.249.92.104”	
  
“facebook.com"	
  
“69.63.189.11”	
  
procedure Delete (M : in out Map; 
 Key : in Asu.Unbounded_String; 
 Success: out Boolean) is 
 P_Current : Cell_A; 
 P_Previous : Cell_A; 
 begin 
 Success := False; 
 P_Previous := null; 
 P_Current := M.P_First; 
 while not Success and P_Current /= null loop 
 if P_Current.Key = Key then 
 Success := True; 
 M.Length := M.Length - 1; 
 if P_Previous /= null then 
 P_Previous.Next := P_Current.Next; 
 end if; 
 if M.P_First = P_Current then 
 M.P_First := M.P_First.Next; 
 end if; 
 -- Liberar si no hay Garbage Collector 
 P_Current:=null; 
 else 
 P_Previous := P_Current; 
 P_Current := P_Current.Next; 
 end if; 
 end loop; 
 end Delete; 
True 
Success 
P_Current	
  
P_Previous	
  
Maps.Delete(A_Map,ASU.To_Unbounded_String(“google.com"),Success); 
6 
GSyC - 2019 Tablas de Śımbolos 137
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
  “www.urjc.es"	
  
“212.128.240.25” 
2 
M.Length 
“google.com"	
  
“66.249.92.104”	
  
“facebook.com"	
  
“69.63.189.11”	
  
procedure Delete (M : in out Map; 
 Key : in Asu.Unbounded_String; 
 Success: out Boolean) is 
 P_Current : Cell_A; 
 P_Previous : Cell_A; 
 begin 
 Success := False; 
 P_Previous := null; 
 P_Current := M.P_First; 
 while not Success and P_Current /= null loop 
 if P_Current.Key = Key then 
 Success := True; 
 M.Length := M.Length - 1; 
 if P_Previous /= null then 
 P_Previous.Next := P_Current.Next; 
 end if; 
 if M.P_First = P_Current then 
 M.P_First := M.P_First.Next; 
 end if; 
 -- Liberar si no hay Garbage Collector 
 P_Current:=null; 
 else 
 P_Previous := P_Current; 
 P_Current := P_Current.Next; 
 end if; 
 end loop; 
 end Delete; 
True 
Success 
P_Current	
  
P_Previous	
  
Maps.Delete(A_Map,ASU.To_Unbounded_String(“google.com"),Success); 
6 
GSyC - 2019 Tablas de Śımbolos 138
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
  “www.urjc.es"	
  
“212.128.240.25” 
2 
M.Length 
“google.com"	
  
“66.249.92.104”	
  
“facebook.com"	
  
“69.63.189.11”	
  
procedure Delete (M : in out Map; 
 Key : in Asu.Unbounded_String; 
 Success: out Boolean) is 
 P_Current : Cell_A; 
 P_Previous : Cell_A; 
 begin 
 Success := False; 
 P_Previous := null; 
 P_Current := M.P_First; 
 while not Success and P_Current /= null loop 
 if P_Current.Key = Key then 
 Success := True; 
 M.Length := M.Length - 1; 
 if P_Previous /= null then 
 P_Previous.Next := P_Current.Next; 
 end if; 
 if M.P_First = P_Current then 
 M.P_First := M.P_First.Next; 
 end if; 
 -- Liberar si no hay Garbage Collector 
 P_Current:=null; 
 else 
 P_Previous := P_Current; 
 P_Current := P_Current.Next; 
 end if; 
 end loop; 
 end Delete; 
True 
Success 
P_Previous	
  
P_Current	
  
Maps.Delete(A_Map,ASU.To_Unbounded_String(“google.com"),Success); 
6 
GSyC - 2019 Tablas de Śımbolos 139
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
  “www.urjc.es"	
  
“212.128.240.25” 
2 
M.Length 
“google.com"	
  
“66.249.92.104”	
  
“facebook.com"	
  
“69.63.189.11”	
  
procedure Delete (M : in out Map; 
 Key : in Asu.Unbounded_String; 
 Success: out Boolean) is 
 P_Current : Cell_A; 
 P_Previous : Cell_A; 
 begin 
 Success := False; 
 P_Previous := null; 
 P_Current := M.P_First; 
 while not Success and P_Current /= null loop 
 if P_Current.Key = Key then 
 Success := True; 
 M.Length := M.Length - 1; 
 if P_Previous /= null then 
 P_Previous.Next := P_Current.Next; 
 end if; 
 if M.P_First = P_Current then 
 M.P_First := M.P_First.Next; 
 end if; 
 -- Liberar si no hay Garbage Collector 
 P_Current:=null; 
 else 
 P_Previous := P_Current; 
 P_Current := P_Current.Next; 
 end if; 
 end loop; 
 end Delete; 
True 
Success 
P_Previous	
  
P_Current	
  
Maps.Delete(A_Map,ASU.To_Unbounded_String(“google.com"),Success); 
6 
GSyC - 2019 Tablas de Śımbolos 140
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
  “www.urjc.es"	
  
“212.128.240.25” 
2 
M.Length 
“facebook.com"	
  
“69.63.189.11”	
  
procedure Delete (M : in out Map; 
 Key : in Asu.Unbounded_String; 
 Success: out Boolean) is 
 P_Current : Cell_A; 
 P_Previous : Cell_A; 
 begin 
 Success := False; 
 P_Previous := null; 
 P_Current := M.P_First; 
 while not Success and P_Current /= null loop 
 if P_Current.Key = Key then 
 Success := True; 
 M.Length := M.Length - 1; 
 if P_Previous /= null then 
 P_Previous.Next := P_Current.Next; 
 end if; 
 if M.P_First = P_Current then 
 M.P_First := M.P_First.Next; 
 end if; 
 -- Liberar si no hay Garbage Collector 
 P_Current:=null; 
 else 
 P_Previous := P_Current; 
 P_Current := P_Current.Next; 
 end if; 
 end loop; 
 end Delete; 
True 
Success 
P_Previous	
  
P_Current	
  
Maps.Delete(A_Map,ASU.To_Unbounded_String(“google.com"),Success); 
6 
GSyC - 2019 Tablas de Śımbolos 141
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
  “www.urjc.es"	
  
“212.128.240.25” 
2 
M.Length 
“facebook.com"	
  
“69.63.189.11”	
  
procedure Delete (M : in out Map; 
 Key : in Asu.Unbounded_String; 
 Success: out Boolean) is 
 P_Current : Cell_A; 
 P_Previous : Cell_A; 
 begin 
 Success := False; 
 P_Previous := null; 
 P_Current := M.P_First; 
 while not Success and P_Current /= null loop 
 if P_Current.Key = Key then 
 Success := True; 
 M.Length := M.Length - 1; 
 if P_Previous /= null then 
 P_Previous.Next := P_Current.Next; 
 end if; 
 if M.P_First = P_Current then 
 M.P_First := M.P_First.Next; 
 end if; 
 -- Liberar si no hay Garbage Collector 
 P_Current:=null; 
 else 
 P_Previous := P_Current; 
 P_Current := P_Current.Next; 
 end if; 
 end loop; 
 end Delete; 
True 
Success 
P_Previous	
  
P_Current	
  
Maps.Delete(A_Map,ASU.To_Unbounded_String(“google.com"),Success); 
6 
GSyC - 2019 Tablas de Śımbolos 142
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
  “www.urjc.es"	
  
“212.128.240.25” 
2 
M.Length 
“facebook.com"	
  
“69.63.189.11”	
  
procedure Delete(M : in out Map; 
 Key : in Asu.Unbounded_String; 
 Success: out Boolean) is 
 P_Current : Cell_A; 
 P_Previous : Cell_A; 
 begin 
 Success := False; 
 P_Previous := null; 
 P_Current := M.P_First; 
 while not Success and P_Current /= null loop 
 if P_Current.Key = Key then 
 Success := True; 
 M.Length := M.Length - 1; 
 if P_Previous /= null then 
 P_Previous.Next := P_Current.Next; 
 end if; 
 if M.P_First = P_Current then 
 M.P_First := M.P_First.Next; 
 end if; 
 -- Liberar si no hay Garbage Collector 
 P_Current:=null; 
 else 
 P_Previous := P_Current; 
 P_Current := P_Current.Next; 
 end if; 
 end loop; 
 end Delete; 
True 
Success 
P_Previous	
  
P_Current	
  
Maps.Delete(A_Map,ASU.To_Unbounded_String(“google.com"),Success); 
6 
GSyC - 2019 Tablas de Śımbolos 143
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
  “www.urjc.es"	
  
“212.128.240.25” 
2 
M.Length 
“facebook.com"	
  
“69.63.189.11”	
  
procedure Delete (M : in out Map; 
 Key : in Asu.Unbounded_String; 
 Success: out Boolean) is 
 P_Current : Cell_A; 
 P_Previous : Cell_A; 
 begin 
 Success := False; 
 P_Previous := null; 
 P_Current := M.P_First; 
 while not Success and P_Current /= null loop 
 if P_Current.Key = Key then 
 Success := True; 
 M.Length := M.Length - 1; 
 if P_Previous /= null then 
 P_Previous.Next := P_Current.Next; 
 end if; 
 if M.P_First = P_Current then 
 M.P_First := M.P_First.Next; 
 end if; 
 -- Liberar si no hay Garbage Collector 
 P_Current:=null; 
 else 
 P_Previous := P_Current; 
 P_Current := P_Current.Next; 
 end if; 
 end loop; 
 end Delete; 
True 
Success 
P_Previous	
  
P_Current	
  
Maps.Delete(A_Map,ASU.To_Unbounded_String(“google.com"),Success); 
6 
GSyC - 2019 Tablas de Śımbolos 144
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
  “www.urjc.es"	
  
“212.128.240.25” 
2 
M.Length 
“facebook.com"	
  
“69.63.189.11”	
  
procedure Delete (M : in out Map; 
 Key : in Asu.Unbounded_String; 
 Success: out Boolean) is 
 P_Current : Cell_A; 
 P_Previous : Cell_A; 
 begin 
 Success := False; 
 P_Previous := null; 
 P_Current := M.P_First; 
 while not Success and P_Current /= null loop 
 if P_Current.Key = Key then 
 Success := True; 
 M.Length := M.Length - 1; 
 if P_Previous /= null then 
 P_Previous.Next := P_Current.Next; 
 end if; 
 if M.P_First = P_Current then 
 M.P_First := M.P_First.Next; 
 end if; 
 -- Liberar si no hay Garbage Collector 
 P_Current:=null; 
 else 
 P_Previous := P_Current; 
 P_Current := P_Current.Next; 
 end if; 
 end loop; 
 end Delete; 
True 
Success 
P_Previous	
  
P_Current	
  
Maps.Delete(A_Map,ASU.To_Unbounded_String(“google.com"),Success); 
6 
GSyC - 2019 Tablas de Śımbolos 145
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
  “www.urjc.es"	
  
“212.128.240.25” 
2 
M.Length 
“facebook.com"	
  
“69.63.189.11”	
  
procedure Delete (M : in out Map; 
 Key : in Asu.Unbounded_String; 
 Success: out Boolean) is 
 P_Current : Cell_A; 
 P_Previous : Cell_A; 
 begin 
 Success := False; 
 P_Previous := null; 
 P_Current := M.P_First; 
 while not Success and P_Current /= null loop 
 if P_Current.Key = Key then 
 Success := True; 
 M.Length := M.Length - 1; 
 if P_Previous /= null then 
 P_Previous.Next := P_Current.Next; 
 end if; 
 if M.P_First = P_Current then 
 M.P_First := M.P_First.Next; 
 end if; 
 -- Liberar si no hay Garbage Collector 
 P_Current:=null; 
 else 
 P_Previous := P_Current; 
 P_Current := P_Current.Next; 
 end if; 
 end loop; 
 end Delete; 
True 
Success 
P_Previous	
  
P_Current	
  
Maps.Delete(A_Map,ASU.To_Unbounded_String(“google.com"),Success); 
6 
GSyC - 2019 Tablas de Śımbolos 146
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
A_Map.P_First	
  
“www.urjc.es"	
  
“212.128.240.25” 
2 
A_Map.Length 
“facebook.com"	
  
“69.63.189.11”	
  
Maps.Delete(A_Map,ASU.To_Unbounded_String(“google.com"),Success); Maps.Delete(A_Map, ASU.To_Unbounded_String(“www.urjc.es"), Success); 
7 
GSyC - 2019 Tablas de Śımbolos 147
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
  “www.urjc.es"	
  
“212.128.240.25” 
2 
M.Length 
“facebook.com"	
  
“69.63.189.11”	
  
? 
Success 
P_Previous	
  
P_Current	
  
procedure Delete (M : in out Map; 
 Key : in Asu.Unbounded_String; 
 Success: out Boolean) is 
 P_Current : Cell_A; 
 P_Previous : Cell_A; 
 begin 
 Success := False; 
 P_Previous := null; 
 P_Current := M.P_First; 
 while not Success and P_Current /= null loop 
 if P_Current.Key = Key then 
 Success := True; 
 M.Length := M.Length - 1; 
 if P_Previous /= null then 
 P_Previous.Next := P_Current.Next; 
 end if; 
 if M.P_First = P_Current then 
 M.P_First := M.P_First.Next; 
 end if; 
 -- Liberar si no hay Garbage Collector 
 P_Current:=null; 
 else 
 P_Previous := P_Current; 
 P_Current := P_Current.Next; 
 end if; 
 end loop; 
 end Delete; 
Maps.Delete(A_Map, ASU.To_Unbounded_String(“www.urjc.es"), Success); 
7 
GSyC - 2019 Tablas de Śımbolos 148
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
  “www.urjc.es"	
  
“212.128.240.25” 
2 
M.Length 
“facebook.com"	
  
“69.63.189.11”	
  
procedure Delete (M : in out Map; 
 Key : in Asu.Unbounded_String; 
 Success: out Boolean) is 
 P_Current : Cell_A; 
 P_Previous : Cell_A; 
 begin 
 Success := False; 
 P_Previous := null; 
 P_Current := M.P_First; 
 while not Success and P_Current /= null loop 
 if P_Current.Key = Key then 
 Success := True; 
 M.Length := M.Length - 1; 
 if P_Previous /= null then 
 P_Previous.Next := P_Current.Next; 
 end if; 
 if M.P_First = P_Current then 
 M.P_First := M.P_First.Next; 
 end if; 
 -- Liberar si no hay Garbage Collector 
 P_Current:=null; 
 else 
 P_Previous := P_Current; 
 P_Current := P_Current.Next; 
 end if; 
 end loop; 
 end Delete; 
P_Previous	
  
P_Current	
  
? 
Success 
Maps.Delete(A_Map, ASU.To_Unbounded_String(“www.urjc.es"), Success); 
7 
GSyC - 2019 Tablas de Śımbolos 149
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
  “www.urjc.es"	
  
“212.128.240.25” 
2 
M.Length 
“facebook.com"	
  
“69.63.189.11”	
  
procedure Delete (M : in out Map; 
 Key : in Asu.Unbounded_String; 
 Success: out Boolean) is 
 P_Current : Cell_A; 
 P_Previous : Cell_A; 
 begin 
 Success := False; 
 P_Previous := null; 
 P_Current := M.P_First; 
 while not Success and P_Current /= null loop 
 if P_Current.Key= Key then 
 Success := True; 
 M.Length := M.Length - 1; 
 if P_Previous /= null then 
 P_Previous.Next := P_Current.Next; 
 end if; 
 if M.P_First = P_Current then 
 M.P_First := M.P_First.Next; 
 end if; 
 -- Liberar si no hay Garbage Collector 
 P_Current:=null; 
 else 
 P_Previous := P_Current; 
 P_Current := P_Current.Next; 
 end if; 
 end loop; 
 end Delete; 
P_Previous	
  
P_Current	
  
False 
Success 
Maps.Delete(A_Map, ASU.To_Unbounded_String(“www.urjc.es"), Success); 
7 
GSyC - 2019 Tablas de Śımbolos 150
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
  “www.urjc.es"	
  
“212.128.240.25” 
2 
M.Length 
“facebook.com"	
  
“69.63.189.11”	
  
procedure Delete (M : in out Map; 
 Key : in Asu.Unbounded_String; 
 Success: out Boolean) is 
 P_Current : Cell_A; 
 P_Previous : Cell_A; 
 begin 
 Success := False; 
 P_Previous := null; 
 P_Current := M.P_First; 
 while not Success and P_Current /= null loop 
 if P_Current.Key = Key then 
 Success := True; 
 M.Length := M.Length - 1; 
 if P_Previous /= null then 
 P_Previous.Next := P_Current.Next; 
 end if; 
 if M.P_First = P_Current then 
 M.P_First := M.P_First.Next; 
 end if; 
 -- Liberar si no hay Garbage Collector 
 P_Current:=null; 
 else 
 P_Previous := P_Current; 
 P_Current := P_Current.Next; 
 end if; 
 end loop; 
 end Delete; 
P_Previous	
  
P_Current	
  
False 
Success 
Maps.Delete(A_Map, ASU.To_Unbounded_String(“www.urjc.es"), Success); 
7 
GSyC - 2019 Tablas de Śımbolos 151
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
  “www.urjc.es"	
  
“212.128.240.25” 
2 
M.Length 
“facebook.com"	
  
“69.63.189.11”	
  
procedure Delete (M : in out Map; 
 Key : in Asu.Unbounded_String; 
 Success: out Boolean) is 
 P_Current : Cell_A; 
 P_Previous : Cell_A; 
 begin 
 Success := False; 
 P_Previous := null; 
 P_Current := M.P_First; 
 while not Success and P_Current /= null loop 
 if P_Current.Key = Key then 
 Success := True; 
 M.Length := M.Length - 1; 
 if P_Previous /= null then 
 P_Previous.Next := P_Current.Next; 
 end if; 
 if M.P_First = P_Current then 
 M.P_First := M.P_First.Next; 
 end if; 
 -- Liberar si no hay Garbage Collector 
 P_Current:=null; 
 else 
 P_Previous := P_Current; 
 P_Current := P_Current.Next; 
 end if; 
 end loop; 
 end Delete; 
P_Previous	
  
P_Current	
  
False 
Success 
Maps.Delete(A_Map, ASU.To_Unbounded_String(“www.urjc.es"), Success); 
7 
GSyC - 2019 Tablas de Śımbolos 152
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
  “www.urjc.es"	
  
“212.128.240.25” 
“facebook.com"	
  
“69.63.189.11”	
  
procedure Delete (M : in out Map; 
 Key : in Asu.Unbounded_String; 
 Success: out Boolean) is 
 P_Current : Cell_A; 
 P_Previous : Cell_A; 
 begin 
 Success := False; 
 P_Previous := null; 
 P_Current := M.P_First; 
 while not Success and P_Current /= null loop 
 if P_Current.Key = Key then 
 Success := True; 
 M.Length := M.Length - 1; 
 if P_Previous /= null then 
 P_Previous.Next := P_Current.Next; 
 end if; 
 if M.P_First = P_Current then 
 M.P_First := M.P_First.Next; 
 end if; 
 -- Liberar si no hay Garbage Collector 
 P_Current:=null; 
 else 
 P_Previous := P_Current; 
 P_Current := P_Current.Next; 
 end if; 
 end loop; 
 end Delete; 
P_Previous	
  
P_Current	
  
2 
M.Length 
False 
Success 
Maps.Delete(A_Map, ASU.To_Unbounded_String(“www.urjc.es"), Success); 
7 
GSyC - 2019 Tablas de Śımbolos 153
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
  “www.urjc.es"	
  
“212.128.240.25” 
“facebook.com"	
  
“69.63.189.11”	
  
procedure Delete (M : in out Map; 
 Key : in Asu.Unbounded_String; 
 Success: out Boolean) is 
 P_Current : Cell_A; 
 P_Previous : Cell_A; 
 begin 
 Success := False; 
 P_Previous := null; 
 P_Current := M.P_First; 
 while not Success and P_Current /= null loop 
 if P_Current.Key = Key then 
 Success := True; 
 M.Length := M.Length - 1; 
 if P_Previous /= null then 
 P_Previous.Next := P_Current.Next; 
 end if; 
 if M.P_First = P_Current then 
 M.P_First := M.P_First.Next; 
 end if; 
 -- Liberar si no hay Garbage Collector 
 P_Current:=null; 
 else 
 P_Previous := P_Current; 
 P_Current := P_Current.Next; 
 end if; 
 end loop; 
 end Delete; 
P_Previous	
  
P_Current	
  
1 
M.Length 
True 
Success 
Maps.Delete(A_Map, ASU.To_Unbounded_String(“www.urjc.es"), Success); 
7 
GSyC - 2019 Tablas de Śımbolos 154
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
  “www.urjc.es"	
  
“212.128.240.25” 
“facebook.com"	
  
“69.63.189.11”	
  
procedure Delete (M : in out Map; 
 Key : in Asu.Unbounded_String; 
 Success: out Boolean) is 
 P_Current : Cell_A; 
 P_Previous : Cell_A; 
 begin 
 Success := False; 
 P_Previous := null; 
 P_Current := M.P_First; 
 while not Success and P_Current /= null loop 
 if P_Current.Key = Key then 
 Success := True; 
 M.Length := M.Length - 1; 
 if P_Previous /= null then 
 P_Previous.Next := P_Current.Next; 
 end if; 
 if M.P_First = P_Current then 
 M.P_First := M.P_First.Next; 
 end if; 
 -- Liberar si no hay Garbage Collector 
 P_Current:=null; 
 else 
 P_Previous := P_Current; 
 P_Current := P_Current.Next; 
 end if; 
 end loop; 
 end Delete; 
P_Previous	
  
P_Current	
  
1 
M.Length 
True 
Success 
Maps.Delete(A_Map, ASU.To_Unbounded_String(“www.urjc.es"), Success); 
7 
GSyC - 2019 Tablas de Śımbolos 155
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
  “www.urjc.es"	
  
“212.128.240.25” 
“facebook.com"	
  
“69.63.189.11”	
  
procedure Delete (M : in out Map; 
 Key : in Asu.Unbounded_String; 
 Success: out Boolean) is 
 P_Current : Cell_A; 
 P_Previous : Cell_A; 
 begin 
 Success := False; 
 P_Previous := null; 
 P_Current := M.P_First; 
 while not Success and P_Current /= null loop 
 if P_Current.Key = Key then 
 Success := True; 
 M.Length := M.Length - 1; 
 if P_Previous /= null then 
 P_Previous.Next := P_Current.Next; 
 end if; 
 if M.P_First = P_Current then 
 M.P_First := M.P_First.Next; 
 end if; 
 -- Liberar si no hay Garbage Collector 
 P_Current:=null; 
 else 
 P_Previous := P_Current; 
 P_Current := P_Current.Next; 
 end if; 
 end loop; 
 end Delete; 
P_Previous	
  
P_Current	
  
1 
M.Length 
True 
Success 
Maps.Delete(A_Map, ASU.To_Unbounded_String(“www.urjc.es"), Success); 
7 
GSyC - 2019 Tablas de Śımbolos156
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
M.P_First	
  “www.urjc.es"	
  
“212.128.240.25” 
“facebook.com"	
  
“69.63.189.11”	
  
procedure Delete (M : in out Map; 
 Key : in Asu.Unbounded_String; 
 Success: out Boolean) is 
 P_Current : Cell_A; 
 P_Previous : Cell_A; 
 begin 
 Success := False; 
 P_Previous := null; 
 P_Current := M.P_First; 
 while not Success and P_Current /= null loop 
 if P_Current.Key = Key then 
 Success := True; 
 M.Length := M.Length - 1; 
 if P_Previous /= null then 
 P_Previous.Next := P_Current.Next; 
 end if; 
 if M.P_First = P_Current then 
 M.P_First := M.P_First.Next; 
 end if; 
 -- Liberar si no hay Garbage Collector 
 P_Current:=null; 
 else 
 P_Previous := P_Current; 
 P_Current := P_Current.Next; 
 end if; 
 end loop; 
 end Delete; 
P_Previous	
  
P_Current	
  
1 
M.Length 
True 
Success 
Maps.Delete(A_Map, ASU.To_Unbounded_String(“www.urjc.es"), Success); 
7 
GSyC - 2019 Tablas de Śımbolos 157
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
“www.urjc.es"	
  
“212.128.240.25” 
“facebook.com"	
  
“69.63.189.11”	
  
procedure Delete (M : in out Map; 
 Key : in Asu.Unbounded_String; 
 Success: out Boolean) is 
 P_Current : Cell_A; 
 P_Previous : Cell_A; 
 begin 
 Success := False; 
 P_Previous := null; 
 P_Current := M.P_First; 
 while not Success and P_Current /= null loop 
 if P_Current.Key = Key then 
 Success := True; 
 M.Length := M.Length - 1; 
 if P_Previous /= null then 
 P_Previous.Next := P_Current.Next; 
 end if; 
 if M.P_First = P_Current then 
 M.P_First := M.P_First.Next; 
 end if; 
 -- Liberar si no hay Garbage Collector 
 P_Current:=null; 
 else 
 P_Previous := P_Current; 
 P_Current := P_Current.Next; 
 end if; 
 end loop; 
 end Delete; 
P_Previous	
  
P_Current	
  
1 
M.Length 
True 
Success 
M.P_First	
  
Maps.Delete(A_Map, ASU.To_Unbounded_String(“www.urjc.es"), Success); 
7 
GSyC - 2019 Tablas de Śımbolos 158
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
“www.urjc.es"	
  
“212.128.240.25” 
“facebook.com"	
  
“69.63.189.11”	
  
procedure Delete (M : in out Map; 
 Key : in Asu.Unbounded_String; 
 Success: out Boolean) is 
 P_Current : Cell_A; 
 P_Previous : Cell_A; 
 begin 
 Success := False; 
 P_Previous := null; 
 P_Current := M.P_First; 
 while not Success and P_Current /= null loop 
 if P_Current.Key = Key then 
 Success := True; 
 M.Length := M.Length - 1; 
 if P_Previous /= null then 
 P_Previous.Next := P_Current.Next; 
 end if; 
 if M.P_First = P_Current then 
 M.P_First := M.P_First.Next; 
 end if; 
 -- Liberar si no hay Garbage Collector 
 P_Current:=null; 
 else 
 P_Previous := P_Current; 
 P_Current := P_Current.Next; 
 end if; 
 end loop; 
 end Delete; 
P_Previous	
  
P_Current	
  
1 
M.Length 
True 
Success 
M.P_First	
  
Maps.Delete(A_Map, ASU.To_Unbounded_String(“www.urjc.es"), Success); 
7 
GSyC - 2019 Tablas de Śımbolos 159
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
“www.urjc.es"	
  
“212.128.240.25” 
“facebook.com"	
  
“69.63.189.11”	
  
procedure Delete (M : in out Map; 
 Key : in Asu.Unbounded_String; 
 Success: out Boolean) is 
 P_Current : Cell_A; 
 P_Previous : Cell_A; 
 begin 
 Success := False; 
 P_Previous := null; 
 P_Current := M.P_First; 
 while not Success and P_Current /= null loop 
 if P_Current.Key = Key then 
 Success := True; 
 M.Length := M.Length - 1; 
 if P_Previous /= null then 
 P_Previous.Next := P_Current.Next; 
 end if; 
 if M.P_First = P_Current then 
 M.P_First := M.P_First.Next; 
 end if; 
 -- Liberar si no hay Garbage Collector 
 P_Current:=null; 
 else 
 P_Previous := P_Current; 
 P_Current := P_Current.Next; 
 end if; 
 end loop; 
 end Delete; 
P_Previous	
  
P_Current	
  
1 
M.Length 
True 
Success 
M.P_First	
  
Maps.Delete(A_Map, ASU.To_Unbounded_String(“www.urjc.es"), Success); 
7 
GSyC - 2019 Tablas de Śımbolos 160
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
“www.urjc.es"	
  
“212.128.240.25” 
“facebook.com"	
  
“69.63.189.11”	
  
procedure Delete (M : in out Map; 
 Key : in Asu.Unbounded_String; 
 Success: out Boolean) is 
 P_Current : Cell_A; 
 P_Previous : Cell_A; 
 begin 
 Success := False; 
 P_Previous := null; 
 P_Current := M.P_First; 
 while not Success and P_Current /= null loop 
 if P_Current.Key = Key then 
 Success := True; 
 M.Length := M.Length - 1; 
 if P_Previous /= null then 
 P_Previous.Next := P_Current.Next; 
 end if; 
 if M.P_First = P_Current then 
 M.P_First := M.P_First.Next; 
 end if; 
 -- Liberar si no hay Garbage Collector 
 P_Current:=null; 
 else 
 P_Previous := P_Current; 
 P_Current := P_Current.Next; 
 end if; 
 end loop; 
 end Delete; 
P_Previous	
  
1 
M.Length 
True 
Success 
M.P_First	
  
P_Current	
  
“www.urjc.es"	
  
“212.128.240.25” 
Maps.Delete(A_Map, ASU.To_Unbounded_String(“www.urjc.es"), Success); 
7 
GSyC - 2019 Tablas de Śımbolos 161
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
“www.urjc.es"	
  
“212.128.240.25” 
“facebook.com"	
  
“69.63.189.11”	
  
procedure Delete (M : in out Map; 
 Key : in Asu.Unbounded_String; 
 Success: out Boolean) is 
 P_Current : Cell_A; 
 P_Previous : Cell_A; 
 begin 
 Success := False; 
 P_Previous := null; 
 P_Current := M.P_First; 
 while not Success and P_Current /= null loop 
 if P_Current.Key = Key then 
 Success := True; 
 M.Length := M.Length - 1; 
 if P_Previous /= null then 
 P_Previous.Next := P_Current.Next; 
 end if; 
 if M.P_First = P_Current then 
 M.P_First := M.P_First.Next; 
 end if; 
 -- Liberar si no hay Garbage Collector 
 P_Current:=null; 
 else 
 P_Previous := P_Current; 
 P_Current := P_Current.Next; 
 end if; 
 end loop; 
 end Delete; 
P_Previous	
  
1 
M.Length 
True 
Success 
M.P_First	
  
P_Current	
  
“www.urjc.es"	
  
“212.128.240.25” 
Maps.Delete(A_Map, ASU.To_Unbounded_String(“www.urjc.es"), Success); 
7 
GSyC - 2019 Tablas de Śımbolos 162
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
“facebook.com"	
  
“69.63.189.11”	
  
procedure Delete (M : in out Map; 
 Key : in Asu.Unbounded_String; 
 Success: out Boolean) is 
 P_Current : Cell_A; 
 P_Previous : Cell_A; 
 begin 
 Success := False; 
 P_Previous := null; 
 P_Current := M.P_First; 
 while not Success and P_Current /= null loop 
 if P_Current.Key = Key then 
 Success := True; 
 M.Length := M.Length - 1; 
 if P_Previous /= null thenP_Previous.Next := P_Current.Next; 
 end if; 
 if M.P_First = P_Current then 
 M.P_First := M.P_First.Next; 
 end if; 
 -- Liberar si no hay Garbage Collector 
 P_Current:=null; 
 else 
 P_Previous := P_Current; 
 P_Current := P_Current.Next; 
 end if; 
 end loop; 
 end Delete; 
P_Previous	
  
1 
M.Length 
True 
Success 
M.P_First	
  
P_Current	
  
Maps.Delete(A_Map, ASU.To_Unbounded_String(“www.urjc.es"), Success); 
7 
GSyC - 2019 Tablas de Śımbolos 163
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
“facebook.com"	
  
“69.63.189.11”	
  
procedure Delete (M : in out Map; 
 Key : in Asu.Unbounded_String; 
 Success: out Boolean) is 
 P_Current : Cell_A; 
 P_Previous : Cell_A; 
 begin 
 Success := False; 
 P_Previous := null; 
 P_Current := M.P_First; 
 while not Success and P_Current /= null loop 
 if P_Current.Key = Key then 
 Success := True; 
 M.Length := M.Length - 1; 
 if P_Previous /= null then 
 P_Previous.Next := P_Current.Next; 
 end if; 
 if M.P_First = P_Current then 
 M.P_First := M.P_First.Next; 
 end if; 
 -- Liberar si no hay Garbage Collector 
 P_Current:=null; 
 else 
 P_Previous := P_Current; 
 P_Current := P_Current.Next; 
 end if; 
 end loop; 
 end Delete; 
P_Previous	
  
1 
M.Length 
True 
Success 
M.P_First	
  
P_Current	
  
Maps.Delete(A_Map, ASU.To_Unbounded_String(“www.urjc.es"), Success); 
7 
GSyC - 2019 Tablas de Śımbolos 164
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
“facebook.com"	
  
“69.63.189.11”	
  
procedure Delete (M : in out Map; 
 Key : in Asu.Unbounded_String; 
 Success: out Boolean) is 
 P_Current : Cell_A; 
 P_Previous : Cell_A; 
 begin 
 Success := False; 
 P_Previous := null; 
 P_Current := M.P_First; 
 while not Success and P_Current /= null loop 
 if P_Current.Key = Key then 
 Success := True; 
 M.Length := M.Length - 1; 
 if P_Previous /= null then 
 P_Previous.Next := P_Current.Next; 
 end if; 
 if M.P_First = P_Current then 
 M.P_First := M.P_First.Next; 
 end if; 
 -- Liberar si no hay Garbage Collector 
 P_Current:=null; 
 else 
 P_Previous := P_Current; 
 P_Current := P_Current.Next; 
 end if; 
 end loop; 
 end Delete; 
P_Previous	
  
1 
M.Length 
True 
Success 
M.P_First	
  
P_Current	
  
Maps.Delete(A_Map, ASU.To_Unbounded_String(“www.urjc.es"), Success); 
7 
GSyC - 2019 Tablas de Śımbolos 165
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
“facebook.com"	
  
“69.63.189.11”	
  
procedure Delete (M : in out Map; 
 Key : in Asu.Unbounded_String; 
 Success: out Boolean) is 
 P_Current : Cell_A; 
 P_Previous : Cell_A; 
 begin 
 Success := False; 
 P_Previous := null; 
 P_Current := M.P_First; 
 while not Success and P_Current /= null loop 
 if P_Current.Key = Key then 
 Success := True; 
 M.Length := M.Length - 1; 
 if P_Previous /= null then 
 P_Previous.Next := P_Current.Next; 
 end if; 
 if M.P_First = P_Current then 
 M.P_First := M.P_First.Next; 
 end if; 
 -- Liberar si no hay Garbage Collector 
 P_Current:=null; 
 else 
 P_Previous := P_Current; 
 P_Current := P_Current.Next; 
 end if; 
 end loop; 
 end Delete; 
P_Previous	
  
1 
M.Length 
True 
Success 
M.P_First	
  
P_Current	
  
Maps.Delete(A_Map, ASU.To_Unbounded_String(“www.urjc.es"), Success); 
7 
GSyC - 2019 Tablas de Śımbolos 166
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
“facebook.com"	
  
“69.63.189.11”	
  
procedure Delete (M : in out Map; 
 Key : in Asu.Unbounded_String; 
 Success: out Boolean) is 
 P_Current : Cell_A; 
 P_Previous : Cell_A; 
 begin 
 Success := False; 
 P_Previous := null; 
 P_Current := M.P_First; 
 while not Success and P_Current /= null loop 
 if P_Current.Key = Key then 
 Success := True; 
 M.Length := M.Length - 1; 
 if P_Previous /= null then 
 P_Previous.Next := P_Current.Next; 
 end if; 
 if M.P_First = P_Current then 
 M.P_First := M.P_First.Next; 
 end if; 
 -- Liberar si no hay Garbage Collector 
 P_Current:=null; 
 else 
 P_Previous := P_Current; 
 P_Current := P_Current.Next; 
 end if; 
 end loop; 
 end Delete; 
P_Previous	
  
1 
M.Length 
True 
Success 
M.P_First	
  
P_Current	
  
Maps.Delete(A_Map, ASU.To_Unbounded_String(“www.urjc.es"), Success); 
7 
GSyC - 2019 Tablas de Śımbolos 167
Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
“facebook.com"	
  
“69.63.189.11”	
  
procedure Delete (M : in out Map; 
 Key : in Asu.Unbounded_String; 
 Success: out Boolean) is 
 P_Current : Cell_A; 
 P_Previous : Cell_A; 
 begin 
 Success := False; 
 P_Previous := null; 
 P_Current := M.P_First; 
 while not Success and P_Current /= null loop 
 if P_Current.Key = Key then 
 Success := True; 
 M.Length := M.Length - 1; 
 if P_Previous /= null then 
 P_Previous.Next := P_Current.Next; 
 end if; 
 if M.P_First = P_Current then 
 M.P_First := M.P_First.Next; 
 end if; 
 -- Liberar si no hay Garbage Collector 
 P_Current:=null; 
 else 
 P_Previous := P_Current; 
 P_Current := P_Current.Next; 
 end if; 
 end loop; 
 end Delete; 
P_Previous	
  
1 
M.Length 
True 
Success 
M.P_First	
  
P_Current	
  
Maps.Delete(A_Map, ASU.To_Unbounded_String(“www.urjc.es"), Success); 
7 
GSyC - 2019 Tablas de Śımbolos 168
Iteración sobre todos los elementos de una colección
Contenidos
1 Tablas de Śımbolos
2 Implementación de TS mediante un array no ordenado
3 Implementación de TS mediante una lista enlazada no ordenada
4 Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
5 Iteración sobre todos los elementos de una colección
6 Implementación de TS mediante un Array ordenado
7 Implementación de TS mediante una lista enlazada ordenada
8 Implementación de TS mediante un árbol de búsqueda binaria (ABB)
9 Ejemplo de ejecución: Get en un ABB
10 Ejemplo de ejecución: Put en un ABB vaćıo
11 Ejemplo de ejecución: Put en un ABB
12 Borrado de un nodo en un ABB
GSyC - 2019 Tablas de Śımbolos 169
Iteración sobre todos los elementos de una colección
Especificación de iteradores para la tabla de śımbolos
with Ada.Strings.Unbounded;
package Maps is
...
--
-- Cursor Interface for iterating over Map elements
--
type Cursor is limited private;
function First (M: Map) return Cursor;
procedure Next (C: in out Cursor);
function Has_Element (C: Cursor) return Boolean;
type Element_Type is record
Key: ASU.Unbounded_String;
Value: ASU.Unbounded_String;
end record;
No_Element: exception;
-- Raises No_Element if Has_Element(C) = False;
function Element (C: Cursor) return Element_Type;
private
... // Suponiendo una implementación mediante lista enlazada
type Cursor is record
M : Map;
Element_A : Cell_A;
end record;
end Maps;GSyC - 2019 Tablas de Śımbolos170
Iteración sobre todos los elementos de una colección
Ejemplo de uso del iterador
with Maps;
procedure Map_Test is
procedure Print_Map (M : Maps.Map) is
C: Maps.Cursor
begin
Ada.Text_IO.Put_Line ("Map");
Ada.Text_IO.Put_Line ("===");
C := Maps.First(M);
while Maps.Has_Element(C) loop
Ada.Text_IO.Put_Line (ASU.To_String(Maps.Element(C).Key) &
" " &
ASU.To_String(Maps.Element(C).Value));
Maps.Next(C);
end loop;
end Print_Map;
...
begin
...
end Map_Test;
GSyC - 2019 Tablas de Śımbolos 171
Implementación de TS mediante un Array ordenado
Contenidos
1 Tablas de Śımbolos
2 Implementación de TS mediante un array no ordenado
3 Implementación de TS mediante una lista enlazada no ordenada
4 Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
5 Iteración sobre todos los elementos de una colección
6 Implementación de TS mediante un Array ordenado
7 Implementación de TS mediante una lista enlazada ordenada
8 Implementación de TS mediante un árbol de búsqueda binaria (ABB)
9 Ejemplo de ejecución: Get en un ABB
10 Ejemplo de ejecución: Put en un ABB vaćıo
11 Ejemplo de ejecución: Put en un ABB
12 Borrado de un nodo en un ABB
GSyC - 2019 Tablas de Śımbolos 172
Implementación de TS mediante un Array ordenado
Tabla de śımbolos implementada mediante un Array
ordenado
Se utiliza también un Array, por lo que tenemos un tamaño
máximo fijado de antemano
Los elementos de la tabla se mantienen ordenados y contiguos
en el array
La ventaja ahora es que la búsqueda de un elemento NO
requiere recorrer todos los elementos del Array hasta encontrar
el que se busca. En su lugar, se realiza una búsqueda binaria.
La inserción de un nuevo elemento se realiza usando la
búsqueda binaria para encontrar la posición que le
corresponde al elemento que se inserta
Si la clave del elemento a insertar no está ya en el Array, hay
que mover todos los elementos que le suceden una posición
hacia adelante para hacer hueco para el que se inserta
Esta operación es costosa porque implica no sólo recorrer
todos los elementos mayores sino también copiar cada uno de
ellos.
GSyC - 2019 Tablas de Śımbolos 173
Implementación de TS mediante un Array ordenado
Búsqueda binaria en un Array ordenado
La búsqueda binaria es menos costosa que la búsqueda lineal
en un Array ordenado ya que, comparado con la
implementación que usa un Array no ordenado, requiere
menos accesos al Array para localizar el elemento
Se compara el elemento a buscar con el elemento que está en
el medio del Array:
si es menor, se busca con el mismo procedimiento en el
subArray a la izquierda
en caso contrario, se busca en el subArray a la derecha
GSyC - 2019 Tablas de Śımbolos 174
Implementación de TS mediante una lista enlazada ordenada
Contenidos
1 Tablas de Śımbolos
2 Implementación de TS mediante un array no ordenado
3 Implementación de TS mediante una lista enlazada no ordenada
4 Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
5 Iteración sobre todos los elementos de una colección
6 Implementación de TS mediante un Array ordenado
7 Implementación de TS mediante una lista enlazada ordenada
8 Implementación de TS mediante un árbol de búsqueda binaria (ABB)
9 Ejemplo de ejecución: Get en un ABB
10 Ejemplo de ejecución: Put en un ABB vaćıo
11 Ejemplo de ejecución: Put en un ABB
12 Borrado de un nodo en un ABB
GSyC - 2019 Tablas de Śımbolos 175
Implementación de TS mediante una lista enlazada ordenada
Implementación de TS mediante una lista enlazada
ordenada
Al igual que con un Array ordenado, mantenemos ordenados
los elementos según su clave
Ventaja: la operación de inserción no requiere mover los
elementos que le suceden
Inconveniente: la operación de búsqueda sin embargo no se
puede implementar tan eficientemente como en el Array
ordenado: no podemos ir al elemento que está en la mitad de
la lista por lo que la búsqueda ha de ser lineal y no binaria
GSyC - 2019 Tablas de Śımbolos 176
Implementación de TS mediante un árbol de búsqueda binaria
(ABB)
Contenidos
1 Tablas de Śımbolos
2 Implementación de TS mediante un array no ordenado
3 Implementación de TS mediante una lista enlazada no ordenada
4 Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
5 Iteración sobre todos los elementos de una colección
6 Implementación de TS mediante un Array ordenado
7 Implementación de TS mediante una lista enlazada ordenada
8 Implementación de TS mediante un árbol de búsqueda binaria (ABB)
9 Ejemplo de ejecución: Get en un ABB
10 Ejemplo de ejecución: Put en un ABB vaćıo
11 Ejemplo de ejecución: Put en un ABB
12 Borrado de un nodo en un ABB
GSyC - 2019 Tablas de Śımbolos 177
Implementación de TS mediante un árbol de búsqueda binaria
(ABB)
Tabla de śımbolos implementada mediante un ABB
En lugar de utilizar un Array o una Lista enlazada utilizaremos
ahora un árbol de búsqueda binaria (ABB) para implementar
la misma estructura de datos: una tabla de śımbolos
Recordatorio:
La tabla de śımbolos es una estructura de datos que almacena
elementos compuestos por parejas (Clave, Valor)
Clave y Valor pueden ser tipos de datos cualesquiera
Tiene tres operaciones básicas:
Put: Dado un nuevo elemento (Clave, Valor) como
parámetro, se añade éste a la tabla. Si ya exist́ıa un elemento
con la misma Clave, se sustituye su Valor asociado por el
especificado en la llamada a Put
Get: Dada una Clave como parámetro, devuelve el Valor
asociado a la misma en la tabla en caso de que exista un
elemento (Clave, Valor)
Delete: Dada un Clave como parámetro, se borra de la tabla,
si existe, el elemento (Clave, Valor)
GSyC - 2019 Tablas de Śımbolos 178
Implementación de TS mediante un árbol de búsqueda binaria
(ABB)
Especificación de la tabla de śımbolos
La especificación no cambia, salvo por la parte privada:
with Ada.Strings.Unbounded;
package Maps is
package ASU renames Ada.Strings.Unbounded;
type Map is limited private;
procedure Get (M : Map;
Key : in ASU.Unbounded_String;
Value : out ASU.Unbounded_String;
Success : out Boolean);
...
private
type Tree_Node;
type Map is access Tree_Node;
type Tree_Node is record
Key : ASU.Unbounded_String := ASU.Null_Unbounded_String;
Value : ASU.Unbounded_String := ASU.Null_Unbounded_String;
Left : Map;
Right : Map;
end record;
end Maps;
GSyC - 2019 Tablas de Śımbolos 179
Implementación de TS mediante un árbol de búsqueda binaria
(ABB)
Árbol de búsqueda binaria (ABB)
Principal caracteŕıstica de un ABB
La información que está almacenada en el árbol está ordenada
Gracias a ello la búsqueda de un elemento en la tabla
implementada con un ABB a partir de su clave NO requiere
recorrer todos los nodos: búsqueda binaria
Cada nodo de un árbol de búsqueda binaria almacena una
clave con su valor asociado: (Key, Value)
Los nodos del árbol están ordenados por su clave ⇒
las claves tienen que ser de tipos que tengan definidos los
operadores de comparación <,>,=, / =
El valor de cada nodo puede ser de cualquier tipo
Incluyendo tipos compuestos (arrays, listas,...)
GSyC - 2019 Tablas de Śımbolos 180
Implementación de TS mediante un árbol de búsqueda binaria
(ABB)
Definición recursiva del árbol de búsqueda binaria (ABB)
Un árbol de búsqueda binaria (ABB):
o está vaćıo
o está formado por:
Una pareja (Key, Value)
Un ABB izquierdo con claves menores que Key (subárbol
izquierdo)
Un ABB derecho con claves mayores que Key (subárbol
derecho)
GSyC - 2019 Tablas de Śımbolos 181
Implementación de TS mediante un árbol de búsqueda binaria
(ABB)
Definición recursiva del ABB: ejemplo
	
  bbva.es	
  
195.76.187.83”	
  
nbc.com	
  
66.77.124.26	
  
facebook.com	
  
69.63.181.12	
  
yelp.com	
  
”	
  63.251.52.110	
  
viacom.com	
  
206.220.43.92	
  
zappos.com	
  
66.209.92.150	
  
google.com	
  
69.63.189.16	
  
cbs.com	
  
198.99.118.37	
  
ucla.edu	
  
169.232.55.22
4xing.com	
  
213.238.60.19
0	
  
edi.com	
  
192.86.2.98	
  
wings.com	
  
12.155.29.35	
  
Key	
  
”	
  Value	
  
LeF	
   Right	
  
GSyC - 2019 Tablas de Śımbolos 182
Implementación de TS mediante un árbol de búsqueda binaria
(ABB)
Definición recursiva del árbol de búsqueda binaria (ABB):
código
type Tree_Node;
type Map is access Tree_Node;
type Tree_Node is record
Key : ASU.Unbounded_String := ASU.Null_Unbounded_String;
Value : ASU.Unbounded_String := ASU.Null_Unbounded_String;
Left : Map;
Right : Map;
end record;
GSyC - 2019 Tablas de Śımbolos 183
Implementación de TS mediante un árbol de búsqueda binaria
(ABB)
Definición recursiva del árbol de búsqueda binaria (ABB)
Para identificar el árbol utilizamos la dirección en la que está
su nodo ráız
Llamamos subárbol izquierdo de un nodo i al árbol cuya ráız
está apuntada por i .Left
Llamamos subárbol derecho de un nodo i al árbol cuya ráız
está apuntada por i .Right
Un nodo j es hijo de un nodo padre i si j es la ráız de uno de
los dos subárboles de i
La definición recursiva del árbol permite definir operaciones
recursivas de manera elegante.
También una lista enlazada se puede definir recursivamente (o
vaćıa, o formada por un primer nodo y una lista con el resto de
los elementos)
Se pueden también definir las operaciones de la lista enlazada
recursivamente
GSyC - 2019 Tablas de Śımbolos 184
Implementación de TS mediante un árbol de búsqueda binaria
(ABB)
Búsqueda de un nodo
Para buscar un nodo con determinada clave Key en un árbol del
que conocemos su nodo ráız (Root):
Si el árbol está vaćıo ⇒ no existe el elemento
Si el árbol no está vació ⇒
Si Key = Root.Key ⇒ el nodo ráız es el nodo buscado
Si Key < Root.Key ⇒ buscar el nodo en el subárbol izquierdo
Si Key > Root.Key ⇒ buscar el nodo en el subárbol derecho
GSyC - 2019 Tablas de Śımbolos 185
Implementación de TS mediante un árbol de búsqueda binaria
(ABB)
Búsqueda de un nodo: código
En el primer parámetro, M, se le pasa al procedimiento Get un puntero al
nodo ráız del árbol:
procedure Get (M : Map;
Key : in ASU.Unbounded_String;
Value : out ASU.Unbounded_String;
Success : out Boolean) is
begin
Value := ASU.Null_Unbounded_String;
If M = null then
Success := False;
elsif M.Key = Key then
Value := M.Value;
Success := True;
elsif Key > M.Key then
Get (M.Right, Key, Value, Success);
else
Get (M.Left, Key, Value, Success);
end if;
end Get;
GSyC - 2019 Tablas de Śımbolos 186
Ejemplo de ejecución: Get en un ABB
Contenidos
1 Tablas de Śımbolos
2 Implementación de TS mediante un array no ordenado
3 Implementación de TS mediante una lista enlazada no ordenada
4 Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
5 Iteración sobre todos los elementos de una colección
6 Implementación de TS mediante un Array ordenado
7 Implementación de TS mediante una lista enlazada ordenada
8 Implementación de TS mediante un árbol de búsqueda binaria (ABB)
9 Ejemplo de ejecución: Get en un ABB
10 Ejemplo de ejecución: Put en un ABB vaćıo
11 Ejemplo de ejecución: Put en un ABB
12 Borrado de un nodo en un ABB
GSyC - 2019 Tablas de Śımbolos 187
Ejemplo de ejecución: Get en un ABB
	
  bbva.es	
  
195.76.187.83”	
  
nbc.com	
  
66.77.124.26	
  
facebook.com	
  
69.63.181.12	
  
yelp.com	
  
”	
  63.251.52.110	
  
viacom.com	
  
206.220.43.92	
  
zappos.com	
  
66.209.92.150	
  
google.com	
  
69.63.189.16	
  
cbs.com	
  
198.99.118.37	
  
ucla.edu	
  
169.232.55.22
4	
  
xing.com	
  
213.238.60.19
0	
  
edi.com	
  
192.86.2.98	
  
wings.com	
  
12.155.29.35	
  
A_Map 
GSyC - 2019 Tablas de Śımbolos 188
Ejemplo de ejecución: Get en un ABB
	
  bbva.es	
  
195.76.187.83”	
  
nbc.com	
  
66.77.124.26	
  
facebook.com	
  
69.63.181.12	
  
yelp.com	
  
”	
  63.251.52.110	
  
viacom.com	
  
206.220.43.92	
  
zappos.com	
  
66.209.92.150	
  
google.com	
  
69.63.189.16	
  
cbs.com	
  
198.99.118.37	
  
ucla.edu	
  
169.232.55.22
4	
  
xing.com	
  
213.238.60.19
0	
  
edi.com	
  
192.86.2.98	
  
wings.com	
  
12.155.29.35	
  
A_Map 
Get (A_Map,	
 ASU.To_Unbounded_String (“google.com”),	
 Value,	
 Success);	
Value Success 
?	
  ?	
  
GSyC - 2019 Tablas de Śımbolos 189
Ejemplo de ejecución: Get en un ABB
Get (A_Map,	
 ASU.To_Unbounded_String (“google.com”),	
 Value,	
 Success);	
	
  bbva.es	
  
195.76.187.83”	
  
nbc.com	
  
66.77.124.26	
  
facebook.com	
  
69.63.181.12	
  
yelp.com	
  
”	
  63.251.52.110	
  
viacom.com	
  
206.220.43.92	
  
zappos.com	
  
66.209.92.150	
  
google.com	
  
69.63.189.16	
  
cbs.com	
  
198.99.118.37	
  
ucla.edu	
  
169.232.55.22
4	
  
xing.com	
  
213.238.60.19
0	
  
edi.com	
  
192.86.2.98	
  
wings.com	
  
12.155.29.35	
  
A_Map 
procedure Get (M : Map;	
 Key : in ASU.Unbounded_String;	
 Value : out ASU.Unbounded_String;	
 Success : out Boolean) is	
begin	
 Value := ASU.Null_Unbounded_String;	
 if M = null then	
 Success := False;	
 elsif M.Key = Key then	
 Value := M.Value;	
 Success := True;	
 elsif Key > M.Key then	
 Get (M.Right, Key, Value, Success);	
 else	
 Get (M.Left, Key, Value, Success);	
 end if;	
end Get;	
Key Value Success 
google.com	
   ?	
  ?	
  
M 
GSyC - 2019 Tablas de Śımbolos 190
Ejemplo de ejecución: Get en un ABB
Get (A_Map,	
 ASU.To_Unbounded_String (“google.com”),	
 Value,	
 Success);	
	
  bbva.es	
  
195.76.187.83”	
  
nbc.com	
  
66.77.124.26	
  
facebook.com	
  
69.63.181.12	
  
yelp.com	
  
”	
  63.251.52.110	
  
viacom.com	
  
206.220.43.92	
  
zappos.com	
  
66.209.92.150	
  
google.com	
  
69.63.189.16	
  
cbs.com	
  
198.99.118.37	
  
ucla.edu	
  
169.232.55.22
4	
  
xing.com	
  
213.238.60.19
0	
  
edi.com	
  
192.86.2.98	
  
wings.com	
  
12.155.29.35	
  
A_Map A_Map 
procedure Get (M : Map;	
 Key : in ASU.Unbounded_String;	
 Value : out ASU.Unbounded_String;	
 Success : out Boolean) is	
begin	
 Value := ASU.Null_Unbounded_String;	
 if M = null then	
 Success := False;	
 elsif M.Key = Key then	
 Value := M.Value;	
 Success := True;	
 elsif Key > M.Key then	
 Get (M.Right, Key, Value, Success);	
 else	
 Get (M.Left, Key, Value, Success);	
 end if;	
end Get;	
Key Value Success 
google.com	
   ?	
  
M 
Null_..String	
  
GSyC - 2019 Tablas de Śımbolos 191
Ejemplo de ejecución: Get en un ABB
Get (A_Map,	
 ASU.To_Unbounded_String (“google.com”),	
 Value,	
 Success);	
	
  bbva.es	
  
195.76.187.83”	
  
nbc.com	
  
66.77.124.26	
  
facebook.com	
  
69.63.181.12	
  
yelp.com	
  
”	
  63.251.52.110	
  
viacom.com	
  
206.220.43.92	
  
zappos.com	
  
66.209.92.150	
  
google.com	
  
69.63.189.16	
  
cbs.com	
  
198.99.118.37	
  
ucla.edu	
  
169.232.55.22
4	
  
xing.com	
  
213.238.60.19
0	
  
edi.com	
  
192.86.2.98	
  
wings.com	
  
12.155.29.35	
  
A_Map A_Map 
procedure Get (M : Map;	
 Key : in ASU.Unbounded_String;	
 Value : out ASU.Unbounded_String;	
 Success : out Boolean) is	
begin	
 Value := ASU.Null_Unbounded_String;	
 if M = null then	
 Success := False;	
 elsif M.Key = Key then	
 Value := M.Value;	
 Success := True;	
 elsif Key > M.Key then	
 Get (M.Right, Key, Value, Success);	
 else	
 Get (M.Left, Key, Value, Success);	
 end if;	
end Get;	
Key Value Success 
google.com	
   ?	
  
M 
Null_..String	
  
GSyC - 2019 Tablas de Śımbolos 192
Ejemplo de ejecución: Get en un ABB
Get (A_Map,	
 ASU.To_Unbounded_String (“google.com”),	
 Value,	
 Success);	
	
  bbva.es	
  
195.76.187.83”	
  
nbc.com	
  
66.77.124.26	
  
facebook.com	
  
69.63.181.12	
  
yelp.com	
  
”	
  63.251.52.110	
  
viacom.com206.220.43.92	
  
zappos.com	
  
66.209.92.150	
  
google.com	
  
69.63.189.16	
  
cbs.com	
  
198.99.118.37	
  
ucla.edu	
  
169.232.55.22
4	
  
xing.com	
  
213.238.60.19
0	
  
edi.com	
  
192.86.2.98	
  
wings.com	
  
12.155.29.35	
  
A_Map A_Map 
M 
procedure Get (M : Map;	
 Key : in ASU.Unbounded_String;	
 Value : out ASU.Unbounded_String;	
 Success : out Boolean) is	
begin	
 Value := ASU.Null_Unbounded_String;	
 if M = null then	
 Success := False;	
 elsif M.Key = Key then	
 Value := M.Value;	
 Success := True;	
 elsif Key > M.Key then	
 Get (M.Right, Key, Value, Success);	
 else	
 Get (M.Left, Key, Value, Success);	
 end if;	
end Get;	
Key Value Success 
google.com	
   ?	
  
M 
Null_..String	
  
GSyC - 2019 Tablas de Śımbolos 193
Ejemplo de ejecución: Get en un ABB
Get (A_Map,	
 ASU.To_Unbounded_String (“google.com”),	
 Value,	
 Success);	
	
  bbva.es	
  
195.76.187.83”	
  
nbc.com	
  
66.77.124.26	
  
facebook.com	
  
69.63.181.12	
  
yelp.com	
  
”	
  63.251.52.110	
  
viacom.com	
  
206.220.43.92	
  
zappos.com	
  
66.209.92.150	
  
google.com	
  
69.63.189.16	
  
cbs.com	
  
198.99.118.37	
  
ucla.edu	
  
169.232.55.22
4	
  
xing.com	
  
213.238.60.19
0	
  
edi.com	
  
192.86.2.98	
  
wings.com	
  
12.155.29.35	
  
A_Map A_Map 
procedure Get (M : Map;	
 Key : in ASU.Unbounded_String;	
 Value : out ASU.Unbounded_String;	
 Success : out Boolean) is	
begin	
 Value := ASU.Null_Unbounded_String;	
 if M = null then	
 Success := False;	
 elsif M.Key = Key then	
 Value := M.Value;	
 Success := True;	
 elsif Key > M.Key then	
 Get (M.Right, Key, Value, Success);	
 else	
 Get (M.Left, Key, Value, Success);	
 end if;	
end Get;	
Key Value Success 
google.com	
   ?	
  
M 
Null_..String	
  
GSyC - 2019 Tablas de Śımbolos 194
Ejemplo de ejecución: Get en un ABB
Get (A_Map,	
 ASU.To_Unbounded_String (“google.com”),	
 Value,	
 Success);	
	
  bbva.es	
  
195.76.187.83”	
  
nbc.com	
  
66.77.124.26	
  
facebook.com	
  
69.63.181.12	
  
yelp.com	
  
”	
  63.251.52.110	
  
viacom.com	
  
206.220.43.92	
  
zappos.com	
  
66.209.92.150	
  
google.com	
  
69.63.189.16	
  
cbs.com	
  
198.99.118.37	
  
ucla.edu	
  
169.232.55.22
4	
  
xing.com	
  
213.238.60.19
0	
  
edi.com	
  
192.86.2.98	
  
wings.com	
  
12.155.29.35	
  
A_Map A_Map 
procedure Get (M : Map;	
 Key : in ASU.Unbounded_String;	
 Value : out ASU.Unbounded_String;	
 Success : out Boolean) is	
begin	
 Value := ASU.Null_Unbounded_String;	
 if M = null then	
 Success := False;	
 elsif M.Key = Key then	
 Value := M.Value;	
 Success := True;	
 elsif Key > M.Key then	
 Get (M.Right, Key, Value, Success);	
 else	
 Get (M.Left, Key, Value, Success);	
 end if;	
end Get;	
Key Value Success 
google.com	
   ?	
  
M 
Null_..String	
  
GSyC - 2019 Tablas de Śımbolos 195
Ejemplo de ejecución: Get en un ABB
Get (A_Map,	
 ASU.To_Unbounded_String (“google.com”),	
 Value,	
 Success);	
	
  bbva.es	
  
195.76.187.83”	
  
nbc.com	
  
66.77.124.26	
  
facebook.com	
  
69.63.181.12	
  
yelp.com	
  
”	
  63.251.52.110	
  
viacom.com	
  
206.220.43.92	
  
zappos.com	
  
66.209.92.150	
  
google.com	
  
69.63.189.16	
  
cbs.com	
  
198.99.118.37	
  
ucla.edu	
  
169.232.55.22
4	
  
xing.com	
  
213.238.60.19
0	
  
edi.com	
  
192.86.2.98	
  
wings.com	
  
12.155.29.35	
  
A_Map A_Map 
procedure Get (M : Map;	
 Key : in ASU.Unbounded_String;	
 Value : out ASU.Unbounded_String;	
 Success : out Boolean) is	
begin	
 Value := ASU.Null_Unbounded_String;	
 if M = null then	
 Success := False;	
 elsif M.Key = Key then	
 Value := M.Value;	
 Success := True;	
 elsif Key > M.Key then	
 Get (M.Right, Key, Value, Success);	
 else	
 Get (M.Left, Key, Value, Success);	
 end if;	
end Get;	
Key Value Success 
google.com	
   ?	
  ?	
  
procedure Get (M : Map;	
 Key : in ASU.Unbounded_String;	
 Value : out ASU.Unbounded_String;	
 Success : out Boolean) is	
begin	
 Value := ASU.Null_Unbounded_String;	
 if M = null then	
 Success := False;	
 elsif M.Key = Key then	
 Value := M.Value;	
 Success := True;	
 elsif Key > M.Key then	
 Get (M.Right, Key, Value, Success);	
 else	
 Get (M.Left, Key, Value, Success);	
 end if;	
end Get;	
Key	 Value	 Success	
google.com	
   ?	
   ?	
  
M	
GSyC - 2019 Tablas de Śımbolos 196
Ejemplo de ejecución: Get en un ABB
Get (A_Map,	
 ASU.To_Unbounded_String (“google.com”),	
 Value,	
 Success);	
	
  bbva.es	
  
195.76.187.83”	
  
nbc.com	
  
66.77.124.26	
  
facebook.com	
  
69.63.181.12	
  
yelp.com	
  
”	
  63.251.52.110	
  
viacom.com	
  
206.220.43.92	
  
zappos.com	
  
66.209.92.150	
  
google.com	
  
69.63.189.16	
  
cbs.com	
  
198.99.118.37	
  
ucla.edu	
  
169.232.55.22
4	
  
xing.com	
  
213.238.60.19
0	
  
edi.com	
  
192.86.2.98	
  
wings.com	
  
12.155.29.35	
  
A_Map A_Map 
procedure Get (M : Map;	
 Key : in ASU.Unbounded_String;	
 Value : out ASU.Unbounded_String;	
 Success : out Boolean) is	
begin	
 Value := ASU.Null_Unbounded_String;	
 if M = null then	
 Success := False;	
 elsif M.Key = Key then	
 Value := M.Value;	
 Success := True;	
 elsif Key > M.Key then	
 Get (M.Right, Key, Value, Success);	
 else	
 Get (M.Left, Key, Value, Success);	
 end if;	
end Get;	
Key Value Success 
google.com	
   ?	
  ?	
  
procedure Get (M : Map;	
 Key : in ASU.Unbounded_String;	
 Value : out ASU.Unbounded_String;	
 Success : out Boolean) is	
begin	
 Value := ASU.Null_Unbounded_String;	
 if M = null then	
 Success := False;	
 elsif M.Key = Key then	
 Value := M.Value;	
 Success := True;	
 elsif Key > M.Key then	
 Get (M.Right, Key, Value, Success);	
 else	
 Get (M.Left, Key, Value, Success);	
 end if;	
end Get;	
Key Value Success 
google.com	
   ?	
  
M 
Null_..String	
  
GSyC - 2019 Tablas de Śımbolos 197
Ejemplo de ejecución: Get en un ABB
Get (A_Map,	
 ASU.To_Unbounded_String (“google.com”),	
 Value,	
 Success);	
	
  bbva.es	
  
195.76.187.83”	
  
nbc.com	
  
66.77.124.26	
  
facebook.com	
  
69.63.181.12	
  
yelp.com	
  
”	
  63.251.52.110	
  
viacom.com	
  
206.220.43.92	
  
zappos.com	
  
66.209.92.150	
  
google.com	
  
69.63.189.16	
  
cbs.com	
  
198.99.118.37	
  
ucla.edu	
  
169.232.55.22
4	
  
xing.com	
  
213.238.60.19
0	
  
edi.com	
  
192.86.2.98	
  
wings.com	
  
12.155.29.35	
  
A_Map A_Map 
procedure Get (M : Map;	
 Key : in ASU.Unbounded_String;	
 Value : out ASU.Unbounded_String;	
 Success : out Boolean) is	
begin	
 Value := ASU.Null_Unbounded_String;	
 if M = null then	
 Success := False;	
 elsif M.Key = Key then	
 Value := M.Value;	
 Success := True;	
 elsif Key > M.Key then	
 Get (M.Right, Key, Value, Success);	
 else	
 Get (M.Left, Key, Value, Success);	
 end if;	
end Get;	
Key Value Success 
google.com	
   ?	
  ?	
  
procedure Get (M : Map;	
 Key : in ASU.Unbounded_String;	
 Value : out ASU.Unbounded_String;	
 Success : out Boolean) is	
begin	
 Value := ASU.Null_Unbounded_String;	
 if M = null then	
 Success := False;	
 elsif M.Key = Key then	
 Value := M.Value;	
 Success := True;	
 elsif Key > M.Key then	
 Get (M.Right, Key, Value, Success);	
 else	
 Get (M.Left,Key, Value, Success);	
 end if;	
end Get;	
Key Value Success 
google.com	
   ?	
  
M 
Null_..String	
  
GSyC - 2019 Tablas de Śımbolos 198
Ejemplo de ejecución: Get en un ABB
Get (A_Map,	
 ASU.To_Unbounded_String (“google.com”),	
 Value,	
 Success);	
	
  bbva.es	
  
195.76.187.83”	
  
nbc.com	
  
66.77.124.26	
  
facebook.com	
  
69.63.181.12	
  
yelp.com	
  
”	
  63.251.52.110	
  
viacom.com	
  
206.220.43.92	
  
zappos.com	
  
66.209.92.150	
  
google.com	
  
69.63.189.16	
  
cbs.com	
  
198.99.118.37	
  
ucla.edu	
  
169.232.55.22
4	
  
xing.com	
  
213.238.60.19
0	
  
edi.com	
  
192.86.2.98	
  
wings.com	
  
12.155.29.35	
  
A_Map A_Map 
procedure Get (M : Map;	
 Key : in ASU.Unbounded_String;	
 Value : out ASU.Unbounded_String;	
 Success : out Boolean) is	
begin	
 Value := ASU.Null_Unbounded_String;	
 if M = null then	
 Success := False;	
 elsif M.Key = Key then	
 Value := M.Value;	
 Success := True;	
 elsif Key > M.Key then	
 Get (M.Right, Key, Value, Success);	
 else	
 Get (M.Left, Key, Value, Success);	
 end if;	
end Get;	
Key Value Success 
google.com	
   ?	
  ?	
  
procedure Get (M : Map;	
 Key : in ASU.Unbounded_String;	
 Value : out ASU.Unbounded_String;	
 Success : out Boolean) is	
begin	
 Value := ASU.Null_Unbounded_String;	
 if M = null then	
 Success := False;	
 elsif M.Key = Key then	
 Value := M.Value;	
 Success := True;	
 elsif Key > M.Key then	
 Get (M.Right, Key, Value, Success);	
 else	
 Get (M.Left, Key, Value, Success);	
 end if;	
end Get;	
Key Success 
google.com	
   ?	
  
M Value 
Null_..String	
  
GSyC - 2019 Tablas de Śımbolos 199
Ejemplo de ejecución: Get en un ABB
Get (A_Map,	
 ASU.To_Unbounded_String (“google.com”),	
 Value,	
 Success);	
	
  bbva.es	
  
195.76.187.83”	
  
nbc.com	
  
66.77.124.26	
  
facebook.com	
  
69.63.181.12	
  
yelp.com	
  
”	
  63.251.52.110	
  
viacom.com	
  
206.220.43.92	
  
zappos.com	
  
66.209.92.150	
  
google.com	
  
69.63.189.16	
  
cbs.com	
  
198.99.118.37	
  
ucla.edu	
  
169.232.55.22
4	
  
xing.com	
  
213.238.60.19
0	
  
edi.com	
  
192.86.2.98	
  
wings.com	
  
12.155.29.35	
  
A_Map A_Map 
procedure Get (M : Map;	
 Key : in ASU.Unbounded_String;	
 Value : out ASU.Unbounded_String;	
 Success : out Boolean) is	
begin	
 Value := ASU.Null_Unbounded_String;	
 if M = null then	
 Success := False;	
 elsif M.Key = Key then	
 Value := M.Value;	
 Success := True;	
 elsif Key > M.Key then	
 Get (M.Right, Key, Value, Success);	
 else	
 Get (M.Left, Key, Value, Success);	
 end if;	
end Get;	
Key Value Success 
google.com	
   ?	
  ?	
  
procedure Get (M : Map;	
 Key : in ASU.Unbounded_String;	
 Value : out ASU.Unbounded_String;	
 Success : out Boolean) is	
begin	
 Value := ASU.Null_Unbounded_String;	
 if M = null then	
 Success := False;	
 elsif M.Key = Key then	
 Value := M.Value;	
 Success := True;	
 elsif Key > M.Key then	
 Get (M.Right, Key, Value, Success);	
 else	
 Get (M.Left, Key, Value, Success);	
 end if;	
end Get;	
Key Value Success 
google.com	
   Null_..String	
   ?	
  
M 
GSyC - 2019 Tablas de Śımbolos 200
Ejemplo de ejecución: Get en un ABB
Get (A_Map,	
 ASU.To_Unbounded_String (“google.com”),	
 Value,	
 Success);	
	
  bbva.es	
  
195.76.187.83”	
  
nbc.com	
  
66.77.124.26	
  
facebook.com	
  
69.63.181.12	
  
yelp.com	
  
”	
  63.251.52.110	
  
viacom.com	
  
206.220.43.92	
  
zappos.com	
  
66.209.92.150	
  
google.com	
  
69.63.189.16	
  
cbs.com	
  
198.99.118.37	
  
ucla.edu	
  
169.232.55.22
4	
  
xing.com	
  
213.238.60.19
0	
  
edi.com	
  
192.86.2.98	
  
wings.com	
  
12.155.29.35	
  
A_Map A_Map 
procedure Get (M : Map;	
 Key : in ASU.Unbounded_String;	
 Value : out ASU.Unbounded_String;	
 Success : out Boolean) is	
begin	
 Value := ASU.Null_Unbounded_String;	
 if M = null then	
 Success := False;	
 elsif M.Key = Key then	
 Value := M.Value;	
 Success := True;	
 elsif Key > M.Key then	
 Get (M.Right, Key, Value, Success);	
 else	
 Get (M.Left, Key, Value, Success);	
 end if;	
end Get;	
Key Value Success 
google.com	
   ?	
  ?	
  
procedure Get (M : Map;	
 Key : in ASU.Unbounded_String;	
 Value : out ASU.Unbounded_String;	
 Success : out Boolean) is	
begin	
 Value := ASU.Null_Unbounded_String;	
 if M = null then	
 Success := False;	
 elsif M.Key = Key then	
 Value := M.Value;	
 Success := True;	
 elsif Key > M.Key then	
 Get (M.Right, Key, Value, Success);	
 else	
 Get (M.Left, Key, Value, Success);	
 end if;	
end Get;	
Key Value Success 
google.com	
   ?	
  
M 
Null_..String	
  
GSyC - 2019 Tablas de Śımbolos 201
Ejemplo de ejecución: Get en un ABB
Get (A_Map,	
 ASU.To_Unbounded_String (“google.com”),	
 Value,	
 Success);	
	
  bbva.es	
  
195.76.187.83”	
  
nbc.com	
  
66.77.124.26	
  
facebook.com	
  
69.63.181.12	
  
yelp.com	
  
”	
  63.251.52.110	
  
viacom.com	
  
206.220.43.92	
  
zappos.com	
  
66.209.92.150	
  
google.com	
  
69.63.189.16	
  
cbs.com	
  
198.99.118.37	
  
ucla.edu	
  
169.232.55.22
4	
  
xing.com	
  
213.238.60.19
0	
  
edi.com	
  
192.86.2.98	
  
wings.com	
  
12.155.29.35	
  
A_Map A_Map 
procedure Get (M : Map;	
 Key : in ASU.Unbounded_String;	
 Value : out ASU.Unbounded_String;	
 Success : out Boolean) is	
begin	
 Value := ASU.Null_Unbounded_String;	
 if M = null then	
 Success := False;	
 elsif M.Key = Key then	
 Value := M.Value;	
 Success := True;	
 elsif Key > M.Key then	
 Get (M.Right, Key, Value, Success);	
 else	
 Get (M.Left, Key, Value, Success);	
 end if;	
end Get;	
Key Value Success 
google.com	
   ?	
  ?	
  
procedure Get (M : Map;	
 Key : in ASU.Unbounded_String;	
 Value : out ASU.Unbounded_String;	
 Success : out Boolean) is	
begin	
 Value := ASU.Null_Unbounded_String;	
 if M = null then	
 Success := False;	
 elsif M.Key = Key then	
 Value := M.Value;	
 Success := True;	
 elsif Key > M.Key then	
 Get (M.Right, Key, Value, Success);	
 else	
 Get (M.Left, Key, Value, Success);	
 end if;	
end Get;	
Key Value Success 
google.com	
   “”	
   ?	
  procedure Get (M : Map;	
 Key : in ASU.Unbounded_String;	
 Value : out ASU.Unbounded_String;	
 Success : out Boolean) is	
begin	
 Value := ASU.Null_Unbounded_String;	
 if M = null then	
 Success := False;	
 elsif M.Key = Key then	
 Value := M.Value;	
 Success := True;	
 elsif Key > M.Key then	
 Get (M.Right, Key, Value, Success);	
 else	
 Get (M.Left, Key, Value, Success);	
 end if;	
end Get;	
Key	 Value	 Success	
google.com	
   ?	
  ?	
  
M	
GSyC - 2019 Tablas de Śımbolos 202
Ejemplo de ejecución: Get en un ABB
Get (A_Map,	
 ASU.To_Unbounded_String (“google.com”),	
 Value,	
 Success);	
	
  bbva.es	
  
195.76.187.83”	
  
nbc.com	
  
66.77.124.26	
  
facebook.com	
  
69.63.181.12	
  
yelp.com	
  
”	
  63.251.52.110	
  
viacom.com	
  
206.220.43.92	
  
zappos.com	
  
66.209.92.150	
  
google.com	
  
69.63.189.16	
  
cbs.com	
  
198.99.118.37	
  
ucla.edu	
  
169.232.55.22
4	
  
xing.com	
  
213.238.60.19
0	
  
edi.com	
  
192.86.2.98	
  
wings.com	
  
12.155.29.35	
  
A_Map A_Map 
procedure Get (M : Map;	
 Key : in ASU.Unbounded_String;Value : out ASU.Unbounded_String;	
 Success : out Boolean) is	
begin	
 Value := ASU.Null_Unbounded_String;	
 if M = null then	
 Success := False;	
 elsif M.Key = Key then	
 Value := M.Value;	
 Success := True;	
 elsif Key > M.Key then	
 Get (M.Right, Key, Value, Success);	
 else	
 Get (M.Left, Key, Value, Success);	
 end if;	
end Get;	
Key Value Success 
google.com	
   ?	
  ?	
  
procedure Get (M : Map;	
 Key : in ASU.Unbounded_String;	
 Value : out ASU.Unbounded_String;	
 Success : out Boolean) is	
begin	
 Value := ASU.Null_Unbounded_String;	
 if M = null then	
 Success := False;	
 elsif M.Key = Key then	
 Value := M.Value;	
 Success := True;	
 elsif Key > M.Key then	
 Get (M.Right, Key, Value, Success);	
 else	
 Get (M.Left, Key, Value, Success);	
 end if;	
end Get;	
Key Value Success 
google.com	
   “”	
   ?	
  procedure Get (M : Map;	
 Key : in ASU.Unbounded_String;	
 Value : out ASU.Unbounded_String;	
 Success : out Boolean) is	
begin	
 Value := ASU.Null_Unbounded_String;	
 if M = null then	
 Success := False;	
 elsif M.Key = Key then	
 Value := M.Value;	
 Success := True;	
 elsif Key > M.Key then	
 Get (M.Right, Key, Value, Success);	
 else	
 Get (M.Left, Key, Value, Success);	
 end if;	
end Get;	
Key Value Success 
google.com	
   ?	
  
M 
Null_..String	
  
GSyC - 2019 Tablas de Śımbolos 203
Ejemplo de ejecución: Get en un ABB
Get (A_Map,	
 ASU.To_Unbounded_String (“google.com”),	
 Value,	
 Success);	
	
  bbva.es	
  
195.76.187.83”	
  
nbc.com	
  
66.77.124.26	
  
facebook.com	
  
69.63.181.12	
  
yelp.com	
  
”	
  63.251.52.110	
  
viacom.com	
  
206.220.43.92	
  
zappos.com	
  
66.209.92.150	
  
google.com	
  
69.63.189.16	
  
cbs.com	
  
198.99.118.37	
  
ucla.edu	
  
169.232.55.22
4	
  
xing.com	
  
213.238.60.19
0	
  
edi.com	
  
192.86.2.98	
  
wings.com	
  
12.155.29.35	
  
A_Map A_Map 
procedure Get (M : Map;	
 Key : in ASU.Unbounded_String;	
 Value : out ASU.Unbounded_String;	
 Success : out Boolean) is	
begin	
 Value := ASU.Null_Unbounded_String;	
 if M = null then	
 Success := False;	
 elsif M.Key = Key then	
 Value := M.Value;	
 Success := True;	
 elsif Key > M.Key then	
 Get (M.Right, Key, Value, Success);	
 else	
 Get (M.Left, Key, Value, Success);	
 end if;	
end Get;	
Key Value Success 
google.com	
   ?	
  ?	
  
procedure Get (M : Map;	
 Key : in ASU.Unbounded_String;	
 Value : out ASU.Unbounded_String;	
 Success : out Boolean) is	
begin	
 Value := ASU.Null_Unbounded_String;	
 if M = null then	
 Success := False;	
 elsif M.Key = Key then	
 Value := M.Value;	
 Success := True;	
 elsif Key > M.Key then	
 Get (M.Right, Key, Value, Success);	
 else	
 Get (M.Left, Key, Value, Success);	
 end if;	
end Get;	
Key Value Success 
google.com	
   “”	
   ?	
  procedure Get (M : Map;	
 Key : in ASU.Unbounded_String;	
 Value : out ASU.Unbounded_String;	
 Success : out Boolean) is	
begin	
 Value := ASU.Null_Unbounded_String;	
 if M = null then	
 Success := False;	
 elsif M.Key = Key then	
 Value := M.Value;	
 Success := True;	
 elsif Key > M.Key then	
 Get (M.Right, Key, Value, Success);	
 else	
 Get (M.Left, Key, Value, Success);	
 end if;	
end Get;	
Key Value Success 
google.com	
   ?	
  
M 
Null_..String	
  
GSyC - 2019 Tablas de Śımbolos 204
Ejemplo de ejecución: Get en un ABB
Get (A_Map,	
 ASU.To_Unbounded_String (“google.com”),	
 Value,	
 Success);	
	
  bbva.es	
  
195.76.187.83”	
  
nbc.com	
  
66.77.124.26	
  
facebook.com	
  
69.63.181.12	
  
yelp.com	
  
”	
  63.251.52.110	
  
viacom.com	
  
206.220.43.92	
  
zappos.com	
  
66.209.92.150	
  
google.com	
  
69.63.189.16	
  
cbs.com	
  
198.99.118.37	
  
ucla.edu	
  
169.232.55.22
4	
  
xing.com	
  
213.238.60.19
0	
  
edi.com	
  
192.86.2.98	
  
wings.com	
  
12.155.29.35	
  
A_Map A_Map 
procedure Get (M : Map;	
 Key : in ASU.Unbounded_String;	
 Value : out ASU.Unbounded_String;	
 Success : out Boolean) is	
begin	
 Value := ASU.Null_Unbounded_String;	
 if M = null then	
 Success := False;	
 elsif M.Key = Key then	
 Value := M.Value;	
 Success := True;	
 elsif Key > M.Key then	
 Get (M.Right, Key, Value, Success);	
 else	
 Get (M.Left, Key, Value, Success);	
 end if;	
end Get;	
Key Value Success 
google.com	
   ?	
  ?	
  
procedure Get (M : Map;	
 Key : in ASU.Unbounded_String;	
 Value : out ASU.Unbounded_String;	
 Success : out Boolean) is	
begin	
 Value := ASU.Null_Unbounded_String;	
 if M = null then	
 Success := False;	
 elsif M.Key = Key then	
 Value := M.Value;	
 Success := True;	
 elsif Key > M.Key then	
 Get (M.Right, Key, Value, Success);	
 else	
 Get (M.Left, Key, Value, Success);	
 end if;	
end Get;	
Key Value Success 
google.com	
   “”	
   ?	
  procedure Get (M : Map;	 Key : in ASU.Unbounded_String;	
 Value : out ASU.Unbounded_String;	
 Success : out Boolean) is	
begin	
 Value := ASU.Null_Unbounded_String;	
 if M = null then	
 Success := False;	
 elsif M.Key = Key then	
 Value := M.Value;	
 Success := True;	
 elsif Key > M.Key then	
 Get (M.Right, Key, Value, Success);	
 else	
 Get (M.Left, Key, Value, Success);	
 end if;	
end Get;	
Key Value Success 
google.com	
   ?	
  
M 
Null_..String	
  
GSyC - 2019 Tablas de Śımbolos 205
Ejemplo de ejecución: Get en un ABB
Get (A_Map,	
 ASU.To_Unbounded_String (“google.com”),	
 Value,	
 Success);	
	
  bbva.es	
  
195.76.187.83”	
  
nbc.com	
  
66.77.124.26	
  
facebook.com	
  
69.63.181.12	
  
yelp.com	
  
”	
  63.251.52.110	
  
viacom.com	
  
206.220.43.92	
  
zappos.com	
  
66.209.92.150	
  
google.com	
  
69.63.189.16	
  
cbs.com	
  
198.99.118.37	
  
ucla.edu	
  
169.232.55.22
4	
  
xing.com	
  
213.238.60.19
0	
  
edi.com	
  
192.86.2.98	
  
wings.com	
  
12.155.29.35	
  
A_Map A_Map 
procedure Get (M : Map;	
 Key : in ASU.Unbounded_String;	
 Value : out ASU.Unbounded_String;	
 Success : out Boolean) is	
begin	
 Value := ASU.Null_Unbounded_String;	
 if M = null then	
 Success := False;	
 elsif M.Key = Key then	
 Value := M.Value;	
 Success := True;	
 elsif Key > M.Key then	
 Get (M.Right, Key, Value, Success);	
 else	
 Get (M.Left, Key, Value, Success);	
 end if;	
end Get;	
Key Value Success 
google.com	
   ?	
  ?	
  
procedure Get (M : Map;	
 Key : in ASU.Unbounded_String;	
 Value : out ASU.Unbounded_String;	
 Success : out Boolean) is	
begin	
 Value := ASU.Null_Unbounded_String;	
 if M = null then	
 Success := False;	
 elsif M.Key = Key then	
 Value := M.Value;	
 Success := True;	
 elsif Key > M.Key then	
 Get (M.Right, Key, Value, Success);	
 else	
 Get (M.Left, Key, Value, Success);	
 end if;	
end Get;	
Key Value Success 
google.com	
   “”	
   ?	
  procedure Get (M : Map;	
 Key : in ASU.Unbounded_String;	
 Value : out ASU.Unbounded_String;	
 Success : out Boolean) is	
begin	
 Value := ASU.Null_Unbounded_String;	
 if M = null then	
 Success := False;	
 elsif M.Key = Key then	
 Value := M.Value;	
 Success := True;	
 elsif Key > M.Key then	
 Get (M.Right, Key, Value, Success);else	
 Get (M.Left, Key, Value, Success);	
 end if;	
end Get;	
Key Value Success 
google.com	
   ?	
  
M 
Null_..String	
  
GSyC - 2019 Tablas de Śımbolos 206
Ejemplo de ejecución: Get en un ABB
Get (A_Map,	
 ASU.To_Unbounded_String (“google.com”),	
 Value,	
 Success);	
	
  bbva.es	
  
195.76.187.83”	
  
nbc.com	
  
66.77.124.26	
  
facebook.com	
  
69.63.181.12	
  
yelp.com	
  
”	
  63.251.52.110	
  
viacom.com	
  
206.220.43.92	
  
zappos.com	
  
66.209.92.150	
  
google.com	
  
69.63.189.16	
  
cbs.com	
  
198.99.118.37	
  
ucla.edu	
  
169.232.55.22
4	
  
xing.com	
  
213.238.60.19
0	
  
edi.com	
  
192.86.2.98	
  
wings.com	
  
12.155.29.35	
  
A_Map A_Map 
procedure Get (M : Map;	
 Key : in ASU.Unbounded_String;	
 Value : out ASU.Unbounded_String;	
 Success : out Boolean) is	
begin	
 Value := ASU.Null_Unbounded_String;	
 if M = null then	
 Success := False;	
 elsif M.Key = Key then	
 Value := M.Value;	
 Success := True;	
 elsif Key > M.Key then	
 Get (M.Right, Key, Value, Success);	
 else	
 Get (M.Left, Key, Value, Success);	
 end if;	
end Get;	
Key Value Success 
google.com	
   ?	
  ?	
  
procedure Get (M : Map;	
 Key : in ASU.Unbounded_String;	
 Value : out ASU.Unbounded_String;	
 Success : out Boolean) is	
begin	
 Value := ASU.Null_Unbounded_String;	
 if M = null then	
 Success := False;	
 elsif M.Key = Key then	
 Value := M.Value;	
 Success := True;	
 elsif Key > M.Key then	
 Get (M.Right, Key, Value, Success);	
 else	
 Get (M.Left, Key, Value, Success);	
 end if;	
end Get;	
Key Value Success 
google.com	
   “”	
   ?	
  procedure Get (M : Map;	
 Key : in ASU.Unbounded_String;	
 Value : out ASU.Unbounded_String;	
 Success : out Boolean) is	
begin	
 Value := ASU.Null_Unbounded_String;	
 if M = null then	
 Success := False;	
 elsif M.Key = Key then	
 Value := M.Value;	
 Success := True;	
 elsif Key > M.Key then	
 Get (M.Right, Key, Value, Success);	
 else	
 Get (M.Left, Key, Value, Success);	
 end if;	
end Get;	
Key Value Success 
google.com	
   True	
  69.63.189.16	
  
M 
GSyC - 2019 Tablas de Śımbolos 207
Ejemplo de ejecución: Get en un ABB
Get (A_Map,	
 ASU.To_Unbounded_String (“google.com”),	
 Value,	
 Success);	
	
  bbva.es	
  
195.76.187.83”	
  
nbc.com	
  
66.77.124.26	
  
facebook.com	
  
69.63.181.12	
  
yelp.com	
  
”	
  63.251.52.110	
  
viacom.com	
  
206.220.43.92	
  
zappos.com	
  
66.209.92.150	
  
google.com	
  
69.63.189.16	
  
cbs.com	
  
198.99.118.37	
  
ucla.edu	
  
169.232.55.22
4	
  
xing.com	
  
213.238.60.19
0	
  
edi.com	
  
192.86.2.98	
  
wings.com	
  
12.155.29.35	
  
A_Map A_Map 
procedure Get (M : Map;	
 Key : in ASU.Unbounded_String;	
 Value : out ASU.Unbounded_String;	
 Success : out Boolean) is	
begin	
 Value := ASU.Null_Unbounded_String;	
 if M = null then	
 Success := False;	
 elsif M.Key = Key then	
 Value := M.Value;	
 Success := True;	
 elsif Key > M.Key then	
 Get (M.Right, Key, Value, Success);	
 else	
 Get (M.Left, Key, Value, Success);	
 end if;	
end Get;	
Key Value Success 
google.com	
   ?	
  ?	
  
procedure Get (M : Map;	
 Key : in ASU.Unbounded_String;	
 Value : out ASU.Unbounded_String;	
 Success : out Boolean) is	
begin	
 Value := ASU.Null_Unbounded_String;	
 if M = null then	
 Success := False;	
 elsif M.Key = Key then	
 Value := M.Value;	
 Success := True;	
 elsif Key > M.Key then	
 Get (M.Right, Key, Value, Success);	
 else	
 Get (M.Left, Key, Value, Success);	
 end if;	
end Get;	
Key Value Success 
google.com	
   “”	
   ?	
  procedure Get (M : Map;	
 Key : in ASU.Unbounded_String;	
 Value : out ASU.Unbounded_String;	
 Success : out Boolean) is	
begin	
 Value := ASU.Null_Unbounded_String;	
 if M = null then	
 Success := False;	
 elsif M.Key = Key then	
 Value := M.Value;	
 Success := True;	
 elsif Key > M.Key then	
 Get (M.Right, Key, Value, Success);	
 else	
 Get (M.Left, Key, Value, Success);	
 end if;	
end Get;	
Key Value Success 
google.com	
   True	
  69.63.189.16	
  
M 
GSyC - 2019 Tablas de Śımbolos 208
Ejemplo de ejecución: Get en un ABB
Get (A_Map,	
 ASU.To_Unbounded_String (“google.com”),	
 Value,	
 Success);	
	
  bbva.es	
  
195.76.187.83”	
  
nbc.com	
  
66.77.124.26	
  
facebook.com	
  
69.63.181.12	
  
yelp.com	
  
”	
  63.251.52.110	
  
viacom.com	
  
206.220.43.92	
  
zappos.com	
  
66.209.92.150	
  
google.com	
  
69.63.189.16	
  
cbs.com	
  
198.99.118.37	
  
ucla.edu	
  
169.232.55.22
4	
  
xing.com	
  
213.238.60.19
0	
  
edi.com	
  
192.86.2.98	
  
wings.com	
  
12.155.29.35	
  
A_Map A_Map 
procedure Get (M : Map;	
 Key : in ASU.Unbounded_String;	
 Value : out ASU.Unbounded_String;	
 Success : out Boolean) is	
begin	
 Value := ASU.Null_Unbounded_String;	
 if M = null then	
 Success := False;	
 elsif M.Key = Key then	
 Value := M.Value;	
 Success := True;	
 elsif Key > M.Key then	
 Get (M.Right, Key, Value, Success);	
 else	
 Get (M.Left, Key, Value, Success);	
 end if;	
end Get;	
Key Value Success 
google.com	
   ?	
  ?	
  
procedure Get (M : Map;	
 Key : in ASU.Unbounded_String;	
 Value : out ASU.Unbounded_String;	
 Success : out Boolean) is	
begin	
 Value := ASU.Null_Unbounded_String;	
 if M = null then	
 Success := False;	
 elsif M.Key = Key then	
 Value := M.Value;	
 Success := True;	
 elsif Key > M.Key then	
 Get (M.Right, Key, Value, Success);	
 else	
 Get (M.Left, Key, Value, Success);	
 end if;	
end Get;	
Key Value Success 
google.com	
   “”	
   ?	
  procedure Get (M : Map;	
 Key : in ASU.Unbounded_String;	
 Value : out ASU.Unbounded_String;	
 Success : out Boolean) is	
begin	
 Value := ASU.Null_Unbounded_String;	
 if M = null then	
 Success := False;	
 elsif M.Key = Key then	
 Value := M.Value;	
 Success := True;	
 elsif Key > M.Key then	
 Get (M.Right, Key, Value, Success);	
 else	
 Get (M.Left, Key, Value, Success);	
 end if;	
end Get;	
Key Value Success 
google.com	
   True	
  69.63.189.16	
  
M 
GSyC - 2019 Tablas de Śımbolos 209
Ejemplo de ejecución: Get en un ABB
Get (A_Map,	
 ASU.To_Unbounded_String (“google.com”),	
 Value,	
 Success);	
	
  bbva.es	
  
195.76.187.83”	
  
nbc.com	
  
66.77.124.26	
  
facebook.com	
  
69.63.181.12	
  
yelp.com	
  
”	
  63.251.52.110	
  
viacom.com	
  
206.220.43.92	
  
zappos.com	
  
66.209.92.150	
  
google.com	
  
69.63.189.16	
  
cbs.com	
  
198.99.118.37	
  
ucla.edu	
  
169.232.55.22
4	
  
xing.com	
  
213.238.60.19
0	
  
edi.com	
  
192.86.2.98	
  
wings.com	
  
12.155.29.35	
  
A_Map 
procedure Get (M : Map;	
 Key : in ASU.Unbounded_String;	
 Value : out ASU.Unbounded_String;	
 Success : out Boolean) is	
begin	
 Value := ASU.Null_Unbounded_String;	
 if M = null then	
 Success := False;	
 elsif M.Key = Key then	
 Value := M.Value;	
 Success := True;	
 elsif Key > M.Key then	
 Get (M.Right, Key, Value, Success);	
 else	
 Get (M.Left, Key, Value, Success);	
 end if;	
end Get;	
Key Value Success 
google.com	
   ?	
  69.63.189.16	
  
A_Map 
procedure Get (M : Map;	
 Key : in ASU.Unbounded_String;	
 Value : outASU.Unbounded_String;	
 Success : out Boolean) is	
begin	
 Value := ASU.Null_Unbounded_String;	
 if M = null then	
 Success := False;	
 elsif M.Key = Key then	
 Value := M.Value;	
 Success := True;	
 elsif Key > M.Key then	
 Get (M.Right, Key, Value, Success);	
 else	
 Get (M.Left, Key, Value, Success);	
 end if;	
end Get;	
Key Value Success 
google.com	
   ?	
  ?	
  
procedure Get (M : Map;	
 Key : in ASU.Unbounded_String;	
 Value : out ASU.Unbounded_String;	
 Success : out Boolean) is	
begin	
 Value := ASU.Null_Unbounded_String;	
 if M = null then	
 Success := False;	
 elsif M.Key = Key then	
 Value := M.Value;	
 Success := True;	
 elsif Key > M.Key then	
 Get (M.Right, Key, Value, Success);	
 else	
 Get (M.Left, Key, Value, Success);	
 end if;	
end Get;	
Key Value Success 
google.com	
   69.63.189.16	
   True	
  
M 
GSyC - 2019 Tablas de Śımbolos 210
Ejemplo de ejecución: Get en un ABB
Get (A_Map,	
 ASU.To_Unbounded_String (“google.com”),	
 Value,	
 Success);	
	
  bbva.es	
  
195.76.187.83”	
  
nbc.com	
  
66.77.124.26	
  
facebook.com	
  
69.63.181.12	
  
yelp.com	
  
”	
  63.251.52.110	
  
viacom.com	
  
206.220.43.92	
  
zappos.com	
  
66.209.92.150	
  
google.com	
  
69.63.189.16	
  
cbs.com	
  
198.99.118.37	
  
ucla.edu	
  
169.232.55.22
4	
  
xing.com	
  
213.238.60.19
0	
  
edi.com	
  
192.86.2.98	
  
wings.com	
  
12.155.29.35	
  
A_Map A_Map 
procedure Get (M : Map;	
 Key : in ASU.Unbounded_String;	
 Value : out ASU.Unbounded_String;	
 Success : out Boolean) is	
begin	
 Value := ASU.Null_Unbounded_String;	
 if M = null then	
 Success := False;	
 elsif M.Key = Key then	
 Value := M.Value;	
 Success := True;	
 elsif Key > M.Key then	
 Get (M.Right, Key, Value, Success);	
 else	
 Get (M.Left, Key, Value, Success);	
 end if;	
end Get;	
Key Value Success 
google.com	
   ?	
  ?	
  
procedure Get (M : Map;	
 Key : in ASU.Unbounded_String;	
 Value : out ASU.Unbounded_String;	
 Success : out Boolean) is	
begin	
 Value := ASU.Null_Unbounded_String;	
 if M = null then	
 Success := False;	
 elsif M.Key = Key then	
 Value := M.Value;	
 Success := True;	
 elsif Key > M.Key then	
 Get (M.Right, Key, Value, Success);	
 else	
 Get (M.Left, Key, Value, Success);	
 end if;	
end Get;	
Key Value Success 
google.com	
   69.63.189.16	
   True	
  
M 
GSyC - 2019 Tablas de Śımbolos 211
Ejemplo de ejecución: Get en un ABB
Get (A_Map,	
 ASU.To_Unbounded_String (“google.com”),	
 Value,	
 Success);	
	
  bbva.es	
  
195.76.187.83”	
  
nbc.com	
  
66.77.124.26	
  
facebook.com	
  
69.63.181.12	
  
yelp.com	
  
”	
  63.251.52.110	
  
viacom.com	
  
206.220.43.92	
  
zappos.com	
  
66.209.92.150	
  
google.com	
  
69.63.189.16	
  
cbs.com	
  
198.99.118.37	
  
ucla.edu	
  
169.232.55.22
4	
  
xing.com	
  
213.238.60.19
0	
  
edi.com	
  
192.86.2.98	
  
wings.com	
  
12.155.29.35	
  
A_Map A_Map 
procedure Get (M : Map;	
 Key : in ASU.Unbounded_String;	
 Value : out ASU.Unbounded_String;	
 Success : out Boolean) is	
begin	
 Value := ASU.Null_Unbounded_String;	
 if M = null then	
 Success := False;	
 elsif M.Key = Key then	
 Value := M.Value;	
 Success := True;	
 elsif Key > M.Key then	
 Get (M.Right, Key, Value, Success);	
 else	
 Get (M.Left, Key, Value, Success);	
 end if;	
end Get;	
Key Value Success 
google.com	
   ?	
  ?	
  
procedure Get (M : Map;	
 Key : in ASU.Unbounded_String;	
 Value : out ASU.Unbounded_String;	
 Success : out Boolean) is	
begin	
 Value := ASU.Null_Unbounded_String;	
 if M = null then	
 Success := False;	
 elsif M.Key = Key then	
 Value := M.Value;	
 Success := True;	
 elsif Key > M.Key then	
 Get (M.Right, Key, Value, Success);	
 else	
 Get (M.Left, Key, Value, Success);	
 end if;	
end Get;	
Key Value Success 
google.com	
   69.63.189.16	
   True	
  
M 
GSyC - 2019 Tablas de Śımbolos 212
Ejemplo de ejecución: Get en un ABB
Get (A_Map,	
 ASU.To_Unbounded_String (“google.com”),	
 Value,	
 Success);	
	
  bbva.es	
  
195.76.187.83”	
  
nbc.com	
  
66.77.124.26	
  
facebook.com	
  
69.63.181.12	
  
yelp.com	
  
”	
  63.251.52.110	
  
viacom.com	
  
206.220.43.92	
  
zappos.com	
  
66.209.92.150	
  
google.com	
  
69.63.189.16	
  
cbs.com	
  
198.99.118.37	
  
ucla.edu	
  
169.232.55.22
4	
  
xing.com	
  
213.238.60.19
0	
  
edi.com	
  
192.86.2.98	
  
wings.com	
  
12.155.29.35	
  
A_Map A_Map 
M 
procedure Get (M : Map;	
 Key : in ASU.Unbounded_String;	
 Value : out ASU.Unbounded_String;	
 Success : out Boolean) is	
begin	
 Value := ASU.Null_Unbounded_String;	
 if M = null then	
 Success := False;	
 elsif M.Key = Key then	
 Value := M.Value;	
 Success := True;	
 elsif Key > M.Key then	
 Get (M.Right, Key, Value, Success);	
 else	
 Get (M.Left, Key, Value, Success);	
 end if;	
end Get;	
Key Value Success 
google.com	
   True	
  69.63.189.16	
  
M 
GSyC - 2019 Tablas de Śımbolos 213
Ejemplo de ejecución: Get en un ABB
Get (A_Map,	
 ASU.To_Unbounded_String (“google.com”),	
 Value,	
 Success);	
	
  bbva.es	
  
195.76.187.83”	
  
nbc.com	
  
66.77.124.26	
  
facebook.com	
  
69.63.181.12	
  
yelp.com	
  
”	
  63.251.52.110	
  
viacom.com	
  
206.220.43.92	
  
zappos.com	
  
66.209.92.150	
  
google.com	
  
69.63.189.16	
  
cbs.com	
  
198.99.118.37	
  
ucla.edu	
  
169.232.55.22
4	
  
xing.com	
  
213.238.60.19
0	
  
edi.com	
  
192.86.2.98	
  
wings.com	
  
12.155.29.35	
  
A_Map A_Map 
M 
procedure Get (M : Map;	
 Key : in ASU.Unbounded_String;	
 Value : out ASU.Unbounded_String;	
 Success : out Boolean) is	
begin	
 Value := ASU.Null_Unbounded_String;	
 if M = null then	
 Success := False;	
 elsif M.Key = Key then	
 Value := M.Value;	
 Success := True;	
 elsif Key > M.Key then	
 Get (M.Right, Key, Value, Success);	
 else	
 Get (M.Left, Key, Value, Success);	
 end if;	
end Get;	
Key Value Success 
google.com	
   True	
  69.63.189.16	
  
M 
GSyC - 2019 Tablas de Śımbolos 214
Ejemplo de ejecución: Get en un ABB
Get (A_Map,	
 ASU.To_Unbounded_String (“google.com”),	
 Value,	
 Success);	
	
  bbva.es	
  
195.76.187.83”	
  
nbc.com	
  
66.77.124.26	
  
facebook.com	
  
69.63.181.12	
  
yelp.com	
  
”	
  63.251.52.110	
  
viacom.com	
  
206.220.43.92	
  
zappos.com	
  
66.209.92.150	
  
google.com	
  
69.63.189.16	
  
cbs.com	
  
198.99.118.37	
  
ucla.edu	
  
169.232.55.22
4	
  
xing.com	
  
213.238.60.19
0	
  
edi.com	
  
192.86.2.98	
  
wings.com	
  
12.155.29.35	
  
A_Map 
M 
procedure Get (M : Map;	
 Key : in ASU.Unbounded_String;	
 Value : out ASU.Unbounded_String;	
 Success : out Boolean) is	
begin	
 Value := ASU.Null_Unbounded_String;	
 if M = null then	
 Success := False;	
 elsif M.Key = Key then	
 Value := M.Value;	
 Success := True;	
 elsif Key > M.Key then	
 Get (M.Right, Key, Value, Success);	
 else	
 Get (M.Left, Key, Value, Success);	
 end if;	
end Get;	
Key Value Success 
google.com	
   True	
  69.63.189.16	
  
M 
GSyC - 2019 Tablas de Śımbolos 215
Ejemplo de ejecución: Get en un ABB
	
  bbva.es	
  
195.76.187.83”	
  
nbc.com	
  
66.77.124.26	
  
facebook.com	
  
69.63.181.12	
  
yelp.com	
  
”	
  63.251.52.110	
  
viacom.com	
  
206.220.43.92zappos.com	
  
66.209.92.150	
  
google.com	
  
69.63.189.16	
  
cbs.com	
  
198.99.118.37	
  
ucla.edu	
  
169.232.55.22
4	
  
xing.com	
  
213.238.60.19
0	
  
edi.com	
  
192.86.2.98	
  
wings.com	
  
12.155.29.35	
  
A_Map A_Map 
Get (A_Map,	
 ASU.To_Unbounded_String (“google.com”),	
 Value,	
 Success);	
Value Success 
True	
  69.63.181.12	
  
GSyC - 2019 Tablas de Śımbolos 216
Ejemplo de ejecución: Get en un ABB
Inserción de un nodo en un árbol
Se recorre el árbol desde la ráız hasta encontrar la posición que
corresponda al nodo que se inserta en función de su clave
Para insertar un nuevo nodo con (Key, Value) en un árbol del que
conocemos su nodo ráız (Root):
Si el árbol está vaćıo ⇒ se crea un nuevo nodo con (Key,
Value), que se convierte en la nueva ráız
Si el árbol no está vació ⇒
Si Key = Root.Key ⇒ Root.Value := Value
Si Key < Root.Key ⇒ se asigna al subárbol izquierdo el
resultado de insertar el nodo en el subárbol izquierdo
Si Key > Root.Key ⇒ se asigna al subárbol derecho el
resultado de insertar el nodo en el subárbol derecho
GSyC - 2019 Tablas de Śımbolos 217
Ejemplo de ejecución: Get en un ABB
Inserción de un nodo en un árbol: código
procedure Put (M : in out Map;
Key : ASU.Unbounded_String;
Value : ASU.Unbounded_String) is
begin
if M = null then
M := new Tree_Node’(Key, Value, null, null);
return;
end if;
if Key = M.Key then
M.Value := Value;
elsif Key < M.Key then
Put (M.Left, Key, Value);
elsif Key > M.Key then
Put (M.Right, Key, Value);
end if;
end Put;
GSyC - 2019 Tablas de Śımbolos 218
Ejemplo de ejecución: Put en un ABB vaćıo
Contenidos
1 Tablas de Śımbolos
2 Implementación de TS mediante un array no ordenado
3 Implementación de TS mediante una lista enlazada no ordenada
4 Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
5 Iteración sobre todos los elementos de una colección
6 Implementación de TS mediante un Array ordenado
7 Implementación de TS mediante una lista enlazada ordenada
8 Implementación de TS mediante un árbol de búsqueda binaria (ABB)
9 Ejemplo de ejecución: Get en un ABB
10 Ejemplo de ejecución: Put en un ABB vaćıo
11 Ejemplo de ejecución: Put en un ABB
12 Borrado de un nodo en un ABB
GSyC - 2019 Tablas de Śımbolos 219
Ejemplo de ejecución: Put en un ABB vaćıo
A_Map 
Put (A_Map, 	
 ASU.To_Unbounded_String (“nbc.com”),	
 ASU.To_Unbounded_String (“66.77.124.26”));	
GSyC - 2019 Tablas de Śımbolos 220
Ejemplo de ejecución: Put en un ABB vaćıo
Put (A_Map, 	
 ASU.To_Unbounded_String (“nbc.com”),	
 ASU.To_Unbounded_String (“66.77.124.26”));	
A_Map 
procedure Put (M : in out Map;	
 Key : ASU.Unbounded_String;	
 Value : ASU.Unbounded_String)	
begin	
 if M = null then	
 M := new Tree_Node'(Key, Value, null, null);	
 return;	
 end if;	
 if Key = M.Key then	
 M.Value := Value;	
 elsif Key < M.Key then	
 Put (M.Left, Key, Value);	
 elsif Key > M.Key then	
 Put (M.Right, Key, Value);	
 end if;	
end Put;	
Key	 Value	
nbc.com	
   66.77.124.26	
  
M	
GSyC - 2019 Tablas de Śımbolos 221
Ejemplo de ejecución: Put en un ABB vaćıo
Put (A_Map, 	
 ASU.To_Unbounded_String (“nbc.com”),	
 ASU.To_Unbounded_String (“66.77.124.26”));	
A_Map 
procedure Put (M : in out Map;	
 Key : ASU.Unbounded_String;	
 Value : ASU.Unbounded_String)	
begin	
 if M = null then	
 M := new Tree_Node'(Key, Value, null, null);	
 return;	
 end if;	
 if Key = M.Key then	
 M.Value := Value;	
 elsif Key < M.Key then	
 Put (M.Left, Key, Value);	
 elsif Key > M.Key then	
 Put (M.Right, Key, Value);	
 end if;	
end Put;	
Key Value 
nbc.com	
   66.77.124.26	
  
M 
GSyC - 2019 Tablas de Śımbolos 222
Ejemplo de ejecución: Put en un ABB vaćıo
Put (A_Map, 	
 ASU.To_Unbounded_String (“nbc.com”),	
 ASU.To_Unbounded_String (“66.77.124.26”));	
A_Map 
procedure Put (M : in out Map;	
 Key : ASU.Unbounded_String;	
 Value : ASU.Unbounded_String)	
begin	
 if M = null then	
 M := new Tree_Node'(Key, Value, null, null);	
 return;	
 end if;	
 if Key = M.Key then	
 M.Value := Value;	
 elsif Key < M.Key then	
 Put (M.Left, Key, Value);	
 elsif Key > M.Key then	
 Put (M.Right, Key, Value);	
 end if;	
end Put;	
Key Value 
nbc.com	
   66.77.124.26	
  
M 
GSyC - 2019 Tablas de Śımbolos 223
Ejemplo de ejecución: Put en un ABB vaćıo
Put (A_Map, 	
 ASU.To_Unbounded_String (“nbc.com”),	
 ASU.To_Unbounded_String (“66.77.124.26”));	
A_Map 
procedure Put (M : in out Map;	
 Key : ASU.Unbounded_String;	
 Value : ASU.Unbounded_String)	
begin	
 if M = null then	
 M := new Tree_Node'(Key, Value, null, null);	
 return;	
 end if;	
 if Key = M.Key then	
 M.Value := Value;	
 elsif Key < M.Key then	
 Put (M.Left, Key, Value);	
 elsif Key > M.Key then	
 Put (M.Right, Key, Value);	
 end if;	
end Put;	
Key Value 
nbc.com	
   66.77.124.26	
  
M 
nbc.com	
  
66.77.124.26	
  
GSyC - 2019 Tablas de Śımbolos 224
Ejemplo de ejecución: Put en un ABB vaćıo
Put (A_Map, 	
 ASU.To_Unbounded_String (“nbc.com”),	
 ASU.To_Unbounded_String (“66.77.124.26”));	
A_Map 
procedure Put (M : in out Map;	
 Key : ASU.Unbounded_String;	
 Value : ASU.Unbounded_String)	
begin	
 if M = null then	
 M := new Tree_Node'(Key, Value, null, null);	
 return;	
 end if;	
 if Key = M.Key then	
 M.Value := Value;	
 elsif Key < M.Key then	
 Put (M.Left, Key, Value);	
 elsif Key > M.Key then	
 Put (M.Right, Key, Value);	
 end if;	
end Put;	
Key Value 
nbc.com	
   66.77.124.26	
  
M 
nbc.com	
  
66.77.124.26	
  
GSyC - 2019 Tablas de Śımbolos 225
Ejemplo de ejecución: Put en un ABB vaćıo
Put (A_Map, 	
 ASU.To_Unbounded_String (“nbc.com”),	
 ASU.To_Unbounded_String (“66.77.124.26”));	
nbc.com	
  
66.77.124.26	
  
A_Map 
procedure Put (M : in out Map;	
 Key : ASU.Unbounded_String;	
 Value : ASU.Unbounded_String)	
begin	
 if M = null then	
 M := new Tree_Node'(Key, Value, null, null);	
 return;	
 end if;	
 if Key = M.Key then	
 M.Value := Value;	
 elsif Key < M.Key then	
 Put (M.Left, Key, Value);	
 elsif Key > M.Key then	
 Put (M.Right, Key, Value);	
 end if;	
end Put;	
Key Value 
nbc.com	
   66.77.124.26	
  
M 
GSyC - 2019 Tablas de Śımbolos 226
Ejemplo de ejecución: Put en un ABB vaćıo
Put (A_Map, 	
 ASU.To_Unbounded_String (“nbc.com”),	
 ASU.To_Unbounded_String (“66.77.124.26”));	
nbc.com	
  
66.77.124.26	
  
A_Map 
procedure Put (M : in out Map;	
 Key : ASU.Unbounded_String;	
 Value : ASU.Unbounded_String)	
begin	
 if M = null then	
 M := new Tree_Node'(Key, Value, null, null);	
 return;	
 end if;	
 if Key = M.Key then	
 M.Value := Value;	
 elsif Key < M.Key then	
 Put (M.Left, Key, Value);	
 elsif Key > M.Key then	
 Put (M.Right, Key, Value);	
 end if;	
end Put;	
Key Value 
nbc.com	
   66.77.124.26	
  
M 
GSyC - 2019 Tablas de Śımbolos 227
Ejemplo de ejecución: Put en un ABB vaćıo
A_Map 
nbc.com	
  
66.77.124.26	
  
Put (A_Map, 	
 ASU.To_Unbounded_String (“nbc.com”),	
 ASU.To_Unbounded_String (“66.77.124.26”));	
GSyC - 2019 Tablas de Śımbolos 228
Ejemplo de ejecución: Put en un ABB
Contenidos
1 Tablas de Śımbolos
2 Implementación de TS mediante un array no ordenado
3 Implementación de TS mediante una lista enlazada no ordenada
4 Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
5 Iteración sobre todos los elementos de una colección
6 Implementación de TS mediante un Array ordenado
7 Implementación de TS mediante una lista enlazada ordenada
8 Implementación de TS medianteun árbol de búsqueda binaria (ABB)
9 Ejemplo de ejecución: Get en un ABB
10 Ejemplo de ejecución: Put en un ABB vaćıo
11 Ejemplo de ejecución: Put en un ABB
12 Borrado de un nodo en un ABB
GSyC - 2019 Tablas de Śımbolos 229
Ejemplo de ejecución: Put en un ABB
nbc.com	
  
66.77.124.26	
  
facebook.com	
  
69.63.181.12	
  
yelp.com	
  
”	
  63.251.52.110	
  
viacom.com	
  
206.220.43.92	
  
zappos.com	
  
66.209.92.150	
  
google.com	
  
69.63.189.16	
  
ucla.edu	
  
169.232.55.22
4	
  
xing.com	
  
213.238.60.19
0	
  
wings.com	
  
12.155.29.35	
  
A_Map 
GSyC - 2019 Tablas de Śımbolos 230
Ejemplo de ejecución: Put en un ABB
nbc.com	
  
66.77.124.26	
  
facebook.com	
  
69.63.181.12	
  
yelp.com	
  
”	
  63.251.52.110	
  
viacom.com	
  
206.220.43.92	
  
zappos.com	
  
66.209.92.150	
  
google.com	
  
69.63.189.16	
  
ucla.edu	
  
169.232.55.22
4	
  
xing.com	
  
213.238.60.19
0	
  
wings.com	
  
12.155.29.35	
  
A_Map 
Put (A_Map,	
 ASU.To_Unbounded_String (“boingboing.net”),	
 ASU.To_Unbounded_String (“204.11.50.136”));	
GSyC - 2019 Tablas de Śımbolos 231
Ejemplo de ejecución: Put en un ABB
Put (A_Map,	
 ASU.To_Unbounded_String (“boingboing.net”),	
 ASU.To_Unbounded_String (“204.11.50.136”));	
nbc.com	
  
66.77.124.26	
  
facebook.com	
  
69.63.181.12	
  
yelp.com	
  
”	
  63.251.52.110	
  
viacom.com	
  
206.220.43.92	
  
zappos.com	
  
66.209.92.150	
  
google.com	
  
69.63.189.16	
  
ucla.edu	
  
169.232.55.22
4	
  
xing.com	
  
213.238.60.19
0	
  
A_Map 
procedure Put (M : in out Map;	
 Key : ASU.Unbounded_String;	
 Value : ASU.Unbounded_String)	
begin	
 if M = null then	
 M := new Tree_Node'(Key, Value, null, null);	
 return;	
 end if;	
 if Key = M.Key then	
 M.Value := Value;	
 elsif Key < M.Key then	
 Put (M.Left, Key, Value);	
 elsif Key > M.Key then	
 Put (M.Right, Key, Value);	
 end if;	
end Put;	
Key	 Value	
boingboing.net	
   204.11.50.136	
  
M	
GSyC - 2019 Tablas de Śımbolos 232
Ejemplo de ejecución: Put en un ABB
Put (A_Map,	
 ASU.To_Unbounded_String (“boingboing.net”),	
 ASU.To_Unbounded_String (“204.11.50.136”));	
nbc.com	
  
66.77.124.26	
  
facebook.com	
  
69.63.181.12	
  
yelp.com	
  
”	
  63.251.52.110	
  
viacom.com	
  
206.220.43.92	
  
zappos.com	
  
66.209.92.150	
  
google.com	
  
69.63.189.16	
  
A_Map 
procedure Put (M : in out Map;	
 Key : ASU.Unbounded_String;	
 Value : ASU.Unbounded_String)	
begin	
 if M = null then	
 M := new Tree_Node'(Key, Value, null, null);	
 return;	
 end if;	
 if Key = M.Key then	
 M.Value := Value;	
 elsif Key < M.Key then	
 Put (M.Left, Key, Value);	
 elsif Key > M.Key then	
 Put (M.Right, Key, Value);	
 end if;	
end Put;	
Key Value 
boingboing.net	
   204.11.50.136	
  
M 
GSyC - 2019 Tablas de Śımbolos 233
Ejemplo de ejecución: Put en un ABB
Put (A_Map,	
 ASU.To_Unbounded_String (“boingboing.net”),	
 ASU.To_Unbounded_String (“204.11.50.136”));	
nbc.com	
  
66.77.124.26	
  
facebook.com	
  
69.63.181.12	
  
yelp.com	
  
”	
  63.251.52.110	
  
viacom.com	
  
206.220.43.92	
  
zappos.com	
  
66.209.92.150	
  
google.com	
  
69.63.189.16	
  
ucla.edu	
  
169.232.55.22
4	
  
xing.com	
  
213.238.60.19
0	
  
A_Map 
procedure Put (M : in out Map;	
 Key : ASU.Unbounded_String;	
 Value : ASU.Unbounded_String)	
begin	
 if M = null then	
 M := new Tree_Node'(Key, Value, null, null);	
 return;	
 end if;	
 if Key = M.Key then	
 M.Value := Value;	
 elsif Key < M.Key then	
 Put (M.Left, Key, Value);	
 elsif Key > M.Key then	
 Put (M.Right, Key, Value);	
 end if;	
end Put;	
Key Value 
boingboing.net	
   204.11.50.136	
  
M 
GSyC - 2019 Tablas de Śımbolos 234
Ejemplo de ejecución: Put en un ABB
Put (A_Map,	
 ASU.To_Unbounded_String (“boingboing.net”),	
 ASU.To_Unbounded_String (“204.11.50.136”));	
nbc.com	
  
66.77.124.26	
  
facebook.com	
  
69.63.181.12	
  
yelp.com	
  
”	
  63.251.52.110	
  
viacom.com	
  
206.220.43.92	
  
zappos.com	
  
66.209.92.150	
  
google.com	
  
69.63.189.16	
  
ucla.edu	
  
169.232.55.22
4	
  
xing.com	
  
213.238.60.19
0	
  
A_Map 
procedure Put (M : in out Map;	
 Key : ASU.Unbounded_String;	
 Value : ASU.Unbounded_String)	
begin	
 if M = null then	
 M := new Tree_Node'(Key, Value, null, null);	
 return;	
 end if;	
 if Key = M.Key then	
 M.Value := Value;	
 elsif Key < M.Key then	
 Put (M.Left, Key, Value);	
 elsif Key > M.Key then	
 Put (M.Right, Key, Value);	
 end if;	
end Put;	
Key Value 
boingboing.net	
   204.11.50.136	
  
M 
GSyC - 2019 Tablas de Śımbolos 235
Ejemplo de ejecución: Put en un ABB
Put (A_Map,	
 ASU.To_Unbounded_String (“boingboing.net”),	
 ASU.To_Unbounded_String (“204.11.50.136”));	
nbc.com	
  
66.77.124.26	
  
facebook.com	
  
69.63.181.12	
  
yelp.com	
  
”	
  63.251.52.110	
  
viacom.com	
  
206.220.43.92	
  
zappos.com	
  
66.209.92.150	
  
google.com	
  
69.63.189.16	
  
ucla.edu	
  
169.232.55.22
4	
  
xing.com	
  
213.238.60.19
0	
  
A_Map 
procedure Put (M : in out Map;	
 Key : ASU.Unbounded_String;	
 Value : ASU.Unbounded_String)	
begin	
 if M = null then	
 M := new Tree_Node'(Key, Value, null, null);	
 return;	
 end if;	
 if Key = M.Key then	
 M.Value := Value;	
 elsif Key < M.Key then	
 Put (M.Left, Key, Value);	
 elsif Key > M.Key then	
 Put (M.Right, Key, Value);	
 end if;	
end Put;	
Key Value 
boingboing.net	
   204.11.50.136	
  
M 
GSyC - 2019 Tablas de Śımbolos 236
Ejemplo de ejecución: Put en un ABB
Put (A_Map,	
 ASU.To_Unbounded_String (“boingboing.net”),	
 ASU.To_Unbounded_String (“204.11.50.136”));	
nbc.com	
  
66.77.124.26	
  
facebook.com	
  
69.63.181.12	
  
yelp.com	
  
”	
  63.251.52.110	
  
viacom.com	
  
206.220.43.92	
  
zappos.com	
  
66.209.92.150	
  
google.com	
  
69.63.189.16	
  
ucla.edu	
  
169.232.55.22
4	
  
xing.com	
  
213.238.60.19
0	
  
A_Map 
procedure Put (M : in out Map;	
 Key : ASU.Unbounded_String;	
 Value : ASU.Unbounded_String)	
begin	
 if M = null then	
 M := new Tree_Node'(Key, Value, null, null);	
 end if;	
 if Key = M.Key then	
 M.Value := Value;	
 elsif Key < M.Key then	
 Put (M.Left, Key, Value);	
 elsif Key > M.Key then	
 Put (M.Right, Key, Value);	
 end if;	
end Put;	
Key Value 
boingboing.net	
   204.11.50.136	
  
M 
procedure Put (M : in out Map;	
 Key : ASU.Unbounded_String;	
 Value : ASU.Unbounded_String)	
begin	
 if M = null then	
 M := new Tree_Node'(Key, Value, null, null);	
 return;	
 end if;	
 if Key = M.Key then	
 M.Value := Value;	
 elsif Key < M.Key then	
 Put (M.Left, Key, Value);	
 elsif Key > M.Key then	
 Put (M.Right, Key, Value);	
 end if;	
end Put;	
Key Value 
boingboing.net	
   204.11.50.136	
  
M 
GSyC - 2019 Tablas de Śımbolos 237
Ejemplo de ejecución: Put en un ABB
Put (A_Map,	
 ASU.To_Unbounded_String (“boingboing.net”),	
 ASU.To_Unbounded_String (“204.11.50.136”));	
nbc.com	
  
66.77.124.26	
  
facebook.com	
  
69.63.181.12	
  
yelp.com	
  
”	
  63.251.52.110	
  
viacom.com	
  
206.220.43.92	
  
zappos.com	
  
66.209.92.150	
  
google.com	
  
69.63.189.16	
  
A_Map 
procedure Put (M : in out Map;	
 Key : ASU.Unbounded_String;	
 Value : ASU.Unbounded_String)	
begin	
 if M = null then	
 M := new Tree_Node'(Key, Value, null, null);	
 end if;	
 if Key = M.Key then	
 M.Value := Value;	
 elsif Key < M.Key then	
 Put (M.Left, Key, Value);	
 elsif Key > M.Key then	
 Put (M.Right, Key, Value);end if;	
end Put;	
Key Value 
boingboing.net	
   204.11.50.136	
  
M 
procedure Put (M : in out Map;	
 Key : ASU.Unbounded_String;	
 Value : ASU.Unbounded_String)	
begin	
 if M = null then	
 M := new Tree_Node'(Key, Value, null, null);	
 return;	
 end if;	
 if Key = M.Key then	
 M.Value := Value;	
 elsif Key < M.Key then	
 Put (M.Left, Key, Value);	
 elsif Key > M.Key then	
 Put (M.Right, Key, Value);	
 end if;	
end Put;	
Key Value 
boingboing.net	
   204.11.50.136	
  
M 
GSyC - 2019 Tablas de Śımbolos 238
Ejemplo de ejecución: Put en un ABB
Put (A_Map,	
 ASU.To_Unbounded_String (“boingboing.net”),	
 ASU.To_Unbounded_String (“204.11.50.136”));	
nbc.com	
  
66.77.124.26	
  
facebook.com	
  
69.63.181.12	
  
yelp.com	
  
”	
  63.251.52.110	
  
viacom.com	
  
206.220.43.92	
  
zappos.com	
  
66.209.92.150	
  
google.com	
  
69.63.189.16	
  
ucla.edu	
  
169.232.55.22
4	
  
xing.com	
  
213.238.60.19
0	
  
A_Map 
procedure Put (M : in out Map;	
 Key : ASU.Unbounded_String;	
 Value : ASU.Unbounded_String)	
begin	
 if M = null then	
 M := new Tree_Node'(Key, Value, null, null);	
 end if;	
 if Key = M.Key then	
 M.Value := Value;	
 elsif Key < M.Key then	
 Put (M.Left, Key, Value);	
 elsif Key > M.Key then	
 Put (M.Right, Key, Value);	
 end if;	
end Put;	
Key Value 
boingboing.net	
   204.11.50.136	
  
M 
procedure Put (M : in out Map;	
 Key : ASU.Unbounded_String;	
 Value : ASU.Unbounded_String)	
begin	
 if M = null then	
 M := new Tree_Node'(Key, Value, null, null);	
 return;	
 end if;	
 if Key = M.Key then	
 M.Value := Value;	
 elsif Key < M.Key then	
 Put (M.Left, Key, Value);	
 elsif Key > M.Key then	
 Put (M.Right, Key, Value);	
 end if;	
end Put;	
Key Value 
boingboing.net	
   204.11.50.136	
  
M 
GSyC - 2019 Tablas de Śımbolos 239
Ejemplo de ejecución: Put en un ABB
Put (A_Map,	
 ASU.To_Unbounded_String (“boingboing.net”),	
 ASU.To_Unbounded_String (“204.11.50.136”));	
nbc.com	
  
66.77.124.26	
  
facebook.com	
  
69.63.181.12	
  
yelp.com	
  
”	
  63.251.52.110	
  
viacom.com	
  
206.220.43.92	
  
zappos.com	
  
66.209.92.150	
  
google.com	
  
69.63.189.16	
  
ucla.edu	
  
169.232.55.22
4	
  
xing.com	
  
213.238.60.19
0	
  
A_Map 
procedure Put (M : in out Map;	
 Key : ASU.Unbounded_String;	
 Value : ASU.Unbounded_String)	
begin	
 if M = null then	
 M := new Tree_Node'(Key, Value, null, null);	
 end if;	
 if Key = M.Key then	
 M.Value := Value;	
 elsif Key < M.Key then	
 Put (M.Left, Key, Value);	
 elsif Key > M.Key then	
 Put (M.Right, Key, Value);	
 end if;	
end Put;	
Key Value 
boingboing.net	
   204.11.50.136	
  
M 
procedure Put (M : in out Map;	
 Key : ASU.Unbounded_String;	
 Value : ASU.Unbounded_String)	
begin	
 if M = null then	
 M := new Tree_Node'(Key, Value, null, null);	
 return;	
 end if;	
 if Key = M.Key then	
 M.Value := Value;	
 elsif Key < M.Key then	
 Put (M.Left, Key, Value);	
 elsif Key > M.Key then	
 Put (M.Right, Key, Value);	
 end if;	
end Put;	
Key Value 
boingboing.net	
   204.11.50.136	
  
M 
GSyC - 2019 Tablas de Śımbolos 240
Ejemplo de ejecución: Put en un ABB
Put (A_Map,	
 ASU.To_Unbounded_String (“boingboing.net”),	
 ASU.To_Unbounded_String (“204.11.50.136”));	
nbc.com	
  
66.77.124.26	
  
facebook.com	
  
69.63.181.12	
  
yelp.com	
  
”	
  63.251.52.110	
  
viacom.com	
  
206.220.43.92	
  
zappos.com	
  
66.209.92.150	
  
google.com	
  
69.63.189.16	
  
ucla.edu	
  
169.232.55.22
4	
  
xing.com	
  
213.238.60.19
0	
  
A_Map 
procedure Put (M : in out Map;	
 Key : ASU.Unbounded_String;	
 Value : ASU.Unbounded_String)	
begin	
 if M = null then	
 M := new Tree_Node'(Key, Value, null, null);	
 end if;	
 if Key = M.Key then	
 M.Value := Value;	
 elsif Key < M.Key then	
 Put (M.Left, Key, Value);	
 elsif Key > M.Key then	
 Put (M.Right, Key, Value);	
 end if;	
end Put;	
Key Value 
boingboing.net	
   204.11.50.136	
  
M 
procedure Put (M : in out Map;	
 Key : ASU.Unbounded_String;	
 Value : ASU.Unbounded_String)	
begin	
 if M = null then	
 M := new Tree_Node'(Key, Value, null, null);	
 return;	
 end if;	
 if Key = M.Key then	
 M.Value := Value;	
 elsif Key < M.Key then	
 Put (M.Left, Key, Value);	
 elsif Key > M.Key then	
 Put (M.Right, Key, Value);	
 end if;	
end Put;	
Key Value 
boingboing.net	
   204.11.50.136	
  
M 
GSyC - 2019 Tablas de Śımbolos 241
Ejemplo de ejecución: Put en un ABB
Put (A_Map,	
 ASU.To_Unbounded_String (“boingboing.net”),	
 ASU.To_Unbounded_String (“204.11.50.136”));	
nbc.com	
  
66.77.124.26	
  
facebook.com	
  
69.63.181.12	
  
yelp.com	
  
”	
  63.251.52.110	
  
viacom.com	
  
206.220.43.92	
  
zappos.com	
  
66.209.92.150	
  
google.com	
  
69.63.189.16	
  
ucla.edu	
  
169.232.55.22
4	
  
xing.com	
  
213.238.60.19
0	
  
A_Map 
procedure Put (M : in out Map;	
 Key : ASU.Unbounded_String;	
 Value : ASU.Unbounded_String)	
begin	
 if M = null then	
 M := new Tree_Node'(Key, Value, null, null);	
 end if;	
 if Key = M.Key then	
 M.Value := Value;	
 elsif Key < M.Key then	
 Put (M.Left, Key, Value);	
 elsif Key > M.Key then	
 Put (M.Right, Key, Value);	
 end if;	
end Put;	
Key Value 
boingboing.net	
   204.11.50.136	
  
M 
procedure Put (M : in out Map;	
 Key : ASU.Unbounded_String;	
 Value : ASU.Unbounded_String)	
begin	
 if M = null then	
 M := new Tree_Node'(Key, Value, null, null);	
 end if;	
 if Key = M.Key then	
 M.Value := Value;	
 elsif Key < M.Key then	
 Put (M.Left, Key, Value);	
 elsif Key > M.Key then	
 Put (M.Right, Key, Value);	
 end if;	
end Put;	
Key Value 
boingboing.net	
   204.11.50.136	
  
M 
procedure Put (M : in out Map;	
 Key : ASU.Unbounded_String;	
 Value : ASU.Unbounded_String)	
begin	
 if M = null then	
 M := new Tree_Node'(Key, Value, null, null);	
 return;	
 end if;	
 if Key = M.Key then	
 M.Value := Value;	
 elsif Key < M.Key then	
 Put (M.Left, Key, Value);	
 elsif Key > M.Key then	
 Put (M.Right, Key, Value);	
 end if;	
end Put;	
Key Value 
boingboing.net	
   204.11.50.136	
  
M 
GSyC - 2019 Tablas de Śımbolos 242
Ejemplo de ejecución: Put en un ABB
Put (A_Map,	
 ASU.To_Unbounded_String (“boingboing.net”),	
 ASU.To_Unbounded_String (“204.11.50.136”));	
nbc.com	
  
66.77.124.26	
  
facebook.com	
  
69.63.181.12	
  
yelp.com	
  
”	
  63.251.52.110	
  
viacom.com	
  
206.220.43.92	
  
zappos.com	
  
66.209.92.150	
  
google.com	
  
69.63.189.16	
  
ucla.edu	
  
169.232.55.22
4	
  
xing.com	
  
213.238.60.19
0	
  
A_Map 
procedure Put (M : in out Map;	
 Key : ASU.Unbounded_String;	
 Value : ASU.Unbounded_String)	
begin	
 if M = null then	
 M := new Tree_Node'(Key, Value, null, null);	
 end if;	
 if Key = M.Key then	
 M.Value := Value;	
 elsif Key < M.Key then	
 Put (M.Left, Key, Value);	
 elsif Key > M.Key then	
 Put (M.Right, Key, Value);	
 end if;	
end Put;	
Key Value 
boingboing.net	
   204.11.50.136	
  
M 
procedure Put (M : in out Map;	
 Key : ASU.Unbounded_String;	
 Value : ASU.Unbounded_String)	
begin	
 if M = null then	
 M := new Tree_Node'(Key, Value, null, null);	
 end if;	
 if Key = M.Key then	
 M.Value := Value;	
 elsif Key < M.Key then	
 Put (M.Left, Key, Value);	
 elsif Key > M.Key then	
 Put (M.Right, Key, Value);end if;	
end Put;	
Key Value 
boingboing.net	
   204.11.50.136	
  
M 
procedure Put (M : in out Map;	
 Key : ASU.Unbounded_String;	
 Value : ASU.Unbounded_String)	
begin	
 if M = null then	
 M := new Tree_Node'(Key, Value, null, null);	
 return;	
 end if;	
 if Key = M.Key then	
 M.Value := Value;	
 elsif Key < M.Key then	
 Put (M.Left, Key, Value);	
 elsif Key > M.Key then	
 Put (M.Right, Key, Value);	
 end if;	
end Put;	
Key Value 
boingboing.net	
   204.11.50.136	
  
M 
GSyC - 2019 Tablas de Śımbolos 243
Ejemplo de ejecución: Put en un ABB
Put (A_Map,	
 ASU.To_Unbounded_String (“boingboing.net”),	
 ASU.To_Unbounded_String (“204.11.50.136”));	
nbc.com	
  
66.77.124.26	
  
facebook.com	
  
69.63.181.12	
  
yelp.com	
  
”	
  63.251.52.110	
  
viacom.com	
  
206.220.43.92	
  
zappos.com	
  
66.209.92.150	
  
google.com	
  
69.63.189.16	
  
ucla.edu	
  
169.232.55.22
4	
  
xing.com	
  
213.238.60.19
0	
  
A_Map 
procedure Put (M : in out Map;	
 Key : ASU.Unbounded_String;	
 Value : ASU.Unbounded_String)	
begin	
 if M = null then	
 M := new Tree_Node'(Key, Value, null, null);	
 end if;	
 if Key = M.Key then	
 M.Value := Value;	
 elsif Key < M.Key then	
 Put (M.Left, Key, Value);	
 elsif Key > M.Key then	
 Put (M.Right, Key, Value);	
 end if;	
end Put;	
Key Value 
boingboing.net	
   204.11.50.136	
  
M 
procedure Put (M : in out Map;	
 Key : ASU.Unbounded_String;	
 Value : ASU.Unbounded_String)	
begin	
 if M = null then	
 M := new Tree_Node'(Key, Value, null, null);	
 end if;	
 if Key = M.Key then	
 M.Value := Value;	
 elsif Key < M.Key then	
 Put (M.Left, Key, Value);	
 elsif Key > M.Key then	
 Put (M.Right, Key, Value);	
 end if;	
end Put;	
Key Value 
boingboing.net	
   204.11.50.136	
  
M 
procedure Put (M : in out Map;	
 Key : ASU.Unbounded_String;	
 Value : ASU.Unbounded_String)	
begin	
 if M = null then	
 M := new Tree_Node'(Key, Value, null, null);	
 return;	
 end if;	
 if Key = M.Key then	
 M.Value := Value;	
 elsif Key < M.Key then	
 Put (M.Left, Key, Value);	
 elsif Key > M.Key then	
 Put (M.Right, Key, Value);	
 end if;	
end Put;	
Key Value 
boingboing.net	
   204.11.50.136	
  
M 
GSyC - 2019 Tablas de Śımbolos 244
Ejemplo de ejecución: Put en un ABB
Put (A_Map,	
 ASU.To_Unbounded_String (“boingboing.net”),	
 ASU.To_Unbounded_String (“204.11.50.136”));	
nbc.com	
  
66.77.124.26	
  
facebook.com	
  
69.63.181.12	
  
yelp.com	
  
”	
  63.251.52.110	
  
viacom.com	
  
206.220.43.92	
  
zappos.com	
  
66.209.92.150	
  
google.com	
  
69.63.189.16	
  
ucla.edu	
  
169.232.55.22
4	
  
xing.com	
  
213.238.60.19
0	
  
A_Map 
procedure Put (M : in out Map;	
 Key : ASU.Unbounded_String;	
 Value : ASU.Unbounded_String)	
begin	
 if M = null then	
 M := new Tree_Node'(Key, Value, null, null);	
 end if;	
 if Key = M.Key then	
 M.Value := Value;	
 elsif Key < M.Key then	
 Put (M.Left, Key, Value);	
 elsif Key > M.Key then	
 Put (M.Right, Key, Value);	
 end if;	
end Put;	
Key Value 
boingboing.net	
   204.11.50.136	
  
M 
procedure Put (M : in out Map;	
 Key : ASU.Unbounded_String;	
 Value : ASU.Unbounded_String)	
begin	
 if M = null then	
 M := new Tree_Node'(Key, Value, null, null);	
 end if;	
 if Key = M.Key then	
 M.Value := Value;	
 elsif Key < M.Key then	
 Put (M.Left, Key, Value);	
 elsif Key > M.Key then	
 Put (M.Right, Key, Value);	
 end if;	
end Put;	
Key Value 
boingboing.net	
   204.11.50.136	
  
M 
procedure Put (M : in out Map;	
 Key : ASU.Unbounded_String;	
 Value : ASU.Unbounded_String)	
begin	
 if M = null then	
 M := new Tree_Node'(Key, Value, null, null);	
 return;	
 end if;	
 if Key = M.Key then	
 M.Value := Value;	
 elsif Key < M.Key then	
 Put (M.Left, Key, Value);	
 elsif Key > M.Key then	
 Put (M.Right, Key, Value);	
 end if;	
end Put;	
Key Value 
boingboing.net	
   204.11.50.136	
  
M 
boingboing.net	
  
204.11.50.136	
  
GSyC - 2019 Tablas de Śımbolos 245
Ejemplo de ejecución: Put en un ABB
Put (A_Map,	
 ASU.To_Unbounded_String (“boingboing.net”),	
 ASU.To_Unbounded_String (“204.11.50.136”));	
nbc.com	
  
66.77.124.26	
  
facebook.com	
  
69.63.181.12	
  
yelp.com	
  
”	
  63.251.52.110	
  
viacom.com	
  
206.220.43.92	
  
zappos.com	
  
66.209.92.150	
  
google.com	
  
69.63.189.16	
  
ucla.edu	
  
169.232.55.22
4	
  
xing.com	
  
213.238.60.19
0	
  
A_Map 
procedure Put (M : in out Map;	
 Key : ASU.Unbounded_String;	
 Value : ASU.Unbounded_String)	
begin	
 if M = null then	
 M := new Tree_Node'(Key, Value, null, null);	
 end if;	
 if Key = M.Key then	
 M.Value := Value;	
 elsif Key < M.Key then	
 Put (M.Left, Key, Value);	
 elsif Key > M.Key then	
 Put (M.Right, Key, Value);	
 end if;	
end Put;	
Key Value 
boingboing.net	
   204.11.50.136	
  
M 
procedure Put (M : in out Map;	
 Key : ASU.Unbounded_String;	
 Value : ASU.Unbounded_String)	
begin	
 if M = null then	
 M := new Tree_Node'(Key, Value, null, null);	
 end if;	
 if Key = M.Key then	
 M.Value := Value;	
 elsif Key < M.Key then	
 Put (M.Left, Key, Value);	
 elsif Key > M.Key then	
 Put (M.Right, Key, Value);	
 end if;	
end Put;	
Key Value 
boingboing.net	
   204.11.50.136	
  
M 
procedure Put (M : in out Map;	
 Key : ASU.Unbounded_String;	
 Value : ASU.Unbounded_String)	
begin	
 if M = null then	
 M := new Tree_Node'(Key, Value, null, null);	
 return;	
 end if;	
 if Key = M.Key then	
 M.Value := Value;	
 elsif Key < M.Key then	
 Put (M.Left, Key, Value);	
 elsif Key > M.Key then	
 Put (M.Right, Key, Value);	
 end if;	
end Put;	
Key Value 
boingboing.net	
   204.11.50.136	
  
M 
boingboing.net	
  
204.11.50.136	
  
GSyC - 2019 Tablas de Śımbolos 246
Ejemplo de ejecución: Put en un ABB
Put (A_Map,	
 ASU.To_Unbounded_String (“boingboing.net”),	
 ASU.To_Unbounded_String (“204.11.50.136”));	
nbc.com	
  
66.77.124.26	
  
facebook.com	
  
69.63.181.12	
  
yelp.com	
  
”	
  63.251.52.110	
  
viacom.com	
  
206.220.43.92	
  
zappos.com	
  
66.209.92.150	
  
google.com	
  
69.63.189.16	
  
ucla.edu	
  
169.232.55.22
4	
  
xing.com	
  
213.238.60.19
0	
  
A_Map 
procedure Put (M : in out Map;	
 Key : ASU.Unbounded_String;	
 Value : ASU.Unbounded_String)	
begin	
 if M = null then	
 M := new Tree_Node'(Key, Value, null, null);	
 end if;	
 if Key = M.Key then	
 M.Value := Value;	
 elsif Key < M.Key then	
 Put (M.Left, Key, Value);	
 elsif Key > M.Key then	
 Put (M.Right, Key, Value);	
 end if;	
end Put;	
Key Value 
boingboing.net	
   204.11.50.136	
  
M 
procedure Put (M : in out Map;	
 Key : ASU.Unbounded_String;	
 Value : ASU.Unbounded_String)	
begin	
 if M = null then	
 M := new Tree_Node'(Key, Value, null, null);	
 end if;	
 if Key = M.Key then	
 M.Value := Value;	
 elsif Key < M.Key then	
 Put (M.Left, Key, Value);	
 elsif Key > M.Key then	
 Put (M.Right, Key, Value);	
 end if;	
end Put;	
Key Value 
boingboing.net	
   204.11.50.136	
  
M 
procedure Put (M : in out Map;	
 Key : ASU.Unbounded_String;	
 Value : ASU.Unbounded_String)	
begin	
 if M = null then	
 M := new Tree_Node'(Key, Value, null, null);	
 return;	
 end if;	
 if Key = M.Key then	
 M.Value := Value;	
 elsif Key < M.Key then	
 Put (M.Left, Key, Value);elsif Key > M.Key then	
 Put (M.Right, Key, Value);	
 end if;	
end Put;	
Key Value 
boingboing.net	
   204.11.50.136	
  
M 
boingboing.net	
  
204.11.50.136	
  
GSyC - 2019 Tablas de Śımbolos 247
Ejemplo de ejecución: Put en un ABB
Put (A_Map,	
 ASU.To_Unbounded_String (“boingboing.net”),	
 ASU.To_Unbounded_String (“204.11.50.136”));	
nbc.com	
  
66.77.124.26	
  
facebook.com	
  
69.63.181.12	
  
yelp.com	
  
”	
  63.251.52.110	
  
viacom.com	
  
206.220.43.92	
  
zappos.com	
  
66.209.92.150	
  
google.com	
  
69.63.189.16	
  
ucla.edu	
  
169.232.55.22
4	
  
xing.com	
  
213.238.60.19
0	
  
A_Map 
procedure Put (M : in out Map;	
 Key : ASU.Unbounded_String;	
 Value : ASU.Unbounded_String)	
begin	
 if M = null then	
 M := new Tree_Node'(Key, Value, null, null);	
 end if;	
 if Key = M.Key then	
 M.Value := Value;	
 elsif Key < M.Key then	
 Put (M.Left, Key, Value);	
 elsif Key > M.Key then	
 Put (M.Right, Key, Value);	
 end if;	
end Put;	
Key Value 
boingboing.net	
   204.11.50.136	
  
M 
procedure Put (M : in out Map;	
 Key : ASU.Unbounded_String;	
 Value : ASU.Unbounded_String)	
begin	
 if M = null then	
 M := new Tree_Node'(Key, Value, null, null);	
 end if;	
 if Key = M.Key then	
 M.Value := Value;	
 elsif Key < M.Key then	
 Put (M.Left, Key, Value);	
 elsif Key > M.Key then	
 Put (M.Right, Key, Value);	
 end if;	
end Put;	
Key Value 
boingboing.net	
   204.11.50.136	
  
M 
procedure Put (M : in out Map;	
 Key : ASU.Unbounded_String;	
 Value : ASU.Unbounded_String)	
begin	
 if M = null then	
 M := new Tree_Node'(Key, Value, null, null);	
 return;	
 end if;	
 if Key = M.Key then	
 M.Value := Value;	
 elsif Key < M.Key then	
 Put (M.Left, Key, Value);	
 elsif Key > M.Key then	
 Put (M.Right, Key, Value);	
 end if;	
end Put;	
Key Value 
boingboing.net	
   204.11.50.136	
  
M 
boingboing.net	
  
204.11.50.136	
  
GSyC - 2019 Tablas de Śımbolos 248
Ejemplo de ejecución: Put en un ABB
Put (A_Map,	
 ASU.To_Unbounded_String (“boingboing.net”),	
 ASU.To_Unbounded_String (“204.11.50.136”));	
nbc.com	
  
66.77.124.26	
  
facebook.com	
  
69.63.181.12	
  
yelp.com	
  
”	
  63.251.52.110	
  
viacom.com	
  
206.220.43.92	
  
zappos.com	
  
66.209.92.150	
  
google.com	
  
69.63.189.16	
  
ucla.edu	
  
169.232.55.22
4	
  
xing.com	
  
213.238.60.19
0	
  
A_Map 
procedure Put (M : in out Map;	
 Key : ASU.Unbounded_String;	
 Value : ASU.Unbounded_String)	
begin	
 if M = null then	
 M := new Tree_Node'(Key, Value, null, null);	
 end if;	
 if Key = M.Key then	
 M.Value := Value;	
 elsif Key < M.Key then	
 Put (M.Left, Key, Value);	
 elsif Key > M.Key then	
 Put (M.Right, Key, Value);	
 end if;	
end Put;	
Key Value 
boingboing.net	
   204.11.50.136	
  
M 
procedure Put (M : in out Map;	
 Key : ASU.Unbounded_String;	
 Value : ASU.Unbounded_String)	
begin	
 if M = null then	
 M := new Tree_Node'(Key, Value, null, null);	
 return;	
 end if;	
 if Key = M.Key then	
 M.Value := Value;	
 elsif Key < M.Key then	
 Put (M.Left, Key, Value);	
 elsif Key > M.Key then	
 Put (M.Right, Key, Value);	
 end if;	
end Put;	
Key Value 
boingboing.net	
   204.11.50.136	
  
M 
boingboing.net	
  
204.11.50.136	
  
GSyC - 2019 Tablas de Śımbolos 249
Ejemplo de ejecución: Put en un ABB
Put (A_Map,	
 ASU.To_Unbounded_String (“boingboing.net”),	
 ASU.To_Unbounded_String (“204.11.50.136”));	
nbc.com	
  
66.77.124.26	
  
facebook.com	
  
69.63.181.12	
  
yelp.com	
  
”	
  63.251.52.110	
  
viacom.com	
  
206.220.43.92	
  
zappos.com	
  
66.209.92.150	
  
google.com	
  
69.63.189.16	
  
ucla.edu	
  
169.232.55.22
4	
  
xing.com	
  
213.238.60.19
0	
  
A_Map 
procedure Put (M : in out Map;	
 Key : ASU.Unbounded_String;	
 Value : ASU.Unbounded_String)	
begin	
 if M = null then	
 M := new Tree_Node'(Key, Value, null, null);	
 end if;	
 if Key = M.Key then	
 M.Value := Value;	
 elsif Key < M.Key then	
 Put (M.Left, Key, Value);	
 elsif Key > M.Key then	
 Put (M.Right, Key, Value);	
 end if;	
end Put;	
Key Value 
boingboing.net	
   204.11.50.136	
  
M 
procedure Put (M : in out Map;	
 Key : ASU.Unbounded_String;	
 Value : ASU.Unbounded_String)	
begin	
 if M = null then	
 M := new Tree_Node'(Key, Value, null, null);	
 return;	
 end if;	
 if Key = M.Key then	
 M.Value := Value;	
 elsif Key < M.Key then	
 Put (M.Left, Key, Value);	
 elsif Key > M.Key then	
 Put (M.Right, Key, Value);	
 end if;	
end Put;	
Key Value 
boingboing.net	
   204.11.50.136	
  
M 
boingboing.net	
  
204.11.50.136	
  
GSyC - 2019 Tablas de Śımbolos 250
Ejemplo de ejecución: Put en un ABB
Put (A_Map,	
 ASU.To_Unbounded_String (“boingboing.net”),	
 ASU.To_Unbounded_String (“204.11.50.136”));	
nbc.com	
  
66.77.124.26	
  
yelp.com	
  
”	
  63.251.52.110	
  
viacom.com	
  
206.220.43.92	
  
zappos.com	
  
66.209.92.150	
  
ucla.edu	
  
169.232.55.22
4	
  
xing.com	
  
213.238.60.19
0	
  
A_Map 
boingboing.net	
  
204.11.50.136	
  
facebook.com	
  
69.63.181.12	
  
google.com	
  
69.63.189.16	
  
procedure Put (M : in out Map;	
 Key : ASU.Unbounded_String;	
 Value : ASU.Unbounded_String)	
begin	
 if M = null then	
 M := new Tree_Node'(Key, Value, null, null);	
 return;	
 end if;	
 if Key = M.Key then	
 M.Value := Value;	
 elsif Key < M.Key then	
 Put (M.Left, Key, Value);	
 elsif Key > M.Key then	
 Put (M.Right, Key, Value);	
 end if;	
end Put;	
Key Value 
boingboing.net	
   204.11.50.136	
  
M 
GSyC - 2019 Tablas de Śımbolos 251
Ejemplo de ejecución: Put en un ABB
Put (A_Map,	
 ASU.To_Unbounded_String (“boingboing.net”),	
 ASU.To_Unbounded_String (“204.11.50.136”));	
nbc.com	
  
66.77.124.26	
  
facebook.com	
  
69.63.181.12	
  
yelp.com	
  
”	
  63.251.52.110	
  
viacom.com	
  
206.220.43.92	
  
zappos.com	
  
66.209.92.150	
  
google.com	
  
69.63.189.16	
  
ucla.edu	
  
169.232.55.22
4	
  
xing.com	
  
213.238.60.19
0	
  
A_Map 
boingboing.net	
  
204.11.50.136	
  
procedure Put (M : in out Map;	
 Key : ASU.Unbounded_String;	
 Value : ASU.Unbounded_String)	
begin	
 if M = null then	
 M := new Tree_Node'(Key, Value, null, null);	
 return;	
 end if;	
 if Key = M.Key then	
 M.Value := Value;	
 elsif Key < M.Key then	
 Put (M.Left, Key, Value);	
 elsif Key > M.Key then	
 Put (M.Right, Key, Value);	
 end if;	
end Put;	
Key Value 
boingboing.net	
   204.11.50.136	
  
M 
GSyC - 2019 Tablas de Śımbolos 252
Ejemplo de ejecución: Put en un ABB
wings.com	
  
12.155.29.35	
  
boingboing.net	
  
204.11.50.136	
  
A_Map 
nbc.com	
  
66.77.124.26	
  
facebook.com	
  
69.63.181.12	
  
yelp.com	
  
”	
  63.251.52.110	
  
viacom.com	
  
206.220.43.92	
  
zappos.com	
  
66.209.92.150	
  
google.com	
  
69.63.189.16	
  
Put (A_Map,	
 ASU.To_Unbounded_String (“boingboing.net”),	
 ASU.To_Unbounded_String (“204.11.50.136”));	
ucla.edu	
  
169.232.55.22
4	
  
xing.com	
  
213.238.60.19
0	
  
GSyC - 2019 Tablas de Śımbolos 253
Borrado de un nodo en un ABB
Contenidos
1 Tablas de Śımbolos
2 Implementación de TS mediante un array no ordenado
3 Implementación de TS mediante una lista enlazada no ordenada
4 Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
5 Iteración sobre todos los elementos de una colección
6 Implementación de TS mediante un Array ordenado
7 Implementación de TS mediante una lista enlazada ordenada
8 Implementaciónde TS mediante un árbol de búsqueda binaria (ABB)
9 Ejemplo de ejecución: Get en un ABB
10 Ejemplo de ejecución: Put en un ABB vaćıo
11 Ejemplo de ejecución: Put en un ABB
12 Borrado de un nodo en un ABB
GSyC - 2019 Tablas de Śımbolos 254
Borrado de un nodo en un ABB
Borrado de un nodo
También requiere buscar el nodo a borrar, pero una vez localizado
el nodo a borrar surgen varios casos:
1 Borrado de un nodo que no tiene hijos
2 Borrado de un nodo que sólo tiene un subárbol hijo
3 Borrado de un nodo con dos subárboles hijos
GSyC - 2019 Tablas de Śımbolos 255
Borrado de un nodo en un ABB
1. Borrado de un nodo j que no tiene hijos
Se asigna null al campo (Left o Right) que apunta a j en el nodo
padre de j
GSyC - 2019 Tablas de Śımbolos 256
Borrado de un nodo en un ABB
Key	
  
”	
  Value	
  
LeF	
   Right	
  
	
  bbva.es	
  
195.76.187.83”	
  
nbc.com	
  
66.77.124.26	
  
facebook.com	
  
69.63.181.12	
  
yelp.com	
  
”	
  63.251.52.110	
  
viacom.com	
  
206.220.43.92	
  
zappos.com	
  
66.209.92.150	
  
google.com	
  
69.63.189.16	
  
cbs.com	
  
198.99.118.37	
  
ucla.edu	
  
169.232.55.22
4	
  
xing.com	
  
213.238.60.19
0	
  
wings.com	
  
12.155.29.35	
  
Delete (A_Map, ASU.To_Unbounded_String (“edi.com”), Success);	
edi.com	
  
192.86.2.98	
  
GSyC - 2019 Tablas de Śımbolos 257
Borrado de un nodo en un ABB
Key	
  
”	
  Value	
  
LeF	
   Right	
  
	
  bbva.es	
  
195.76.187.83”	
  
nbc.com	
  
66.77.124.26	
  
facebook.com	
  
69.63.181.12	
  
yelp.com	
  
”	
  63.251.52.110	
  
viacom.com	
  
206.220.43.92	
  
zappos.com	
  
66.209.92.150	
  
google.com	
  
69.63.189.16	
  
cbs.com	
  
198.99.118.37	
  
ucla.edu	
  
169.232.55.22
4	
  
xing.com	
  
213.238.60.19
0	
  
wings.com	
  
12.155.29.35	
  
Delete (A_Map, ASU.To_Unbounded_String (“edi.com”), Success);	
GSyC - 2019 Tablas de Śımbolos 258
Borrado de un nodo en un ABB
Key	
  
”	
  Value	
  
LeF	
   Right	
  
	
  bbva.es	
  
195.76.187.83”	
  
nbc.com	
  
66.77.124.26	
  
facebook.com	
  
69.63.181.12	
  
yelp.com	
  
”	
  63.251.52.110	
  
viacom.com	
  
206.220.43.92	
  
zappos.com	
  
66.209.92.150	
  
google.com	
  
69.63.189.16	
  
cbs.com	
  
198.99.118.37	
  
ucla.edu	
  
169.232.55.22
4	
  
xing.com	
  
213.238.60.19
0	
  
wings.com	
  
12.155.29.35	
  
Delete (A_Map, ASU.To_Unbounded_String (“edi.com”), Success);	
GSyC - 2019 Tablas de Śımbolos 259
Borrado de un nodo en un ABB
2. Borrado de un nodo j que sólo tiene un subárbol hijo
Si j sólo tiene un subárbol derecho, se asigna j .Right al
campo (Left o Right) que apunta a j en el nodo padre de j
Si j sólo tiene un subárbol izquierdo, se asigna j .Left al
campo (Left o Right) que apunta a j en el nodo padre de j
GSyC - 2019 Tablas de Śımbolos 260
Borrado de un nodo en un ABB
nbc.com	
  
66.77.124.26	
  
facebook.com	
  
69.63.181.12	
  
yelp.com	
  
”	
  63.251.52.110	
  
viacom.com	
  
206.220.43.92	
  
zappos.com	
  
66.209.92.150	
  
google.com	
  
69.63.189.16	
  
cbs.com	
  
198.99.118.37	
  
ucla.edu	
  
169.232.55.22
4	
  
xing.com	
  
213.238.60.19
0	
  
edi.com	
  
192.86.2.98	
  
wings.com	
  
12.155.29.35	
  
Key	
  
”	
  Value	
  
LeF	
   Right	
  
195.76.187.83”	
  
	
  bbva.es	
  
Delete (A_Map, ASU.To_Unbounded_String (“bbva.es”), Success);	
GSyC - 2019 Tablas de Śımbolos 261
Borrado de un nodo en un ABB
nbc.com	
  
66.77.124.26	
  
facebook.com	
  
69.63.181.12	
  
yelp.com	
  
”	
  63.251.52.110	
  
viacom.com	
  
206.220.43.92	
  
zappos.com	
  
66.209.92.150	
  
google.com	
  
69.63.189.16	
  
cbs.com	
  
198.99.118.37	
  
ucla.edu	
  
169.232.55.22
4	
  
xing.com	
  
213.238.60.19
0	
  
edi.com	
  
192.86.2.98	
  
wings.com	
  
12.155.29.35	
  
Key	
  
”	
  Value	
  
LeF	
   Right	
  
Delete (A_Map, ASU.To_Unbounded_String (“bbva.es”), Success);	
GSyC - 2019 Tablas de Śımbolos 262
Borrado de un nodo en un ABB
nbc.com	
  
66.77.124.26	
  
facebook.com	
  
69.63.181.12	
  
yelp.com	
  
”	
  63.251.52.110	
  
viacom.com	
  
206.220.43.92	
  
zappos.com	
  
66.209.92.150	
  
google.com	
  
69.63.189.16	
  
cbs.com	
  
198.99.118.37	
  
ucla.edu	
  
169.232.55.22
4	
  
xing.com	
  
213.238.60.19
0	
  
edi.com	
  
192.86.2.98	
  
wings.com	
  
12.155.29.35	
  
Key	
  
”	
  Value	
  
LeF	
   Right	
  
Delete (A_Map, ASU.To_Unbounded_String (“bbva.es”), Success);	
GSyC - 2019 Tablas de Śımbolos 263
Borrado de un nodo en un ABB
3. Borrado de un nodo j con dos subárboles hijos
Problema:
Hay un sólo enlace apuntando al nodo j que se borra en su nodo
padre, pero j apunta a dos subárboles hijos.
GSyC - 2019 Tablas de Śımbolos 264
Borrado de un nodo en un ABB
	
  bbva.es	
  
195.76.187.83”	
  
nbc.com	
  
66.77.124.26	
  
facebook.com	
  
69.63.181.12	
  
yelp.com	
  
”	
  63.251.52.110	
  
zappos.com	
  
66.209.92.150	
  
google.com	
  
69.63.189.16	
  
cbs.com	
  
198.99.118.37	
  
ucla.edu	
  
169.232.55.22
4	
  
xing.com	
  
213.238.60.19
0	
  
edi.com	
  
192.86.2.98	
  
wings.com	
  
12.155.29.35	
  
Key	
  
”	
  Value	
  
LeF	
   Right	
  
viacom.com	
  
206.220.43.92	
  
Delete (A_Map, ASU.To_Unbounded_String (“viacom.com”), Success);	
GSyC - 2019 Tablas de Śımbolos 265
Borrado de un nodo en un ABB
	
  bbva.es	
  
195.76.187.83”	
  
nbc.com	
  
66.77.124.26	
  
facebook.com	
  
69.63.181.12	
  
yelp.com	
  
”	
  63.251.52.110	
  
zappos.com	
  
66.209.92.150	
  
google.com	
  
69.63.189.16	
  
cbs.com	
  
198.99.118.37	
  
ucla.edu	
  
169.232.55.22
4	
  
xing.com	
  
213.238.60.19
0	
  
edi.com	
  
192.86.2.98	
  
wings.com	
  
12.155.29.35	
  
Key	
  
”	
  Value	
  
LeF	
   Right	
  
?	
  
Si	
  eliminamos	
  el	
  nodo	
  dejamos	
  
dos	
  subárboles	
  huérfanos,	
  y	
  sólo	
  	
  
disponemos	
  de	
  LeF	
  en	
  el	
  padre.	
  
OJO:	
  aunque	
  el	
  enlace	
  Right	
  del	
  	
  
padre	
  no	
  apuntase	
  a	
  otro	
  subárbol	
  
no	
  podríamos	
  usarlo	
  para	
  enlazar	
  
el	
  otro	
  huérfano	
  pues	
  se	
  
rompería	
  la	
  ordenación	
  de	
  nodos	
  
Delete (A_Map, ASU.To_Unbounded_String (“viacom.com”), Success);	
GSyC - 2019 Tablas de Śımbolos 266
Borrado de un nodo en un ABB
3. Borrado de un nodo j con dos subárboles hijos
Solución: sustituir el nodo j que se quiere borrar por su sucesor y
borrar el sucesor
1 Se sustituye j .(Key ,Value) por succ(j).(Key ,Value), siendo
succ(j) el nodo cuya clave sucede a la de j en el árbol:
j .Key < succ(j).Key y
no existe un nodo m tal que j .Key < m.Key < succ(j).Key
2 Se borra succ(j)
El nodo succ(j) no puede tener subárbol izquierdo, como
mucho sólo tendrá derecho. Si tuviera un subárbol izquierdo no
seŕıa el succ(j).
De esta forma se preserva el orden entre los nodos
GSyC - 2019 Tablas de Śımbolos 267
Borrado de un nodo en un ABB
	
  bbva.es	
  
195.76.187.83”	
  
nbc.com	
  
66.77.124.26	
  
facebook.com	
  
69.63.181.12	
  
yelp.com	
  
”	
  63.251.52.110	
  
zappos.com	
  
66.209.92.150	
  
google.com	
  
69.63.189.16	
  
cbs.com	
  
198.99.118.37	
  
ucla.edu	
  
169.232.55.22
4	
  
xing.com	
  
213.238.60.19
0	
  
edi.com	
  
192.86.2.98	
  
Key	
  
”	
  Value	
  
LeF	
   Right	
  
S	
  
wings.com	
  
12.155.29.35	
   succ	
  (“viacom.com”)	
  
viacom.com	
  
206.220.43.92	
  
Delete (A_Map, ASU.To_Unbounded_String (“viacom.com”), Success);	
GSyC - 2019 Tablas de Śımbolos 268
Borrado de un nodo en un ABB
	
  bbva.es	
  
195.76.187.83”	
  
nbc.com	
  
66.77.124.26	
  
facebook.com	
  
69.63.181.12	
  
yelp.com	
  
”	
  63.251.52.110	
  
zappos.com	
  
66.209.92.150	
  
google.com	
  
69.63.189.16	
  
cbs.com	
  
198.99.118.37	
  
ucla.edu	
  
169.232.55.22
4	
  
xing.com	
  
213.238.60.19
0	
  
edi.com	
  
192.86.2.98	
  
Key	
  
”	
  Value	
  
LeF	
   Right	
  
wings.com	
  
12.155.29.35	
  
wings.com	
  
12.155.29.35Se	
  copian	
  succ	
  (“viacom.com”).Key	
  
y	
  succ(“viacom.com”).Value	
  	
  
al	
  nodo	
  que	
  se	
  quiere	
  eliminar	
  
Delete (A_Map, ASU.To_Unbounded_String (“viacom.com”), Success);	
GSyC - 2019 Tablas de Śımbolos 269
Borrado de un nodo en un ABB
	
  bbva.es	
  
195.76.187.83”	
  
nbc.com	
  
66.77.124.26	
  
facebook.com	
  
69.63.181.12	
  
yelp.com	
  
”	
  63.251.52.110	
  
zappos.com	
  
66.209.92.150	
  
google.com	
  
69.63.189.16	
  
cbs.com	
  
198.99.118.37	
  
ucla.edu	
  
169.232.55.22
4	
  
xing.com	
  
213.238.60.19
0	
  
edi.com	
  
192.86.2.98	
  
Key	
  
”	
  Value	
  
LeF	
   Right	
  
wings.com	
  
12.155.29.35	
  
wings.com	
  
12.155.29.35	
   Ahora	
  se	
  elimina	
  succ	
  (“viacom.com”)	
  
Delete (A_Map, ASU.To_Unbounded_String (“viacom.com”), Success);	
GSyC - 2019 Tablas de Śımbolos 270
Borrado de un nodo en un ABB
	
  bbva.es	
  
195.76.187.83”	
  
nbc.com	
  
66.77.124.26	
  
facebook.com	
  
69.63.181.12	
  
yelp.com	
  
”	
  63.251.52.110	
  
zappos.com	
  
66.209.92.150	
  
google.com	
  
69.63.189.16	
  
cbs.com	
  
198.99.118.37	
  
ucla.edu	
  
169.232.55.22
4	
  
xing.com	
  
213.238.60.19
0	
  
edi.com	
  
192.86.2.98	
  
Key	
  
”	
  Value	
  
LeF	
   Right	
  
wings.com	
  
12.155.29.35	
  
Ahora	
  se	
  elimina	
  succ	
  (“viacom.com”)	
  
Delete (A_Map, ASU.To_Unbounded_String (“viacom.com”), Success);	
GSyC - 2019 Tablas de Śımbolos 271
Borrado de un nodo en un ABB
	
  bbva.es	
  
195.76.187.83”	
  
nbc.com	
  
66.77.124.26	
  
facebook.com	
  
69.63.181.12	
  
yelp.com	
  
”	
  63.251.52.110	
  
zappos.com	
  
66.209.92.150	
  
google.com	
  
69.63.189.16	
  
cbs.com	
  
198.99.118.37	
  
ucla.edu	
  
169.232.55.22
4	
  
xing.com	
  
213.238.60.19
0	
  
edi.com	
  
192.86.2.98	
  
Key	
  
”	
  Value	
  
LeF	
   Right	
  
wings.com	
  
12.155.29.35	
  
Ahora	
  se	
  elimina	
  succ	
  (“viacom.com”)	
  
Delete (A_Map, ASU.To_Unbounded_String (“viacom.com”), Success);	
GSyC - 2019 Tablas de Śımbolos 272
Borrado de un nodo en un ABB
3. Borrado de un nodo j con dos subárboles hijos
¿Cómo programamos succ(j)?
succ(j) = min(j .Right)
succ(j) es el nodo ḿınimo del subárbol derecho de j : el que
tiene la menor clave
Para encontrar el nódo ḿınimo de un árbol se recorre
recursivamente desde la ráız el árbol a través de los hijos
izquierdos hasta encontrar un nodo que no tenga hijo
izquierdo.
Borrado del nodo ḿınimo de un árbol
El nodo ḿınimo de un árbol no tiene hijo izquierdo, por lo que
ya sabemos cómo borrarlo
GSyC - 2019 Tablas de Śımbolos 273
Borrado de un nodo en un ABB
3. Borrado de un nodo j con dos subárboles hijos:
Programación
package Maps is
package ASU renames Ada.Strings.Unbounded;
type Map is limited private;
...
procedure Delete (M : in out Map;
Key : in Asu.Unbounded_String;
Success : out Boolean);
private
...
end Maps;
GSyC - 2019 Tablas de Śımbolos 274
Borrado de un nodo en un ABB
3. Borrado de un nodo j con dos subárboles hijos:
Programación
package body Maps is
...
function Delete_Min (M : Map) return Map is
begin
...
end Delete_Min;
procedure Delete (M : in out Map;
Key : in Asu.Unbounded_String;
Success : out Boolean) is
begin
...
end Delete;
end Maps;
GSyC - 2019 Tablas de Śımbolos 275
Borrado de un nodo en un ABB
Resumen
Tabla de Śımbolos
La tabla de śımbolos es una estructura de datos que almacena elementos
compuestos por parejas (Clave, Valor)
Clave y Valor pueden ser tipos de datos cualesquiera
Tiene tres operaciones básicas:
Put: Dado un nuevo elemento (Clave, Valor) como parámetro, se añade
éste a la tabla. Si ya exist́ıa un elemento con la misma Clave, se sustituye
su Valor asociado por el especificado en la llamada a Put
Get: Dada una Clave como parámetro, devuelve el Valor asociado a la
misma en la tabla en caso de que exista un elemento (Clave, Valor)
Delete: Dada un Clave como parámetro, se borra de la tabla, si existe, el
elemento (Clave, Valor)
Implementaciones de una tabla de śımbolos
Mediante un Array no ordenado
Mediante una Lista enlazada no ordenada
Mediante un Array ordenado con búsqueda binaria
Mediante una Lista enlazada ordenada
Mediante un Árbol de búsqueda binaria
GSyC - 2019 Tablas de Śımbolos 276
	Tablas de Símbolos
	Implementación de TS mediante un array no ordenado
	Implementación de TS mediante una lista enlazada no ordenada
	Ejemplo de ejecución (TS mediante lista enlazada no ordenada)
	Iteración sobre todos los elementos de una colección
	Implementación de TS mediante un Array ordenado
	Implementación de TS mediante una lista enlazada ordenada
	Implementación de TS mediante un árbol de búsqueda binaria (ABB)
	Ejemplo de ejecución: Get en un ABB
	Ejemplo de ejecución: Put en un ABB vacío
	Ejemplo de ejecución: Put en un ABB
	Borrado de un nodo en un ABB