Data Structures for Problem Solving, Section 07
The main course webpage is at
Instructor: Ivona Bezakova (email@example.com - humans, replace "myinitials" with "ib")
Section meets: Mo/Tu/We 2-3:50pm, room 70-2400, Tu/We labs ICL1-ICL2
Student center: open almost all the time - check the schedule on the above website to see when the 242 SLI/TAs staff the center
Instructor's office hours (tentative): Tu/We 10am-12pm
I will use this webpage for announcements and material specific to our section.
Please check the main webpage (see link above) for syllabus, schedule, etc.
- Week 1: slides and the group A/B split.
- I added the path reconstruction onto the slides. I will discuss the code, including the functions _init_ and _str_ during the problem solving sessions.
- Note: The slides from lecture differ slightly from the posted code in the way the visited is marked
(the slides mark the node as visited at the beginning of the DFS call, instead of inside the for-loop).
- Week 2: slides and all the code from class can be found here.
- Week 3: slides. Please keep in mind that the posted slides are a supplement to the
main course materials -- the published lecture notes available from the main course website.
- Week 4: slides. I posted the code that follows the pseudo code from class here.
It is a modification of the BFS code from week 2 and as such it does not read the input from a file; rather the input is hard-coded into the main function.
Do not forget to read the lecture notes and study the code posted at the main course website.
- Week 5: Midterm. The written part of the midterm exam takes place on Tuesday 1/8, in class. The practical part of the exam takes place in the labs (ICL1/2) on Wednesday
2-2:50pm for group A and Wednesday 3-3:50pm for group B. Matt, our TA, will hold a midterm review session on Monday 1/7, in class.
How to study for the midterm:
- For the written part:
- Make sure that you understand the concepts from class. Trace the algorithms on some sample inputs (e.g. a small unweighted graph for the BFS) and show the contents of
your data structures throughout the execution of the algorithm (e.g., the queue in the BFS).
- Practice writing code on paper, e.g., for the data structures (for example, the push and pop functions for the stack).
- Practice sketching pseudo code. Practice on problems from the problem solving sessions and the TA sessions. Modify the problems and sketch the pseudo code for the modified
problem. For example, what if you wanted to find the most colorful cow (the cow hit by the highest number of paint bombs)? Your pseudo code should be like code,
except that you do not need to worry about things like giving the distance formula (you would just say, for example, "if the distance of A and B is < r:" instead of specifying the
- Read the running time descriptions in the lecture notes and similarly analyze the running times of your algorithms.
- For the practical part:
- Take a code (either one of the posted codes for the week, or the code from the lab) and delete the contents of one of the functions. For example, delete the contents of isGoal
in one of the backtracking codes. Rewrite the function from scratch (of course, you do not have to rewrite it exactly as the original, just make sure that the code works).
- For the data structures, implement them on your own from scratch. For example, implement the insert, updateCost, and extractMin functions for the priority queue.
Do this for the other data structures (stack, queue, and the various types of graphs).
- Week 6: slides. I posted the code from class here.
- Week 7: slides.
- Week 8: slides.
- Week 9: slides. I posted the code from class here. A couple of remarks: (a) The code
simply finds the best value, not the actual selection of jobs that correspond to the value. The selection can be computed by tracing backwards through the table
of values - see functions getJobPlan (does just the dynamic programming part as we did in class) and getTakenJobs (traverses back through the table to figure out
which jobs to take). Matt traced this function during the TA recitation session in week 9. (b) Go to the official course website to download the data sets we used in class.
- Week 10: notes. I managed to produce the pdf but some of the fonts are messed up. Please refer back to the printouts from class
for the actual problem statements... Sorry about that.
- Week 11: Final exam. Wednesday, 2/20, 2:45-4:45pm, room GOL-2400. Go to the main course website for information about review sessions,
the "retrospective" assignment (worth 5% of your grade), the final course survey (worth 1% of your grade - sorry about the repetitive questions, we are not allowed
to modify/eliminate them), and other information.