Skip to content
Snippets Groups Projects
Select Git revision
  • ef3e0cbbaaecaa19a0e17afefcf79d8348c853fc
  • master default protected
2 results

pqtree.ml

Blame
  • Guyslain's avatar
    Guyslain Naves authored
    ef3e0cbb
    History
    pqtree.ml 586 B
    open RobinsonLib
    open PqTree 
    
    let is_in interval i = List.mem i interval 
    
    let test_naive tree interval = 
      Naive_pqtree.add_interval (is_in interval) (List.length interval) tree
    
    let test1 = 
      ( P [Q [Leaf 1; Leaf 2; Leaf 3]; Leaf 4; Leaf 5],
        [3;4],
        P [Q [Leaf 1; Leaf 2; Leaf 3; Leaf 4]; Leaf 5]
      )
    
    
    
    let test2 =
      ( P [Leaf 1; Leaf 2; Leaf 3; Leaf 4; Leaf 5],
        [1;3;5],
        P [P [Leaf 1; Leaf 3; Leaf 5]; Leaf 2; Leaf 4]
      )
    
    
    let test3 = 
      ( P [ Leaf 1; P [ Leaf 2; Leaf 3; Leaf 4; Leaf 5]],
        [1;2;5],
        Q [P [Leaf 3; Leaf 4]; P [Leaf 2; Leaf 5]; Leaf 1]
      )