Computer Science 3, Section 01
The main CS3 webpage is at
Instructor: Ivona Bezakova (email)
Section meets: Mo/We 10-11:50am, room 70-3445
Tutoring/mentoring center: open almost all the time - check the schedule on their door
Office hours: Mo 1-3pm, Tu 2-3pm and 6-7pm, office 70-3645
Remarks about office hours:
- The evening office hours are for part-time students only, please come at 6pm or
let me know that you are coming, otherwise I might leave.
- Due to a scheduling conflict, the Monday office hours start at 2pm on
March 16th, 30th, and April 20th. They'll continue beyond 3pm if need arises.
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.
- Slides are posted in the PowerPoint and pdf form here.
- Code examples from class are posted here.
- Week 1:
- We covered singly and doubly linked lists in detail and we sketched stacks and queues. We will briefly
come back to them next week when we will talk about running time analysis.
- We did not get the chance to implement a class for the stack. I posted an implementation in the Code
directory (see the above link for materials). Several remarks about this implementation:
- Compare the classes DLNode
and LNode - the second we did in class, the first is completely analogous using generics (i.e.,
in LNode the info is of type int, in DLNode elem is of a yet-undeclared type E).
- The class ListStack implements the interface Stack using linked lists.
- There is also an exception class (and an exception gets thrown in the simple test in the main
method of ListStack)
- Notice that Javadoc comments are missing, mostly because of space constraints if I wanted to
show the code on the projector - in your implementation for labs, do not forget to
- Week 2:
- Project 1 is now available.
Several of you expressed interested in doing a GUI for the project. I'd be happy to review your creations :)
and give extra credit for them (extra up to 10% of the project grade). If you wish to submit a GUI-based project, submit a file
named "WordSearchGUI.java" in addition to your "WordSearch.java".
- Week 3:
- Notice: the final submission of Project 1 is due Easter Sunday. Please submit earlier if that deadline
does not work for your schedule (and even if it does :)
- Initial submission for the project is this coming Sunday, March 29, 2009.
- Our first exam: next Wednesday, April 1, 2009, in the second half of the class.
(This is not a joke! :)
Study materials from the first three weeks plus Monday of week 4 (intro to recursion, this will be
touched upon by the exam but I will not ask you to implement a complicated recursive program - a
problem of similar difficulty to the (recursive) linear search could appear on the exam).
Check out www.cs.rit.edu/~ta for practice exam questions and look
for e-mails from our TA's about the practice sessions for exam 1.
- Our discussion of the loop
for (i=0; i&le N; i+=(N+3)/4) System.out.println("Hello");
got interrupted by the fire alarm. We were just about to vote between time complexities of O(n) and O(1).
Those of us who returned agreed that the running time is indeed O(1).
[If you do not understand this, ask for help! Or, implement the code and try
it for several very different values of n.]
However, also O(n) is true but it is not the tightest bound possible.
- We coded the recursive linear search in Java (see the code section). We also added a print statement AFTER
the recursive call - in what order will be the print statements printed for n=10? We'll discuss this next week.
- Week 4:
- Exam 1 on Wednesday, in the second half of the class. The exam will cover:
- Week 1: understand how linear data structures work, be able to implement them and related methods,
estimate the running time (check the implementation questions in the ta's list of practice questions)
- Week 2: understand big-O notation, be able to compare basic functions, sort functions by their order of growth
(by the big-O notation from the smallest to the largest function), be able to estimate the running time of
a given pseudocode
- Week 3: understand linear and binary search, be able to implement them, find mistakes if any, understand
conditions under which the searches work, estimate their running time
- Week 4 (and end of week 3): recursion - we'll cover only tail recursion on this exam, you should understand
how it works, be able to implement simple recursive programs (such as factorial or linear search), trace a given
(simple) recursive program, estimate its running time
- General advice: besides checking the chapters from the book and the slides, it is very useful to go to the TA's
review sessions (check your inbox and/or notices in GCCIS) and to check the TA's practice questions and answers
posted online (see the link above).
- I posted an implementation for the recursive pseudocode for generating all subsets of size k (see the slides).
Play with this code so that you understand how it works. Try to trace it by hand. Recursion does take some time to
get used to.
- Week 5:
- Read the relevant chapter in the book (Chapter 11).
- The lab also talks about Selection sort and it just occured to me that some of you might not have seen
it before. It is similar to InsertSort, with running time O(n2). It works by first finding
the maximum element at positions 0...n-1 (where n is the length of the array), and then it swaps the
maximum element with the element at position n-1. Then, it finds the maximum at positions 0...n-2
and it swaps it with the element at positions n-2, etc. The sort is sometimes called MaxSort instead
- Project 1 is due this Sunday, April 12. Make use of the tutoring center if you are having any problems
with the project - this is exactly what the tutoring center is for: to help!
- Week 6:
- Project 2 has been posted - read it before Monday's class. The initial submission is due April 26.
- Week 7:
- The initial submission of project 2 is due April 26.
- Exam 2 will take place on Wednesday next week. Study material covered in weeks 4-7 (and Monday of week 8,
this material will not be covered in depth but you should understand it). More precisely, the exam will test:
Check the relevant questions from the ta's website - see both exam 2 practice questions as well as final
- Recursion: you should be able to read and trace recursive programs, as well as write simple recursive programs (in pseudocode) yourself.
- Sorting algorithms: understand, trace, be able to implement the algorithms from class, with emphasis on MergeSort, QuickSort, and HeapSort.
- Trees: definition, traversals, depth/height, binary trees, binary search trees (insert, remove, search), heaps.
- Graphs: definition, traversals (BFS, DFS), plus various graph properties (path, cycle, connected component, etc).
- For every algorithm from class, you should be able to state its running time (in big-O notation).
- Week 8:
- Exam 2 will take place on Wednesday, April 29, 2009, in the second half of the class. For more information, read above.
- Week 9:
- Project 2 is due this Sunday. If you want to have more fun with the project, you are welcome to incorporate additional
functionality to Dinky. If this functionality is significant (%-operation does not count, but manipulation of
strings would), you will be awarded 10% extra credit, provided that you get at least 90% score for the posted requirements.
If you would like to add some functionality but you are unsure if that counts as "significant," ask.
Come to my office hours or to class with questions, or send your questions by e-mail before Friday - I have a long
response time on weekends. Make use of the tutoring center for any last minute help.
- Week 10:
- Review the ethics paper by McFarland (copies were distributed in class, it is also linked from the website).
- We did basic final review, going through some of the questions on the /~ta website. If you had any issues with
any of the questions, go to our tutoring center for help while they are still open. Also, I recommend everybody
to attend one of the final review sessions (watch signs on the lab doors, check your e-mails for announcements).
- I posted the recursive java-code we traced in class (both versions, the original linear recursion, as well as the
binary recursion). Make sure that you understand how they work and are able to trace them by hand.
- If you have not already done so, please fill out the online course evaluation for the class.
- Good luck with your finals.