This file contains hidden or 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
| import java.util.*; | |
| public class NotasDaTurma { | |
| public static void main(String[] args) { | |
| final int ALUNOS = 3; | |
| final int PROVAS = 2; | |
| Scanner scanner = new Scanner(System.in); | |
| double notas[][] = new double[ALUNOS][PROVAS]; |
This file contains hidden or 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
| module.exports = mergesort; | |
| function mergesort (array) { | |
| const cp = Array.from(array); | |
| sort(array, 0, array.length - 1, cp); | |
| } | |
| function sort (array, left, right, cp) { | |
| const size = right - left + 1; |
This file contains hidden or 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
| module.exports = quicksort; | |
| function quicksort (array) { | |
| sort(array, 0, array.length - 1); | |
| } | |
| function sort (array, left, right) { | |
| const size = right - left + 1; | |
| if (size > 1) { |
This file contains hidden or 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 BTREE_TYPE; | |
| typedef struct btree { | |
| struct btree *left; | |
| BTREE_TYPE value; | |
| struct btree *right; | |
| } *BTREE; |
This file contains hidden or 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 int BST_TYPE; | |
| typedef struct bst { | |
| struct bst *left; | |
| BST_TYPE value; | |
| struct bst *right; | |
| } *BST; |
This file contains hidden or 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
| import java.util.*; | |
| public class ContaCorrenteTest { | |
| public static void main(String[] args) { | |
| test1(); | |
| System.out.println("----- **"); | |
| test2(); | |
| System.out.println("----- **"); | |
| test3(); | |
| System.out.println("----- **"); |
This file contains hidden or 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
| public class Data { | |
| private int ano; | |
| private int mes; | |
| private int dia; | |
| public Data(int ano) { | |
| atribuirData(ano, 1, 1); | |
| } | |
| public Data(int ano, int mes) { |
This file contains hidden or 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 <iostream> | |
| #include <cstdlib> | |
| using namespace std; | |
| void enumere(const char *map[], int n, const int *dom[], int m); | |
| void enumere(int i, int *v, const char *map[], int n, const int *dom[], int m); | |
| int main (void) { | |
| const char *map[] = { |
This file contains hidden or 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 <iostream> | |
| #include <cstdlib> | |
| using namespace std; | |
| void enumere(const char *map[], int n, const int *dom[], int m); | |
| void enumere(int i, int *v, const char *map[], int n, const int *dom[], int m); | |
| int main (void) { | |
| const char *map[] = { |
This file contains hidden or 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
| function crivo(n) { | |
| const primos = []; | |
| for (let i = 0; i <= n; i++) primos[i] = true; | |
| primos[0] = primos[1] = false; | |
| let limit = ~~Math.sqrt(n); | |
| for (let i = 2; i <= limit; i++) { |