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
import java.util.Arrays; | |
import java.util.HashMap; | |
import java.util.Map; | |
/** | |
* @author richard.santana | |
*/ | |
public class SumTwo { | |
public static void main(String[] args) { |
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
import java.util.Arrays; | |
import java.util.LinkedList; | |
import java.util.Queue; | |
/** | |
* @author richard.santana | |
*/ | |
public class GraphClusters { | |
public static void main(String[] args) { |
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
import java.util.ArrayList; | |
import java.util.Arrays; | |
import java.util.List; | |
import java.util.Stack; | |
/** | |
* @author richard.santana | |
*/ | |
public class BracketsChecker { |
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
package com.example; | |
/** | |
* @author richardsantana | |
*/ | |
public class Solver { | |
public boolean checkAnagram(String phrase, String search) { | |
for (String substring : phrase.split(" ")) { | |
if(substring.length() == search.length()){ |
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
package com.example; | |
import java.util.ArrayList; | |
import java.util.HashSet; | |
import java.util.List; | |
import java.util.Set; | |
/** | |
* Solution for http://blog.gainlo.co/index.php/2016/04/12/find-the-longest-substring-with-k-unique-characters/ | |
* @author richardsantana |
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
#!/bin/bash | |
#instalação java | |
apt-get install python-software-properties -y | |
add-apt-repository ppa:webupd8team/java | |
#instalação docker | |
#fonte https://docs.docker.com/engine/installation/linux/ubuntulinux/ | |
apt-get install apt-transport-https ca-certificates | |
apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D |
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
.data | |
$array: .word 10, 50, 67, 1, 23, 68, 100, 2,-1 # objeto -1 indica o final do vetor | |
.text | |
main: | |
li $s0, 0 #inicia o contador | |
la $s1, $array #aponta para o array | |
loop: | |
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
.data | |
$soma: .asciiz "soma: \n" #declara variavel soma como 'soma: \n' | |
$subtracao: .asciiz "\nsubtracao: \n" #declara variavel subtracao como 'subtracao: \n' | |
$multiplicacao: .asciiz "\nmultiplicacao: \n" #declara variavel multiplicacao como 'multiplicacao: \n' | |
$divisao: .asciiz "\ndivisao: \n" #declara variavel divisao como 'divisao: \n' | |
$message1: .asciiz "\nInsira o primeiro valor:\n" | |
$message2: .asciiz "\nInsira o segundo valor:\n" | |
$message3: .asciiz "\nEscolha a operação:\n1-Soma\n2-Subtracao\n3-Multiplicacao\n4-Divisao\n" | |
$message4: .asciiz "\nDeseja fazer uma nova operação:\n1-Sim\n2-Nao\n" |
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
.data | |
$soma: .asciiz "soma: \n" #declara variavel soma como 'soma: \n' | |
$subtracao: .asciiz "\nsubtracao: \n" #declara variavel subtracao como 'subtracao: \n' | |
$multiplicacao: .asciiz "\nmultiplicacao: \n" #declara variavel multiplicacao como 'multiplicacao: \n' | |
$divisao: .asciiz "\ndivisao: \n" #declara variavel divisao como 'divisao: \n' | |
$message1: .asciiz "\nInsira o primeiro valor:\n" | |
$message2: .asciiz "\nInsira o segundo valor:\n" | |
$message3: .asciiz "\nEscolha a operação:\n1-Soma\n2-Subtracao\n3-Multiplicacao\n4-Divisao\n" |
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
.data | |
$soma: .asciiz "soma: \n" #declara variavel soma como 'soma: \n' | |
$subtracao: .asciiz "\nsubtracao: \n" #declara variavel subtracao como 'subtracao: \n' | |
$multiplicacao: .asciiz "\nmultiplicacao: \n" #declara variavel multiplicacao como 'multiplicacao: \n' | |
$divisao: .asciiz "\ndivisao: \n" #declara variavel divisao como 'divisao: \n' | |
.text | |
main: | |
li $s0, 10 #insere o valor 10 no registrador $s0 | |
li $s1, 2 #insere o valor 2 no registrador $s1 |
NewerOlder