Professional Documents
Culture Documents
Seminario de Grado
Modulo: Algoritmos y Estructura de Datos
α … (α +1) …. … (α + n)
Arreglos - Vectores
Axiomatización
Columnas n
Numero de elemento m x n, cuando m=n Matriz Cuadrada
Cuando m=1 es un Vector
Representación de Matrices
mxn 1 2 … mx
V
A n
K=1,2,…mxn
i = (k-1) / n + 1
j = k - (i -1 ) * n
k = (i-1) * n + j
Matrices Esparcidas (SPARCE)
1 0 0 0 3
3x5
A 2 0 0 0 0
0 1 3 4 0
Ejercicios en clase
b) C = A + B (esparcidas)
Trabajo Practico
In
Exit
Problema a resolver
NO NE
i -1
(i-1, j-1) (i-1, j) (i-1, j+1)
Swap(Array,Index,Index) Array
F Xeqaul(Array,Index,Value) Bollean
MaxV(Array,Index,Index) Array
Equal(index,index) Bolean
А
A Є Array i, j Є Index x Є Value
A Retrieve(Create,i)::= error
Retrieve(Store(A,i,x),j)::= If Equal(i,j) Then x Else Retrieve(A,j)
Definición Formal
Structure Array(Value,index)
Declare Create() Array
Retrive(Array,Index) Vakue
F Store(Array,Index,Value) Array
Funciones
Swap(Array,Index,Index) Array
Equal(index,index) Bolean
А
A Є Array i, j Є Index x Є Value
Retrieve(Create,i)::= error
A Retrieve(Store(A,i,x),j)::= Axiomas
If Equal(i,j) Then x Else Retrieve(A,j)