DNHI = do not hand in (homework)

DHW = the textbook (Object-Oriented Data Structures Using Java, Third Edition by Nell Dale, Daniel T. Joyce, Chip Weems)

Date Material Covered, Extra Notes, Handouts and Links Assignments



Final Exam:
Section 1 (Tue/Thu): Tuesday, May 16 2:00-3:50PM, Room 60 Fifth Ave, 110
Section 3 (Mon/Wed): Monday, May 15 2:00-3:50PM,Room 60 Fifth Ave, 110 .


Mon, May 8

Last day of Spring 2017 classes
Last day of tutoring.

Rec. # 14
Mon, May 8

Final Exam Q&A

Class # 28
Mon, May 8

Final Exam Q&A



Class # 27
Tue, May 2
Wed, May 3

AVL Trees and General Trees



Rec. # 13
Mon, May 1
Rec. # 14, Thu, May 4

Problem solving

Class # 26
Thu, Apr 27
Mon, May 1

AVL Trees
AVL tree visualization




Class # 25
Tue, Apr 25
Wed, Apr 26

Priority queues, heaps and heapsort.

Lecture notes: lecture 9.

  • DNHI: problem set 6 (this has questions on sorting)
  • DNHI: problem set 7 (this has questions on priority queues, heaps, AVL trees and general trees)


Rec. # 12
Mon, Apr 24
Rec. # 13, Thu, Apr 27



Class # 24
Thu, Apr 20
Mon, Apr 24

Quicksort: how it works, implementation, performance.

Good and bad partion methods for quicksort: QuickSortTester.java - use this program to analyze different ways of implementing partition method (some of them have bugs).



Project 5 posted (on Apr. 22), due April 30 at 11:55pm.

Class # 23
Tue, Apr 18
Wed, Apr 19

Better sorting algorithms. An idea - splitting an array into smaller parts and sorting individual parts. Mergesort: how it works, implementation, performance.
Lecture notes: lecture 7

Sort visualization:
  • Comparison sorting
  • Sorting Algorithms Visualization by Toptal - warning: the selection sort seems to always be taking the most time in these simulations
  • VisuAlgo sorting - warning: the mergesort starts at the point where all splits have been performed, the quicksort uses a different partition method than the one we discussed (it seems that this one may be making more swaps)
  • Sorting books - a cute video explaining bubble sort, insertion sort and quicksort and their relative performance.




Rec. # 11
Mon, Apr 17
Rec. # 12, Thu, Apr 20

Insertion and selection sorts - review and performance analysis.


Class # 22
Thu, Apr 13
Mon, Apr 17

Hash tables

Lecture notes: lecture 8




Class # 21
Tue, Apr 11
Wed, Apr 12

BST - removing nodes from the tree (leaves, nodes with one child, nodes with two children)

Source code for lecture 6: lecture06.zip



Rec. # 10, Mon, Apr 10
Rec. # 11, Thu, Apr 13

Binary tree traversals.


Class # 20
Thu, Apr 6
Mon, Apr 10

BST - adding nodes to the tree.


DNHI: problem set 5 (this has questions on trees)

Project 4 posted, due April 22 at 11:55pm.

Class # 19
Tue, Apr 4
Wed, Apr 5

Introduction to trees, general trees, binary trees, binary search trees. Node definition for a BST. Counting nodes in a binary tree.

Lecture notes: lecture 4: trees (definitions and terminology), binary trees







Rec. # 9, Mon, Apr 3
Rec. # 10 Thu, Apr 6

Linear structures in the wild.
instructions

Class # 18
Thu, Mar 30
Mon, Apr 3

Other types of linear structures: deque, circular list, doubly linked list.
Evaluating prefix and postfix expressions. Converting from infix to prefix and to postfix.




Fri, Mar 31

Last Day to drop a class with a grade of W

Class # 17
Tue, Mar 28
Wed, Mar 29

Calculating size of a list iteratively and recursively (assuming there is no size information). Searching in a linked list. Implementing contains iteratively and recursively.


