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
{-# language TupleSections #-} | |
module Main where | |
data ListF a b = NilF | ConsF a b deriving Functor | |
data NatF a = ZeroF | SuccF a deriving Functor | |
data StreamF a b = StreamF a b deriving Functor | |
newtype Fix f = Fix {unfix :: f (Fix f)} | |
type Algebra f a = f a -> a |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <time.h> | |
int cmpfunc (const void * a, const void * b) { | |
return ( *(int*)a - *(int*)b ); | |
} | |
void insert(int *arr, int n) { | |
int x = arr[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
#include <stdio.h> | |
#include <stdlib.h> | |
#define max(a, b) (a > b ? a : b) | |
typedef struct LinkedList { | |
int val; | |
struct LinkedList *next; | |
} LinkedList; |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#define max(a, b) (a > b ? a : b) | |
typedef struct LinkedList { | |
int val; | |
struct LinkedList *next; | |
} LinkedList; |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <time.h> | |
typedef struct LinkedList { | |
int val; | |
struct LinkedList *next; | |
} LinkedList; | |
LinkedList * create_node(int x) { |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <time.h> | |
int main(int argc, char *argv[]) { | |
int n, min, max, x, i; | |
time_t t; | |
srand((unsigned) time(&t)); |
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
#include <stdlib.h> | |
#include "lista.h" | |
#include "fila.h" | |
FilaDinamica *criar_fila() { | |
FilaDinamica *fila = malloc(sizeof(FilaDinamica)); | |
fila->inicio = NULL; | |
fila->fim = NULL; | |
return fila; | |
} |
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
#include <stdlib.h> | |
#include "lista.h" | |
#include "pilha.h" | |
PilhaDinamica *criar_pilha() { | |
PilhaDinamica *pilha = malloc(sizeof(PilhaDinamica)); | |
pilha->topo = NULL; | |
return pilha; | |
} |
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
{-# language DeriveTraversable #-} | |
{-# language LambdaCase #-} | |
{-# language TemplateHaskell #-} | |
{-# LANGUAGE TypeFamilies #-} | |
{-# LANGUAGE OverloadedStrings #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
module Main (main) where | |
import Data.Eq.Deriving |
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
{ | |
description = "ITEA"; | |
inputs.flake-utils.url = "github:numtide/flake-utils"; | |
inputs.nixpkgs.url = "github:nixos/nixpkgs/master"; | |
outputs = { self, nixpkgs, flake-utils }: | |
flake-utils.lib.eachDefaultSystem (system: | |
let | |
config = { | |
packageOverrides = pkgs: { |
NewerOlder