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
# Versión Singleton más parecida a Java | |
class Singleton(object): | |
__instance = None | |
def __new__(cls): | |
if Singleton.__instance is None: | |
Singleton.__instance = object.__new__(cls) | |
return Singleton.__instance |
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.Scanner; | |
/** | |
* | |
* @author vtorr_000 | |
*/ | |
public class Main { | |
// Fibonacci recursivo por pila |
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.Scanner; | |
/** | |
* | |
* @author vtorr_000 | |
*/ | |
public class Main { | |
// Hallar la potencia de forma recursiva por pila |
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 ConversorBinario { | |
public static String funcionRecursiva(int n) { | |
String cadena; | |
if (n == 0) { | |
return "0"; | |
} else { | |
return funcionRecursiva_rec(n); |