DNHI: problem set 3 - linear structures


Rec. # 8, Mon, Mar 27
Rec. # 9 Thu, Mar 30

Interview questions.
instructions

Class # 16
Thu, Mar 23
Mon, Mar 27

Removing from a linked list.
Implementing stack and queue ADTs using reference based structures: where should the top and front/back be to achieve O(1) performance?





Class # 15
Tue, Mar 21
Wed, Mar 22

Linked structures: nodes and how to connect them, manipulating nodes.
Using linked structures for implementation of a list ADT.

Visualizations:
Stack (reference-based implementation)
Queue (refence-based implementation, uses additional "tail" reference to the last element)


Project 3 posted, due April 6 at 11:55pm.

Rec. # 7, Mon. Mar 20, Rec. # 8, Thu. Mar 23

Iterating Over Things and the for-each Loop

instructions

Class # 14
Mon, Mar 20 (section 3 ONLY)

Linked structures: nodes and how to connect them, manipulating nodes.



Class # 13
Tue, Mar 7
Wed, Mar 8

Midterm Exam



Class # 12
Mon, Mar 6

Section 3,4 ONLY !

Midterm Exam Q&A



Rec. # 6
Class # 14 (swap)
Mon, Mar 6

Section 1,2 ONLY !

Midterm Exam Q&A

Class # 12
Thu, Mar 2

Section 1,2 ONLY !





Rec. # 6
Thu, Mar 2

Section 3,4 ONLY !



Class # 11
Tue, Feb 28
Wed, Mar 1

Stacks and queues ADT and array based implementations, performance analysis.

Visualizations:
Stack (array-based implementation)
Queue (array-based implementation)




Class # 10
Thu, Feb 23
Mon, Feb 27

Lecture notes: lecture 3: ADT, collections, lists, array based implementation of a list ADT, ArrayList as an example of an implementation of a list ADT, performance of an array based implementation if a list (Big-O notation).
Source code for lecture3: lecture03.zip



Reading chapters 2, 4, 5, 6 (concentrate on the ADT descriptions and array-based implementations).

Rec. # 5
Mon, Feb 27
Thu, Feb 23

Activity 5: More Magic (or not)
instructions

Class # 9
Tue, Feb 21
Wed, Feb 22

Tuesday(2/21) class moved to SILVER 408



Recursion continued: finish with eight queens problem, binary search using recursion.


Reading chapters 2 and 4.

Mon, Feb 20

No Classes / University Holiday

Class # 8
Thu, Feb 16
Wed, Feb 15

Project 1 quizzes given.

Recursion continued: more on sequence generation, backtracking solution to eight queens problem.

Project 2 posted, due March 2 at 11:55pm.

Rec. # 4
Mon, Feb 13
Thu, Feb 16

Activity 4: Magic of Recursion instructions

Class # 7
Tue, Feb 14
Mon, Feb 13

Recursion continued: reversing a string, backtracking solutions to sequence generation (binary, decimal, with and without restrictions, efficient and inefficient introduction of conditions).





Class # 6
Thu, Feb 9
Wed, Feb 8

Recursion continued: Fibonacci function as an example of inefficiency in recursive implementation, reversing a string (using recursion).

Visualization of reversing the string function: reverse() on PythonTutor

Snow day for Thursday class.





Rec. # 3
Mon, Feb 6
Thu, Feb 9

Activity 3: Bullet-Proof Code or Input Validation instructions

Class # 5
Tue, Feb 7
Mon, Feb 6

Introduction to recursion.

Lecture notes: lecture 2.
Source code for lecture2: lecture02.zip


DNHI: problem set 2
Reading: chapter 3.1-3.3 DJW.
Chapter 3 exercises: 1*, 2*, 4, 5, 6, 7*, 8, 9*, 10, 11*, 12, 13
(you may not have time to complete all of these problems, but they are all good sources of practice, especially if you feel shaky with the topics - the starred problems should be of special interest).

Sun, Feb 5

