The course meets 10.30--11.20 pm Monday, Wednesday, and Friday at 427 EPB. Each student is also registered for and will attend a weekly discussion section conducted by one of our TAs.
The second course required for computer science majors and minors emphasizes the design, implementation, and analysis of common data structures and algorithms. The goal is to teach how data structures provide the necessary data abstraction for the development of large software systems and their central role in software engineering. Data structures covered include sets, linked lists, stacks, queues, hash tables, trees, heaps, and graphs. Students are introduced to algorithms for searching, sorting, and data structure manipulation and learn the techniques to analyze program efficiency. Programming using recursion and dynamic data structures are covered. The programming language is Java.
For our textbook, we will use "Data Structures and Algorithm Analysis in Java 2/E" by Weiss, ISBN 0321370139.
Computer Science I (22C:016). Discrete Structures (22C:019) is a corequisite if not taken as a prerequisite.
The grading will be based on several homeworks (50 percent), of which there will be essentially one each week, one midterm (20 points) and one final (30 points). Most of the homeworks will involve Java programming.
The midterm will be in class on Monday, March 9. The final Exam will be on Tuesday, May 12, from 12.00 noon to 2.00 pm, in our regular classroom 427 EPB.
Section Time Location TA A01 1:30-2:20 Th 113 MLH Kajari A03 3:30-4:20 Th 118 MLH Kajari A04 10:30-11:20 Th 214 MLH Greg
Kasturi 1.00-2.00 Tue, 2.30-3.30 Wed, 2.00-3.00 Fri 101E MLH Kajari 10.30-12.00 Tue and Thu B1C MLH Greg 1.00-2.30 Wed
public static int inversionCount( int [] a){}If you prefer to make the input an array of Comparables like the sorting algos in the textbook, thats fine too. The main requirement is that your method should implement an O(N log N) algorithm. Note: A response to a common question about this homework.
void topsort()It should topologically sort the graph as described in pseudocode in Figure 9.7 of the text. You will have to modify the Vertex class to include the fields indegree and topNum. (Instead of throwing the CycleFoundException, you can print a complaint.) The LinkedList class has methods that allow us to work with it as a queue. The outline for breadth-first-search should be
void unweighted(String s)Here, s is a string that identifies the start vertex for the breadth first search, which should work along the lines of the pseudocode in Figure 9.18 of the text. Again, you have to add some fields to the vertex class. To test your methods, you can create graphs as outlined in the main method.
void printArtPoints()This should work using depth first search, roughly following the pseudocode in Figures 9.65 and 9.66 of the text. (The test for the forward edge in Figure 9.66 is not quite accurate, and you should modify it.) You should take into account the root, which is not considered in that pseudocode. As in the previous assignment, feel free to modify the class to add fields to the Vertex class, etc.