You are on page 1of 2

Taller de Complejidad Computacional

Estructuras de datos Grupo 100


Agosto 19, 2016
1 Equaciones de recurrencia
Resuelva las siguientes equaciones de recurrencia con condicion inicial T (1) = 1.
T (n) = T ( n2 ) + 1.
T (n) = T ( n2 ) + n.
T (n) = 2T ( n2 ) + 1.
T (n) = 2T (n 1) + 1.
T (n) = 2T (n 1) + n.

2 Ordenamiento
El problema de ordnar los datos de un arreglo es com
un en computacion. Por esto existen
varios algoritmos que lo solucionan. Consulte los siguientes algoritmos y sus respectivas
implementaciones:
Selectionsort
1
2
3
4
5
6
7
8
9
10
11
12

void selectionSort(int[] array, int size, int startIndex) {


if ( startIndex >= size - 1 ) return;
int minIndex = startIndex;
for ( int index = startIndex + 1; index < size; index++ ) {
if (array[index] < array[minIndex] )
minIndex = index;
}
int temp = array[startIndex];
array[startIndex] = array[minIndex];
array[minIndex] = temp;
selectionSort(array, size, startIndex + 1);
}

Mergesort
Quicksort
Adicionalmente especifique las ecuaciones de recurrencia para cada uno de las implementaciones.

You might also like