*** ENTERING PROGRAM *** Given the following list: 1. FRIENDS 2. ROMANS 3. COUNTRYMEN 4. LEND 5. ME 6. YOUR 7. EARS 8. I 9. COME 10. TO 11. BURY 12. CAESAR 13. NOT 14. TO 15. PRAISE 16. HIM 17. THE 18. EVIL 19. THAT 20. MEN We seek the 19th. string. We need to break this array into groups of five and, using brute force, find the median of each group. We need to find the median of the following strings: 1. FRIENDS 2. ROMANS 3. COUNTRYMEN 4. LEND 5. ME The median is: LEND We need to find the median of the following strings: 1. YOUR 2. EARS 3. I 4. COME 5. TO The median is: I We need to find the median of the following strings: 1. BURY 2. CAESAR 3. NOT 4. TO 5. PRAISE The median is: NOT We need to find the median of the following strings: 1. HIM 2. THE 3. EVIL 4. THAT 5. MEN The median is: MEN Having built an array of brute force medians, we now need to compute the EXACT median of this list. We will use recursion to do this. *** ENTERING RECURSION LEVEL 1 Given the following list: 1. LEND 2. I 3. NOT 4. MEN We seek the 2nd. string. We need to break this array into groups of five and, using brute force, find the median of each group. We need to find the median of the following strings: 1. LEND 2. I 3. NOT 4. MEN The median is: LEND Having built an array of brute force medians, we now need to compute the EXACT median of this list. We will use recursion to do this. *** ENTERING RECURSION LEVEL 2 Given the following list: 1. LEND We seek the 1st. string. Since there is only one string in this list, no work is necessary. The desired string is: LEND *** EXITING RECURSION LEVEL 2 REMINDER: The above list was a list of brute force medians. The EXACT median of that list is: LEND The original list looks like this: 1. LEND 2. I 3. NOT 4. MEN We will now pivot our ORIGINAL array around the median of medians. The BEFORE list is: 1. I The EQUAL list is: 1. LEND The AFTER list is: 1. NOT 2. MEN Since there are 1 items in the BEFORE list, and 1 items in the EQUAL list, and we seek the 2nd. item, the item must be the 1st. item of the EQUAL list. There is no need to recursively scan the EQUAL list. So, given the original list: 1. LEND 2. I 3. NOT 4. MEN The 2nd. string is: LEND *** EXITING RECURSION LEVEL 1 REMINDER: The above list was a list of brute force medians. The EXACT median of that list is: LEND The original list looks like this: 1. FRIENDS 2. ROMANS 3. COUNTRYMEN 4. LEND 5. ME 6. YOUR 7. EARS 8. I 9. COME 10. TO 11. BURY 12. CAESAR 13. NOT 14. TO 15. PRAISE 16. HIM 17. THE 18. EVIL 19. THAT 20. MEN We will now pivot our ORIGINAL array around the median of medians. The BEFORE list is: 1. FRIENDS 2. COUNTRYMEN 3. EARS 4. I 5. COME 6. BURY 7. CAESAR 8. HIM 9. EVIL The EQUAL list is: 1. LEND The AFTER list is: 1. ROMANS 2. ME 3. YOUR 4. TO 5. NOT 6. TO 7. PRAISE 8. THE 9. THAT 10. MEN Since there are 9 items in the BEFORE list, and 1 items in the EQUAL list, and we seek the 19th. item, the item must be the 9th. item of the AFTER list. We will therefore use recursion on the AFTER list. *** ENTERING RECURSION LEVEL 1 Given the following list: 1. ROMANS 2. ME 3. YOUR 4. TO 5. NOT 6. TO 7. PRAISE 8. THE 9. THAT 10. MEN We seek the 9th. string. We need to break this array into groups of five and, using brute force, find the median of each group. We need to find the median of the following strings: 1. ROMANS 2. ME 3. YOUR 4. TO 5. NOT The median is: ROMANS We need to find the median of the following strings: 1. TO 2. PRAISE 3. THE 4. THAT 5. MEN The median is: THAT Having built an array of brute force medians, we now need to compute the EXACT median of this list. We will use recursion to do this. *** ENTERING RECURSION LEVEL 2 Given the following list: 1. ROMANS 2. THAT We seek the 1st. string. We need to break this array into groups of five and, using brute force, find the median of each group. We need to find the median of the following strings: 1. ROMANS 2. THAT The median is: ROMANS Having built an array of brute force medians, we now need to compute the EXACT median of this list. We will use recursion to do this. *** ENTERING RECURSION LEVEL 3 Given the following list: 1. ROMANS We seek the 1st. string. Since there is only one string in this list, no work is necessary. The desired string is: ROMANS *** EXITING RECURSION LEVEL 3 REMINDER: The above list was a list of brute force medians. The EXACT median of that list is: ROMANS The original list looks like this: 1. ROMANS 2. THAT We will now pivot our ORIGINAL array around the median of medians. The BEFORE list is: The EQUAL list is: 1. ROMANS The AFTER list is: 1. THAT Since there are 0 items in the BEFORE list, and 1 items in the EQUAL list, and we seek the 1st. item, the item must be the 1st. item of the EQUAL list. There is no need to recursively scan the EQUAL list. So, given the original list: 1. ROMANS 2. THAT The 1st. string is: ROMANS *** EXITING RECURSION LEVEL 2 REMINDER: The above list was a list of brute force medians. The EXACT median of that list is: ROMANS The original list looks like this: 1. ROMANS 2. ME 3. YOUR 4. TO 5. NOT 6. TO 7. PRAISE 8. THE 9. THAT 10. MEN We will now pivot our ORIGINAL array around the median of medians. The BEFORE list is: 1. ME 2. NOT 3. PRAISE 4. MEN The EQUAL list is: 1. ROMANS The AFTER list is: 1. YOUR 2. TO 3. TO 4. THE 5. THAT Since there are 4 items in the BEFORE list, and 1 items in the EQUAL list, and we seek the 9th. item, the item must be the 4th. item of the AFTER list. We will therefore use recursion on the AFTER list. *** ENTERING RECURSION LEVEL 2 Given the following list: 1. YOUR 2. TO 3. TO 4. THE 5. THAT We seek the 4th. string. We need to break this array into groups of five and, using brute force, find the median of each group. We need to find the median of the following strings: 1. YOUR 2. TO 3. TO 4. THE 5. THAT The median is: TO Having built an array of brute force medians, we now need to compute the EXACT median of this list. We will use recursion to do this. *** ENTERING RECURSION LEVEL 3 Given the following list: 1. TO We seek the 1st. string. Since there is only one string in this list, no work is necessary. The desired string is: TO *** EXITING RECURSION LEVEL 3 REMINDER: The above list was a list of brute force medians. The EXACT median of that list is: TO The original list looks like this: 1. YOUR 2. TO 3. TO 4. THE 5. THAT We will now pivot our ORIGINAL array around the median of medians. The BEFORE list is: 1. THE 2. THAT The EQUAL list is: 1. TO 2. TO The AFTER list is: 1. YOUR Since there are 2 items in the BEFORE list, and 2 items in the EQUAL list, and we seek the 4th. item, the item must be the 2nd. item of the EQUAL list. There is no need to recursively scan the EQUAL list. So, given the original list: 1. YOUR 2. TO 3. TO 4. THE 5. THAT The 4th. string is: TO *** EXITING RECURSION LEVEL 2 REMINDER: The 4th. item of the AFTER list is the same as the 9th. item of the original list: 1. ROMANS 2. ME 3. YOUR 4. TO 5. NOT 6. TO 7. PRAISE 8. THE 9. THAT 10. MEN The 9th. string is: TO *** EXITING RECURSION LEVEL 1 REMINDER: The 9th. item of the AFTER list is the same as the 19th. item of the original list: 1. FRIENDS 2. ROMANS 3. COUNTRYMEN 4. LEND 5. ME 6. YOUR 7. EARS 8. I 9. COME 10. TO 11. BURY 12. CAESAR 13. NOT 14. TO 15. PRAISE 16. HIM 17. THE 18. EVIL 19. THAT 20. MEN The 19th. string is: TO *** EXITING PROGRAM *** The 19th. string is: TO