Computer science algorithms exam questions