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
-- Descompone un número en una lista con los números que lo componen | |
digs :: Integral x => x -> [x] | |
digs 0 = [] | |
digs x = digs (div x 10) ++ [mod x 10] | |
-- Devuelve la longitud de un número entero | |
longitud m = length (show m) | |
-- Evaluador principal | |
pre 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
-- Estructura del árbol | |
data Abb a = Vacio | Nodo a (Abb a) (Abb a) deriving (Show) | |
-- Insertar un nuevo nodo a un árbol definido | |
-- insertarNodo (Valor a insertar) (Árbol) | |
insertarNodo :: (Ord a) => a -> Abb a -> Abb a | |
insertarNodo nuevo Vacio = Nodo nuevo Vacio Vacio | |
insertarNodo nuevo (Nodo a izq der) | |
| nuevo <= a = Nodo a (insertarNodo nuevo izq) der | |
| nuevo > a = Nodo a izq (insertarNodo nuevo der) |
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 React, { Component } from 'react'; | |
import { StyleSheet, View, ActivityIndicator, FlatList, Text, Image } from 'react-native'; | |
export default class App extends Component { | |
constructor(props) { | |
super(props); | |
this.state = { |