Advertisement
szabozoltan69

subsets2

May 14th, 2014
460
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.10 KB | None | 0 0
  1. #!/bin/bash
  2. echo "We suppose that a, b, c, d are ordered lists."
  3. comm1 d c >tmp1; comm1 tmp1 b >tmp2; comm1 tmp2 a >s0001
  4. comm1 c d >tmp1; comm1 tmp1 b >tmp2; comm1 tmp2 a >s0010
  5.  
  6. comm3 c d >tmp1; comm1 tmp1 b >tmp2; comm1 tmp2 a >s0011
  7. #omm3 c d >tmp1; comm3 tmp1 b >tmp2; comm1 tmp2 a >s0111
  8.                  comm3 tmp1 b >tmp2; comm1 tmp2 a >s0111
  9.  
  10. comm1 b d >tmp1; comm1 tmp1 c >tmp2; comm1 tmp2 a >s0100
  11. comm3 b d >tmp1; comm1 tmp1 c >tmp2; comm1 tmp2 a >s0101
  12. comm3 b c >tmp1; comm1 tmp1 a >tmp2; comm1 tmp2 d >s0110
  13. comm1 a b >tmp1; comm1 tmp1 c >tmp2; comm1 tmp2 d >s1000
  14. comm3 a d >tmp1; comm1 tmp1 b >tmp2; comm1 tmp2 c >s1001
  15. comm3 a c >tmp1; comm1 tmp1 b >tmp2; comm1 tmp2 d >s1010
  16. #omm3 a c >tmp1; comm3 tmp1 d >tmp2; comm1 tmp2 b >s1011
  17.                  comm3 tmp1 d >tmp2; comm1 tmp2 b >s1011
  18.  
  19. comm3 a b >tmp1; comm1 tmp1 c >tmp2; comm1 tmp2 d >s1100
  20. #omm3 a b >tmp1; comm3 tmp1 d >tmp2; comm1 tmp2 c >s1101
  21. #omm3 a b >tmp1; comm3 tmp1 c >tmp2; comm1 tmp2 d >s1110
  22. #omm3 a b >tmp1; comm3 tmp1 c >tmp2; comm3 tmp2 d >s1111
  23.                  comm3 tmp1 d >tmp2; comm1 tmp2 c >s1101
  24.                  comm3 tmp1 c >tmp2; comm1 tmp2 d >s1110
  25.                                      comm3 tmp2 d >s1111
  26.  
  27. rm -f tmp1 tmp2
  28.  
  29.  
  30. exit 0
  31.  
  32.                  ┌──┤  C  ├──┐
  33.      ┌───────────┼───────────┼───┐
  34.      │     ┌─────┼─────┐     │   │
  35.      │ 0100│0101 │ 0111│ 0110│   ┴
  36.   ┌──┼─────┼─────┼─────┼─────┼─┐ B
  37.   │  │     │     │     │     │ │ ┬
  38.   ┴  │ 1100110111111110 │ │ │
  39.   A  └─────┼─────┼─────┼─────┼─┼─┘
  40.   ┬        │     │     │     │ │
  41.   │ 1000   │100110111010 │ │
  42.   └────────┼─────┼─────┼─────┼─┘
  43.            │     │0011 │ 0010│
  44.     0000   │0001 └─────┼─────┘
  45.            └──┤  D  ├──┘
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement