Fall 2025 Midterm 3 Key

  1. 3, 7, 5, 8, 4, 6, 2, 16, 9, 11, 12, 18, 13, 10, 15, 17
  2. 03 62 10 64 01 16 88 68 44 76 89 80 82 99 85 21 35 6C 47 77 89 3A 22 62 01 83
  3. -28
  4. 0x34
  5. A and E
  6. 67
  7. Go to Canvas -> Files to see the circuit.
    8.
const char *csostrsubseq(const char *str, const char *sub)
{
    if (!str || !sub)
        return NULL;

    if (*sub == '\0')
        return str;

    const char *result = NULL;
    int i = 0;
    for (int j = 0; str[j] != '\0'; j++)
    {
        if (str[j] == sub[i])
        {
            if (i == 0)
                result = &str[j];

            i++;

            if (sub[i] == '\0')
                return result;
        }
    }
    return NULL;
}
  1. A: 7, B: a->vals
  2. X, 4, 6 or 9, X
  3. F, T, F, F
  4. A B D E
  5. C
  6. B
  7. T, T, F, F, T
  8. C
  9. S 5 CSX1!
  10. A: A B D, B: B, C, D
  11. A: 240, B: 0
  12. A: 160, B: 480
  13. clang -O1 final.c list.c
  14. T F F
  15. s

Copyright © 2025 John Hott, portions Luther Tychonievich.
Released under the CC-BY-NC-SA 4.0 license.
Creative Commons License

This site uses Just the Docs, a documentation theme for Jekyll.