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
public void swap(int a, int b) { | |
int aux = a; | |
a = b; | |
b = 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
package practice; | |
public class BST { | |
Node root; | |
class Node { | |
int data; | |
Node left; | |
Node right; |
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
public class BinaryTree<T> { | |
private T value; | |
private BinaryTree<T> left; | |
private BinaryTree<T> right; | |
public BinaryTree(T value, BinaryTree<T> left, BinaryTree<T> right) { |
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
//Implementar un método que determine si los valores almacenados en el árbol según un recorrido postorder se encuentran ordenados de menor a mayor (según el criterio de un | |
//comparador recibido por parámetro). | |
//(es sobre un árbol binario) | |
public class BinaryTree<T> { | |
private Node<T> root; | |
private class Node<T> { | |
private Node<T> left; |
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
//tengo un grafo dirigido con dependencias entre tareas (si A depende de B, entonces existe una arista que va de A a B), y quiero un | |
//algoritmo que dada una tarea me diga la lista de tareas que tengo que hacer para poder cumplirla (en un orden tal que se cumplan las dependencias)2:49 PM | |
//si no se puede (porque por ejemplo existe alguna dependencia circular entre tareas) retorna null | |
public class Graph<T> { | |
private Map<T, Node<T>> nodes; | |
private class Node<T> { | |
T elem; |
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
intersection = list(set(list1) & set(list2)) |
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
### Keybase proof | |
I hereby claim: | |
* I am amarseillan on github. | |
* I am agus (https://keybase.io/agus) on keybase. | |
* I have a public key whose fingerprint is D228 1ADF 6C70 D046 1E89 4B13 59E9 0979 7726 ABEC | |
To claim this, I am signing this object: |