Last Day to drop a class without a grade of W

Class # 4
Thu, Feb 2
Wed, Feb 1

Lecture 1 notes continued: command line arguments, File class, reading data from files, writing data to files.

Lecture notes: REVISED lecture 1.

Source code for lecture1: review_fileIO.zip
(you may find the capitals_list useful for running one of the examples)



Reading: chapter 3.1-3.3 DJW.

Rec. # 2
Mon, Jan 30
Thu, Feb 2

Activity 2: Comparable Inerface instructions



Class # 3
Tue, Jan 31
Mon, Jan 30

Lecture 1 notes continued: code examples, use of polymorphism, use of abstract classes, implementing Comparable interface



Project 1 posted, due Feb. 14 at 11:55pm.

Class # 2
Thu, Jan 26
Wed, Jan 25

Lecture 1 notes continued: objects vs. references, reference manipulation, has-a relationship (composition/aggregation), is-a relationship (inheritance), what is inherited and what is not, constructor chaining, super keyword

Source code for lecture1: lecture01.zip

Using the source code for lecture notes in Eclipse:
  • Dowload the zip file and note its location on your file system (many browsers have a default download directory).
  • Open Eclipse. If you are using an existing project, go to the next step. Otherwise, create a new project (Go to File -> New -> Java Project. Enter the name for a new project and click Finish (something like cs102_lectures might be a good name).
  • Right click on the src folder (inside the project into which you want to import the code for the lecture notes) and select Import.
  • Under General, pick Archive File and click Next
  • Click Browse and navigate to the zip file that you downloaded in the very first step.
  • Click Finish. This should create a package called lecture01 (or whatever other lecture number you downloaded) inside the project.


Chapter 1 exercises: 1, 3, 5, 6, 7, 8*, 9, 11*, 13*, 14, 15, 17, 19, 21, 22, 23, 30, 31, 32*, 33*, 34*
(you may not have time to complete all of these problems, but they are all good sources of practice, especially if you feel shaky with the topics - the starred problems should be of special interest).

Rec. # 1
Mon, Jan 23
Thu, Jan 26

Download source code for Java: jdk1.8.zip

Activity 1: Finding Code Responsible for Behavior: instructions

Once you complete the activity, download it in PDF format:
File → Download As ... → PDF Document (pdf)

The completed PDF file should be submitted to Gradescope for grading (only one person from your group needs to submit the activity; you will have a chance to enter the names of all group members once you upload the file).
Here are quick steps for uploading to Gradescope:
  • Go to gradescope.com and log in with you NYU email address (the version that contains your NetID).
  • On Your Courses page, select the course for which you’re submitting work.
  • On your Courses page, you will see all of your current assignments. Click on the assignment you are turning in.
  • Click Submit PDF > Click Select PDF > locate the correct file on your computer > Click Upload PDF
  • Tell us which pages correspond to each part/question on the assignment. You will see a list of all the assigned parts/questions, and images of all your document pages. For each question click the page(s) that contains your answer.
  • Finally, add the group members to the submission: on the right hand side under the name of the person who submitted the assignment, you should see "Add Group Members" link. Use it to add up to 3 more student names to the submission.


Class # 1
Tue, Jan 24
Mon, Jan 23

Intro to the course and syllabus.

Review of advanced Java topics: inheritance, interfaces, abstract classes.
Lecture notes: lecture 1.
Code conventions for this class.


  • If you do not have them already, install Java JDK 8 and Eclipse (the latest version is Neon). You must have Java JDK version 7 or 8. The prior version may lead to problems with your submissions and potential zero grade on projects. To see which version of JDK is installed on your machine:
    • in Eclipse: Window → Preferences → Java → Installed JRE's
    • in a terminal: javac -version should show "javac 1.8...." or "javac 1.7..."
  • homework 1 due Jan 30
  • Read the Code conventions document.
  • DNHI: problem set 1
  • Reading: DHW: chapter 1, class notes, your cs101 (or any Java) textbook