Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- echo "We suppose that a, b, c, d are ordered lists."
- comm1 d c >tmp1; comm1 tmp1 b >tmp2; comm1 tmp2 a >s0001
- comm1 c d >tmp1; comm1 tmp1 b >tmp2; comm1 tmp2 a >s0010
- comm3 c d >tmp1; comm1 tmp1 b >tmp2; comm1 tmp2 a >s0011
- #omm3 c d >tmp1; comm3 tmp1 b >tmp2; comm1 tmp2 a >s0111
- comm3 tmp1 b >tmp2; comm1 tmp2 a >s0111
- comm1 b d >tmp1; comm1 tmp1 c >tmp2; comm1 tmp2 a >s0100
- comm3 b d >tmp1; comm1 tmp1 c >tmp2; comm1 tmp2 a >s0101
- comm3 b c >tmp1; comm1 tmp1 a >tmp2; comm1 tmp2 d >s0110
- comm1 a b >tmp1; comm1 tmp1 c >tmp2; comm1 tmp2 d >s1000
- comm3 a d >tmp1; comm1 tmp1 b >tmp2; comm1 tmp2 c >s1001
- comm3 a c >tmp1; comm1 tmp1 b >tmp2; comm1 tmp2 d >s1010
- #omm3 a c >tmp1; comm3 tmp1 d >tmp2; comm1 tmp2 b >s1011
- comm3 tmp1 d >tmp2; comm1 tmp2 b >s1011
- comm3 a b >tmp1; comm1 tmp1 c >tmp2; comm1 tmp2 d >s1100
- #omm3 a b >tmp1; comm3 tmp1 d >tmp2; comm1 tmp2 c >s1101
- #omm3 a b >tmp1; comm3 tmp1 c >tmp2; comm1 tmp2 d >s1110
- #omm3 a b >tmp1; comm3 tmp1 c >tmp2; comm3 tmp2 d >s1111
- comm3 tmp1 d >tmp2; comm1 tmp2 c >s1101
- comm3 tmp1 c >tmp2; comm1 tmp2 d >s1110
- comm3 tmp2 d >s1111
- rm -f tmp1 tmp2
- exit 0
- ┌──┤ C ├──┐
- ┌───────────┼───────────┼───┐
- │ ┌─────┼─────┐ │ │
- │ 0100│0101 │ 0111│ 0110│ ┴
- ┌──┼─────┼─────┼─────┼─────┼─┐ B
- │ │ │ │ │ │ │ ┬
- ┴ │ 1100│1101 │1111 │1110 │ │ │
- A └─────┼─────┼─────┼─────┼─┼─┘
- ┬ │ │ │ │ │
- │ 1000 │1001 │1011 │1010 │ │
- └────────┼─────┼─────┼─────┼─┘
- │ │0011 │ 0010│
- 0000 │0001 └─────┼─────┘
- └──┤ D ├──┘
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement