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
    
  
  
    
  | struct Heap { | |
| data: Vec<i32> | |
| } | |
| impl Heap { | |
| fn from(arr: &[i32]) -> Heap { | |
| let mut h = Heap { data: Vec::from(arr)}; | |
| h.make(); | |
| return h; | |
| } | 
  
    
      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
    
  
  
    
  | use rand::Rng; | |
| struct Node { | |
| v: i32, | |
| l: Option<Box<Node>>, | |
| r: Option<Box<Node>> | |
| } | |
| fn make_node(v: i32) -> Node { | |
| return Node { | 
  
    
      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
    
  
  
    
  | use rand::Rng; | |
| use std::cmp::Ordering; | |
| fn main() { | |
| let mut list: [i32; 1000] = [0; 1000]; | |
| let mut helper: [i32; 1000] = [0; 1000]; | |
| let mut rng = rand::thread_rng(); | |
| for x in 0..1000 { | |
| list[x] = rng.gen_range(0..999); | |
| } | 
  
    
      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
    
  
  
    
  | instance: type. | |
| user: type. | |
| can_be_annoyed_at: user -> user -> type. %infix none 1 can_be_annoyed_at. | |
| @: user -> instance -> type. %infix none 1 @. | |
| >>: instance -> instance -> type. %infix none 1 >>. | |
| annoyed_at: user -> user -> type. %infix none 1 annoyed_at. | |
| </3: user -> user -> type. %infix none 1 </3. | |
| can_enjoy: user -> user -> type. %infix none 1 can_enjoy. | |
| enjoys: user -> user -> type. %infix none 1 enjoys. | 
  
    
      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
    
  
  
    
  | associazione: type. | |
| studente: type. | |
| *: associazione. | |
| ;: studente -> associazione -> associazione. %infix right 1 ;. | |
| apolitica: associazione -> type. | |
| rappresentante: studente -> type. | |
| corrotta: associazione -> type. | |
| contiene_rapr: associazione -> type. | 
  
    
      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
    
  
  
    
  | let fact x = | |
| let rec fact_r i acc = | |
| match i with | |
| | 0.0 -> acc | |
| | a -> fact_r (i - 1.0) (acc * i) | |
| fact_r x 1.0 | |
| let rec pwr bas ex = | |
| match ex with | |
| | 0 -> 1.0 | 
  
    
      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
    
  
  
    
  | let fact x = | |
| let rec fact_r x acc = | |
| match x with | |
| | 1.0 -> acc | |
| | y -> fact_r (x - 1.0) (acc * x) | |
| fact_r x 1.0 | |
| let expo x k = | |
| let rec expo_r x k acc = | |
| match k with | 
  
    
      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
    
  
  
    
  | exception NoItems | |
| // O(n) | |
| let reverse lst = | |
| let rec rr lst acc = | |
| match lst with | |
| | [] -> acc | |
| | x :: xs -> rr xs (x :: acc) | |
| rr lst [] | 
  
    
      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
    
  
  
    
  | #include <stdio.h> | |
| #include <stdlib.h> | |
| typedef int(*int_ptr)(test); | |
| typedef struct { | |
| int a; | |
| int_ptr next; | |
| } test; | |
| int next_r(test* self) | 
  
    
      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
    
  
  
    
  | int split(char *string, char sep, int n_char, char ***array_values) | |
| { | |
| int n_values = 1; | |
| int start = 0; | |
| for(int x = 0; x < n_char; x++) | |
| { | |
| if(string[x] == sep) | |
| n_values++; | |
| } |