Skip to content

Instantly share code, notes, and snippets.

View Samu31Nd's full-sized avatar
🍃
Studying 24/7

Samuel Leyva Samu31Nd

🍃
Studying 24/7
  • Mexico City
  • 00:43 (UTC -06:00)
View GitHub Profile
@Samu31Nd
Samu31Nd / algorithmComplexity.c
Last active March 24, 2023 07:45
Algorithms Complexity
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <unistd.h>
#include <math.h>
#define VAL_MAX 500
#define SPACING 8
#define MAX_SHOWING 50
@Samu31Nd
Samu31Nd / mergeSort.c
Last active March 20, 2023 16:57
Merge sort with centinella values
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <unistd.h>
#include <math.h>
#define VAL_MAX 500
#define SPACING 8
#define MAX_SHOWING 50
@Samu31Nd
Samu31Nd / insertionAlgorithm.c
Last active March 15, 2023 17:54
Practica 1 - Complejidad de algoritmos
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <unistd.h>
void askUserData(int*);
int *createDinamicArray(int);
void fillArrWRandVar(int*,int);
void showArr(int*,int);
@Samu31Nd
Samu31Nd / PilaDina.c
Created December 8, 2022 19:26
Pilas Dinamicas [NODOS]
#include "PilaDina.h"
#include <stdio.h>
#include <stdlib.h>
// Archivo pilaDina.c
// CREACION DE UNA PILA VAC�A
PILA crearPila ( ){
PILA S;
S = (PILA)malloc(sizeof(Pila));
if( S == NULL){
@Samu31Nd
Samu31Nd / ColaDina.c
Created December 8, 2022 19:25
Colas Dinamicas [NODOS]
// Archivo de colaDina.c
#include "ColaDina.h"
#include <stdio.h>
#include <stdlib.h>
// CREACION DE UNA COLA VAC�A
COLA crearCola ( ){
COLA C;
C = (COLA)malloc(sizeof(Cola));
if( C == NULL){
@Samu31Nd
Samu31Nd / Pilas.c
Created December 2, 2022 21:21
Problema 7 [TDA Pilas]
#include "Pilas.h"
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
PILA crearPila() {
PILA tmp = (PILA)malloc(sizeof(pila));
if (tmp == NULL) {
manejaError(0);
exit(-1);
@Samu31Nd
Samu31Nd / Pilas.c
Created December 2, 2022 20:45
Problema 6 [TDA Pilas]
#include "Pilas.h"
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
PILA crearPila() {
PILA tmp = (PILA)malloc(sizeof(pila));
if (tmp == NULL) {
manejaError(0);
exit(-1);
@Samu31Nd
Samu31Nd / Pilas.c
Created December 2, 2022 19:42
Problema 5 [TDA Pilas]
#include "Pilas.h"
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
PILA crearPila() {
PILA tmp = (PILA)malloc(sizeof(pila));
if (tmp == NULL) {
manejaError(0);
exit(-1);
@Samu31Nd
Samu31Nd / Cola.c
Last active December 2, 2022 01:54
Colas
//Cola.c
#include "Cola.h"
void manejaMsg(int op){
char *msg[] = {
"\nError: Cola llena. ",
"\nError: Cola vacia. ",
"Se ha liberado la cola... "
};
fprintf(stderr,"%s",msg[op]);
@Samu31Nd
Samu31Nd / Pilas.c
Created November 28, 2022 05:04
Problema 4 [TDA Pilas]
#include "Pilas.h"
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
PILA crearPila() {
PILA tmp = (PILA)malloc(sizeof(pila));
if (tmp == NULL) {
manejaError(0);
exit(-1);