The attack took place outside a stadium in the Nile Delta city of Kafr el-Sheikh as the military cadets were waiting for a bus to take them to the academy. Six other people were injured in the attack.
Tuesday's executions at a prison in the Mediterranean port city of Alexandria bring to 19 the number of militants executed over the past week.
Authorities executed 15 militants on Dec. 26 after a military court convicted and sentenced them to death over a 2013 attack on a military checkpoint in the Sinai Peninsula, home of a long running insurgency by Islamic militants. Nine were killed in that attack.