Study Guide for Final

The final will be 3 hours, open-book and open-laptop.

Study as if the exam were closed book. You will run out of time if you have to frequently look up answers. Create cheat-sheets to help you organize the material so you can access it quickly.

The exam will be a mix of written answers and coding.

Topics:

Everything from Study Guide 5, plus

  • Parallel program performance

  • Code optimization

Coding Instructions

Your final exam will have the following instructions (but with a different repository URL)

A special repository has been created for you on Github with the url

git@github.com:BrynMawr-CS223-S22/<YOUR_USERNAME>-final-exam-practice.git

Your username is your university email, e.g. one of

ahmed1

aqyang

awilson2

bhirota

bjbarton

firfan

fshahid

gchoe

jamccarty

jlei

jluther

kmburu

ltran1

memcculloc

mnguyen2

nthumu

pschaefer1

tdo

tkleckner

xdai1

Part of your final grade is your ability to clone your repository, commit, and push your code.

If you are not able to submit your programs with git, please email them to me immediately after your exam period. Programs that are submitted well past your exam period may not be graded.

For full credit, your programs must compile and run on unix with no memory errors.

If a question is unclear, state your assumptions and answer best you can.

Git and coding practice

Try cloning the repository above and writing code for the following questions.

1) Write a multi-threaded program, average.c, that computes the average of a list of numbers (at least 4 threads). You can assume that the size of the list can be evenly divided by 4.

2) Write a program, flip.c that reads in a text file and writes it to a new file with each word reversed.

3) Write a program, odd.c that uses xor to identify the single element that appears an odd number of times in the following list: [4, 6, 8, 8, 6, 2, 3, 4, 3].