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
#include <stdio.h> | |
#include <stdlib.h> | |
#define SIZE 1000000 | |
typedef struct item { | |
int entrada, | |
saida; | |
} ITEM; |
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
#include <stdio.h> | |
#include <stdlib.h> | |
typedef char STACK_TYPE; | |
typedef struct { | |
int index; | |
int capacity; | |
STACK_TYPE *values; | |
} STACK; |
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
"use strict"; | |
/* | |
Esse programa foi feito para transformar expressões da notação infixa para a pós-fixada (polonesa inversa) e vice-versa. | |
*/ | |
function infixToPosfix (infixExpression) { | |
const postfixExpression = [] |
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
/* | |
Maratona de Programação da SBC - ACM ICPC - 2016 | |
Problema I | |
*/ | |
#include <stdio.h> | |
#include <stdlib.h> | |
#define TAMANHO_MAXIMO 50000 |
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
{ | |
São Paulo, 14 de setembro de 2016. | |
FATEC-SP | |
Pilhas em Pascal | |
} | |
program prog_pilha; |
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
#include <stdio.h> | |
#include <string.h> | |
void insertion_ints(int v[], int n); | |
void insertion_chars(char v[], int n); | |
void insertion_strings(char* v[], int n); | |
int main (void) { | |
int 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
/* | |
Implementação de PriorityQueue com Binary Heap. | |
JavaScript ES6 | |
*/ | |
class PrioriryQueue { | |
constructor (cmp = (a, b) => a > b) { | |
this.array = [null]; | |
this.cmp = cmp; | |
} |
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
/* | |
Quicksort Algorithm | |
*/ | |
function quicksort(array) { | |
function partition(a, start, end) { | |
let i = start, | |
j = end + 1; | |
while (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
#include <stdio.h> | |
void minmax(int *v, int n, int *min, int *max); | |
int main (void) { | |
int v[5] = { -1, 7, -3, 11, 4 }; | |
int min, max; | |
minmax(v, 5, &min, &max); |
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
#include <stdio.h> | |
int sum_positives (int *v, int n); | |
int main (void) { | |
int v[5] = { -1, 7, -3, 11, 4 }; | |
int result = sum_positives(v, 5); | |
printf("Sum: %d\n", result); |
OlderNewer