Proposal for new satellite test cases

The satellite exercise needs some more complex test cases.

How about these three?

      a  | preorder: a, b, c, d
     /   |
    b    | inorder: d, c, b, a
   /     |
  c      | tree: {v: a, l: {v: b, l: {v: c, l: {v: d, l: {}, r: {}}, r: {}}, r: {}}, r: {}}
 /
d
a        | preorder: a, b, c, d
 \       |
  b      | inorder: a, b, c, d
   \     |
    c    | tree: {v: a, l: {}, r: {v: b, l: {}, r: {v: c, l: {}, r: {v: d, l: {}, r: {}}}}}
     \
      d
         a        | preorder: a, b, d, g, h, c, e, f, i
        / \       |
       /   \      | inorder: g, d, h, b, a, e, c, i, f
      b     c     |
     /     / \    |
    d     e   f   | tree: { v: a,
   / \       /    |         l: { v: b,
  g   h     i     |              l: { v: d,
                                      l: {v: g, l: {}, r: {}},
                                      r: {v: h, l: {}, r: {}}
                                    },
                                 r: {}
                               },
                            r: { v: c,
                                 l: {v: e, l: {}, r: {}},
                                 r: { v: f,
                                      l: {v: i, l: {}, r: {}},
                                      r: {}
                                    }
                               }
                          }

Motivation: a mentoring session where the student was able to pass the tests by hardcoding the array indices for the recursive calls.

Wouldn’t someone be able to hard code the indexes regardless of which tests are added?

No, because they would be different for each of the new tests.

1 Like

The indices are the same for all the current test cases? I wouldn’t have expected that! Additional tests sounds reasonable to me!

1 Like

I’m in favor.

Plus one from me.

+1 from me, too.

2 Likes

I tested them in my jq solution, no problems.