This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Universidad Autonoma de Aguascalientes | |
// Centro de Ciencias Basicas | |
// Departamento de Ciencaas de la Computacion | |
// Programacion Cientifica | |
// Diego Emilio Moreno Sánchez | |
// Profesor: Dr. en C. Luis Fernando Gutiérrez Marfileño | |
// Programa que calcula la raiz de una funcion utilizando el metodo de punto fijo | |
// funcion f(x) = e^-x - x |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Universidad Autonoma de Aguascalientes | |
// Centro de Ciencias Basicas | |
// Departamento de Ciencaas de la Computacion | |
// Programacion Cientifica | |
// Diego Emilio Moreno Sánchez | |
// Profesor: Dr. en C. Luis Fernando Gutiérrez Marfileño | |
// Programa que calcula el valor de tan(x) | |
// para un valor de x, utilizando series de Taylor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Diego Emilio Moreno Sanchez | |
#include <iostream> | |
using namespace std; | |
int binarySearch(int arr[], int n, int low, int high) { | |
if (high <= low) | |
return (n > arr[low])? (low + 1): low; | |
int mid = (low + high) / 2; | |
if(n == arr[mid]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Diego Emilio Moreno Sánchez | |
#include <iostream> | |
#include <stdlib.h> | |
using namespace std; | |
bool busquedaBinaria(int arr[], int tam, int valor) { | |
int inicio = 0; | |
int fin = tam - 1; | |
int medio; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Diego Emilio Moreno Sánchez | |
#include <iostream> | |
using namespace std; | |
struct Nodo { | |
int dato; | |
Nodo* der; | |
Nodo* izq; | |
Nodo* padre; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Diego Emilio Moreno Sanchez | |
#include <iostream> | |
using namespace std; | |
void bubbleSort(int arr[], int n) { | |
for(int i = 0; i < n; i++) { | |
for(int j = 0; j < n - 1; j++) { | |
if(arr[j] > arr[j + 1]) { | |
int temp = arr[j]; | |
arr[j] = arr[j + 1]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Diego Emilio Moreno Sánchez | |
#include <iostream> | |
using namespace std; | |
bool busquedaSecuencial(int arr[], int tam, int valor) { | |
for (int i = 0; i < tam; i++) { | |
if (arr[i] == valor) { | |
return true; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Diego Emilio Moreno Sanchez | |
#include <iostream> | |
using namespace std; | |
void directInsertion(int arr[], int n) { | |
int i, j, aux; | |
for (i = 1; i < n; i++) { | |
j = i; | |
aux = arr[i]; | |
while (j > 0 && arr[j - 1] > aux) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Diego Emilio Moreno Sanchez | |
#include <iostream> | |
using namespace std; | |
void mergeSort(int arr1[], int n1, int arr2[], int n2, int arr3[]) { | |
int i = 0, j = 0, k = 0, p; | |
while (i < n1 && j < n2) { | |
if (arr1[i] < arr2[j]) { | |
arr3[k] = arr1[i]; | |
i++; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Diego Emilio Moreno Sánchez | |
#include <iostream> | |
using namespace std; | |
void quickSort(int *arr, int left, int right) { | |
if (left < right) { | |
int pivot = arr[left]; | |
int i = left + 1; | |
int j = right; | |
while (i <= j) { |
OlderNewer