Class meeting | 1:00–1:50pm MTWF, Austin 302 |
---|---|
Instructor | Karl Abrahamson |
Office | Sci&Tech C-113 |
Office hours | M–F 11:00–12:00 or by appointment |
Phone | 328-9689 |
abrahamsonk@ecu.edu | |
Course web page | www.cs.ecu.edu/~karl/3300/spr15/ |
My web page | www.cs.ecu.edu/~karl/ |
Text (recommended) | Programming Abstractions in C, by Eric S. Roberts |
Lecture notes | CSCI 3300 Notes (www.cs.ecu.edu/~karl/3300/spr15/Notes/). |
This class will interfere with your social life. It will cut into your leisure time.
You will need to read the lecture notes and work the exercises in the lecture notes to be successful. Plan to spend from 6 to 12 hours per week outside of class working on assignments for this course. The amount of time that you need to spend will depend on how efficiently you work and on whether you are willing to follow advice on how to write software. Students who use the ideas discussed in class will spend less overall time than those who don't. Students who ask questions will spend less overall time than those who don't.
If you cannot commit adequate time to this course, I recommend that you drop the class.
The prerequisite is CSCI 2310 or equivalent. You should be familiar with the basics of a programming language, such as Java, C++ or C#.
IMPORTANT: This course offers more advanced material on the general topic covered in CSCI 2310, and so, according to university policy, you cannot repeat CSCI 2310 for credit after completing CSCI 3300. If you received a grade of less than C in CSCI 2310, or if you need to retake CSCI 2310 for any reason, do not take CSCI 3300 without consulting me.
The focus of this course is advanced computer programming techniques and algorithms, primarily those that rely on data representation schemes. The language is C++, with emphasis on the C subset. Students are not expected to have used C or C++ before. Part of this course is an introduction to C++, covering all aspects needed in this course.
This course emphasizes concrete aspects of data structures, also called physical data structures. Data abstraction, the other side of data structures, is emphasized in CSCI 3310, although we introduce some of its most basic ideas in this course.
You will come out of the course able to write working multi-module C++ programs using complex data structures. You should be able to offer arguments concerning the correctness of your programs, and be aware of algorithmic and efficiency issues. For more, see student competencies below.
The following is a partial list of topics to be covered (though not exactly in the order listed).
The C++ programming language. Variables, expressions and statements. Control structures. Functions. Recursion. Types and data, including structures and arrays.
Pointers and memory management. Dynamic memory allocation and deallocation
Physical data structures, including linked lists, trees and hash tables.
Algorithms on physical data structures, including both iterative and recursive algorithms. Correctness and efficiency of algorithms.
Abstract data types.
Designing, understanding, testing and debugging programs.
After successfully completing this course, students will have the following abilities.
There will be a quiz each of the following dates. All are Fridays.
You can bring one prepared 8.5x11" piece of paper, written on both sides, to each quiz. I will not collect those papers.
I will drop your lowest quiz grade and count the remaining six. There will be no makeups for missed quizzes.
The final exam will be at 11:00-1:30 Wednesday, May 6, in Austin 302. The final exam will cover all of the material for the course. You can bring two prepared 8.5x11" pieces of paper to the final exam.
Grades will be computed as follows.
Six quizzes (best of seven) | 36% (6% each) |
A comprehensive final exam | 20% |
Eight programming assignments | 35% total. By assignment: (0: 1%) (1: 3%) (2: 3%) (3: 6%) (4: 3%) (5: 6%) (6: 7%) (7: 6%) |
Attendance | 9% |
You will start with 9 points for attendance and lose one point for each unexcused absence.
Tentative cutoffs for grades will be as follows. These cutoffs will not be raised.
A | 93% |
A– | 90% |
B+ | 87% |
B | 83% |
B– | 80% |
C+ | 76% |
C | 72% |
C– | 68% |
D+ | 64% |
D | 60% |
D– | 56% |
Important proviso.
It is not possible to learn the material of this course effectively without actually "getting your hands dirty" and doing the programming. Accordingly: In order to pass this course, you must receive at least a 50% grade in the programming assignments.This outweighs the score computed by adding grades together. |
No incompletes will be issued in this course except for extraordinary circumstances, and even then only if you are nearly done already and have done work of acceptable quality, so that it is realistic that you can pass the course. An incomplete will not be given simply because a student could not find the time to do the course work. By registering for this course, you are committing to finding time to do the work.
The programming assignments for this course are probably larger than you have done before. Expect them to take time to complete. If you start on the due date, you will not be able to complete them. Start early, and plan for unexpected difficulties. If you have two weeks to do an assignment, there is a reason.
I will compile and run programs using the g++ compiler on Linux. I will use the following flags when compiling programs:
-g -Wall -Wshadow -Wuninitialized -OI strongly suggest that you use the same flags.
Grading of submissions is explained in the notes. Read that page about how programs will be graded so that you are aware of expectations.
With the exception of assignments 0 and 7, you will have an opportunity to turn in two full versions of each program. Assignments 0 and 7 only allow one full version. Assignments 3, 5, 6 and 7 also have an intermediate, incomplete, version.
Intermediate version (version i) The intermediate version implements a specified subset of the requirements. You will receive feedback on it.
First full version (version a) The first version should be a complete, working solution to the problem. It is not a subproblem. You will receive feedback and a grade for it.
Second full version (version b). After reading the feedback on the first version, you can submit a second version. It should also be a complete, working version of the program, with mistakes that were pointed out in the first version fixed.
Late submissions for the first version will be accepted up to 24 hours after the due date. Late submissions for the second version will be accepted for up to three days after the deadline, with a 5 point penalty (out of 100).
It should be clear that turning in the first version of each assignment is very important to your performance in this course. But there is even more reason for making sure that you turn in a high quality first version.
You will get extensive, timely feedback on first versions. That not only helps you to do an improved second version of that assignment, but it will help you with other assignments.
On second versions, the feeback will less extensive and will be available much later. If you rely on getting feedback on second versions, you will not receive adequate information in time to make necessary improvements on subsequent programs. You will probably end up with a low score on your programming assignments.
Be sure to get to work on the assignments early so that you are able to submit well written first versions.
You are expected to attend class. You are responsible for announcements and assignments given in class. If you miss a class, it is up to you to obtain notes and any other information that was provided in the class. Excuses that you did not know about something because you did not come to class and did not obtain the information will not count for anything at all.
Those who do not attend class can count on doing poorly in this course. If you choose not to attend class, then you must live with the consequences of that decision, however bad they are.
Even if you believe you already know what we are covering, come to class. If you don't, you will end up missing material that you did not know we were going to cover and you will fall behind.
If you are having trouble understanding the lectures, do not stop coming to class. Come to office hours or ask for help from teaching assistants in the lab (Austin 208/209). Get help as early as possible.
Attend class. Arrive on time. Do not skip class either because you think that you already understand the material or for the opposite reason, that you think you cannot get it.
Do not bring distractions to class. If you read your email, listen to music, or engage in other distracting activities during class, you will get very little out of class.
Ask questions in class. If you do not understand something, ask a question about it.
Do not allow yourself to fall behind. Work on the homework early. Do not wait until just before the deadline. If you start to fall behind, work right away to catch up. If you are falling behind because you do not understand something, ask for help. Do not just give up!
Schedule time to work outside of class.
Read the lecture notes twice. Take a break (like a whole day or longer) in between. Work the exercises. Later in the term, go back over notes that you looked at earlier in the term. You will learn much more that way.
Get adequate sleep. Sleep is important both before and after you learn new concepts. Sleep before enables you to concentrate, and sleep afterwards is critical for moving new information into permanent memory.
If you are having trouble, seek help soon. Do not wait until it is too late.
The following schedule lists brief topics along with sections from the lecture notes that cover them. You should read the relevant sections of the lecture notes before the class. Sections in parentheses are important to read but will probably not be discussed in class except to answer questions.
The notes have exercises, with answers. To do well in this course, you will need to do the exercises. Compare your answer to the answer given.
This outline is tentative and might need to be adjusted.
Date | Topics | Reading |
---|---|---|
M. 1/12 | Introduction. Syllabus. General advice. System: Linux. C++ and machine language. Compiling and running C++ programs. Assn. 0 assigned. |
(1. Introduction) (2. Advice) 3.1. Linux 3.2. Linux 3.3. Compiling (3.6. Submitting assignments) (6.1. Standards: motivation) (6.2. Standards: file names) (6.3. Standards: file format) |
T. 1/13 | C++: Numeric expressions and types. Variables and assignment. Constants. Abbreviations for assignments. Statements and sequencing. |
(5.1. Discussion of C++) 5.3.1. Expressions 5.3.2. Numeric expressions 5.3.6. Precedence 5.4. Statements 5.5. Variables (6.9.1. Standards: statements) |
W. 1/14 | C++: Boolean expressions. Comparisons. Making decisions. Compound statements. Indenting. Coding standards for Boolean expressions and conditionals. |
5.3.3. Boolean values and expressions 5.6.1. Making decisions (6.6. Standards: types, constants and expressions) (6.9.2. Standards: components of statements) (6.9.3. Standards: conditionals) |
F. 1/16 | C++: While-loops. Breaks. For-loops. Infinite loops. Coding standards for loops. |
5.6.3.1. While-loops 5.6.3.3. For-loops 5.6.3.4. Breaking out of a loop 5.6.3.5. Infinite loops (6.9.4. Standards: loops) (6.9.5 standards: commas and gotos) |
M. 1/19 | Holiday | |
T. 1/20 | C++: Functions. Defining functions. Parameter passing. Assn. 0 due. |
5.7.1. Functions 5.7.2. Defining functions (6.4. Standards: variable and function names) (6.5. Standards: variables and parameters) |
W. 1/21 | C++: Procedures. Input and output using the stdio library. |
5.7.4 Procedures 5.9.1. Standard input and standard output 5.9.2.1. Output 5.9.2.3. Input (5.9.4. Buffering) |
F. 1/23 | Quiz 1. The main function. |
5.7.6 main Review: (work all of the exercises!) 5.3.1. Expressions 5.3.2. Numeric expressions 5.5. Variables 5.3.3. Boolean values and expressions 5.6.1. Making decisions 5.6.3.1. While loops 5.6.3.3. For-loops 5.7.1. Functions 5.7.2. Defining functions |
M. 1/26 | C++: Scope. Frames. Documentation: Contracts. Assn. 1 assigned. |
5.8. Scope 5.7.2. Frames 5.2. C++ comments (4.1. Documentation) 4.2. Contracts (4.3. Other documentation) (Assignment 1) |
T. 1/27 | Algorithms: recursion. | 8.3. Recursion |
W. 1/28 | Algorithms: Search algorithms. Recursive and looping definitions. Tail recursion. |
8.7. Search algorithms 8.4. Tail recursion |
F. 1/30 | Algorithms: Scan algorithms. Recursive and looping definitions. | 8.5. Scan algorithms |
M. 2/2 | Algorithm discovery. Top-down design. Sequencing. Cases. Loops and Loop invariants. Assn. 1a due. Assn. 2 assigned. |
8.1. Process 8.2. Discovery 8.6. Loop invariants (Assignment 2) |
T. 2/3 | Debugging and testing: Diagnosing errors. Hand simulation. Debuggers. Tracing. Successive refinement. |
7.1. Diagnosing errors 7.2. Hand and eyeball checks 7.4. Program development and testing 7.5. Tracing 7.6. Using a debugger (6.9. Standards: tracing) |
W. 2/4 | C++: The memory and pointers. Calling modes. Const pointers. |
5.10.1. Memory 5.10.2. Pointers 5.7.5. Parameter passing 5.10.3. More on pointers |
F. 2/6 | Quiz 2. |
Review:(work all of the exercises!) 4.2 contracts 5.7.2 defining functions 8.3. Recursion 8.5 scan algorithms 8.7 search algorithms |
M. 2/9 | C++: Areas of memory. Allocating and deallocating memory. Dangling pointers. Memory leaks. Assn. 2a due. |
5.10.4. Areas of memory 5.10.5. Using the heap 5.10.6. Dangling pointers and memory faults |
T. 2/10 | Arrays. Arrays as pointers. Allocating and deallocating arrays. Arrays as parameters. |
5.11.1. Arrays 5.11.2. Array size 5.11.3. Arrays as pointers 5.11.4. Arrays as parameters 5.11.5. Allocating and deallocating arrays |
W. 2/11 | Assignment 3. Assn. 3 assigned. | Assignment 3 |
F. 2/13 | Working with arrays. | |
M. 2/16 | C++: Characters. Null-terminated strings. String constants. |
5.3.4. Characters 5.12.1. Null-terminated strings (5.12.2. String type) |
T. 2/17 | C++: Structures. |
5.13.1. Structures 5.13.2. Using structures |
W. 2/18 | C++: Constructors. Structures as function parameters. Assn. 3i due. |
5.13.3. Constructors 5.13.4. Structure parameters |
F. 2/20 | Quiz 3. |
Review: (work all of the exercises!) 5.10.2. Pointers 5.10.5. The heap 5.10.6. Dangling pointers 5.11.1. Arrays 5.11.3. Arrays as pointers 5.11.5. Allocating arrays 5.3.4. Characters 5.12.1. Null-terminated trings 5.7.5. Parameter passing 5.11.4. Arrays as parameters |
Sat. 2/21 | Assn. 1b due. | |
M. 2/23 | Data structures: Abstract data types. Conceptual lists. equations on lists. |
10.1.1. conceptual lists 10.1.2. equations |
T. 2/24 | Data structures: Linked lists. Functions on linked lists. |
5.13.5 additional issues on structures 10.1.3. Linked lists 10.1.4. Nondestructive functions on linked lists |
W. 2/25 | Assignment 4. Data structures: Priority queues. Assn. 3a due. Assn. 4 assigned. |
10.3.4. Priority queues Assignment 4 |
F. 2/27 | Data structures: Looping over linked lists. Destructive operations. |
10.1.6. Looping over lists 10.1.7. Destructive operations on lists |
Sat. 2/28 | Assn. 2b due. | |
M. 3/2 | Data structures: More on linked lists. Memory sharing. Comparison with arrays. |
10.1.5. Memory sharing 10.1.8. Comparison with arrays |
T. 3/3 | System: Linking. Header files. Function prototypes. Make and makefiles. |
3.4. Linking 5.7.3. Function prototypes (3.5. Make) (5.15. Preprocessor) (6.11. Standards: preprocessor) (6.14. Standards: other) |
W. 3/4 | Assignment 5. Assn. 4a due. Assn. 5 assigned. | Assignment 5 |
F. 3/6 | Quiz 4. |
Review: (work all of the exercises!) 5.13.1. Structures 5.13.2. Using structures 5.13.3. Constructors 10.1.1. Conceptual lists 10.1.2. Equations 10.1.3. Linked lists 10.1.4. Nondestructive functions on linked lists 10.1.6. Looping over lists 10.1.7. Destructive operations on lists) |
M. 3/9 to F. 3/13 | Spring break | |
M. 3/16 | Data structures: FIFO queues. Representing a queue as a linked list. |
10.3.1. FIFO queues 10.3.2. Linked queues |
T. 3/17 | Data structures: Representing a FIFO queue as an array. |
10.3.3. Array queues 5.11.6. Reallocating an array |
W. 3/18 | Data structures: Trees. Assn. 5i due. |
10.2.1. Trees 10.2.2. Trees in C++ |
F. 3/20 | Data structures: Functions on trees. Assn. 3B due. | 10.2.3. Traversing trees |
Sat. 3/21 | Assn. 3b due. | |
M. 3/23 | Cost: Algorithm analysis. Big O notation. Logarithms. |
9.1. Analysis 9.2. Example (9.3. Profilers) |
T. 3/24 | Data structures: Tables. Binary search trees. |
10.2.4. Tables and sets 10.2.5. Binary search trees |
W. 3/25 | Assignment 6. Assn. 5a due. Assn. 6 assigned. | Assignment 6 |
F. 3/27 | Quiz 5. |
Review: (work all of the exercises!) 10.3.1. FIFO queues 10.3.2. Linked queues 10.2.1. Trees 10.2.2. Trees in C++ 10.2.3. Traversing trees 9.1. Analysis |
Sat. 3/28 | Assn. 4b due. | |
M. 3/30 | Data structures: More on binary search trees. | |
T. 3/31 | Data structures: Balanced binary search trees. | 10.2.6. Balanced search trees |
W. 4/1 | Data structures: More on balanced binary search trees. Assn. 6i due. | 10.2.7. Implementation of balanced trees |
F. 4/3 | Holiday | |
M. 4/6 | Data structures: Heaps and priority queues. | 10.3.5. Heaps |
T. 4/7 | Data structures: More on heaps. | |
W. 4/8 | Assignment 7. Assn. 6a due. Assn. 7 assigned. | Assignment 7 |
F. 4/10 | Quiz 6. |
Review: (work all of the exercises!) 10.2.1 trees 10.2.2 trees in C++ 10.2.5 binary search trees 10.2.6 balanced search trees 10.3.5. Heaps |
Sat. 4/11 | Assn. 5b due. | |
M. 4/13 | Algorithms: Sorting. Elementary sorting. | |
T. 4/14 | HeapSort. | 10.3.6. Heapsort |
W. 4/15 | Quicksort. Assn. 7i due. | |
F. 4/17 | Sorting a linked list. | 10.1.9. Sorting a linked list |
M. 4/20 | A lower bound for sorting. | |
T. 4/21 | Data structures: Hash tables with chaining. | 10.4. Hash tables |
W. 4/22 | Data structures: Hash tables with open addressing. | |
F. 4/24 | Quiz 7. |
Review: (work all of the exercises!) 10.3.6. Heapsort 10.4. Hash tables 10.1.1. Conceptual lists 10.1.2. Equations on lists 10.1.3. Linked lists 10.1.4. Nondestructive functions on linked lists 10.1.6. Looping over lists |
Sat. 4/25 | Assn. 6b due. | |
M. 4/27 | Open. | |
T. 4/28 | Today is treated like a Friday. Open. Assn. 7 due. | |
W. 4/29 | Reading day. | |
W. 5/6 | Final exam, 11:00–1:30. |
You are encouraged to ask questions about your assignments when you are stumped, especially if you come up against a difficulty with the C++ language. For example, if you cannot understand why your program gets a compile error, and you are stuck, ask for help. Send questions early, to leave yourself time to make progress after receiving an answer.
A good way to ask questions is by email. Please use a subject indicating that you are asking a question for CSCI 3300, and always include your name in your email. A reasonable subject for a question about assignment 3 is
CSCI 3300 question about assignment 3Please send email to the address listed on the first page of this syllabus. Do not expect immediate answers. Give yourself time to get answers.
If you are asking questions about your program, attach the entire program, including all files. I do not have direct access to your work. Sometimes the real problem is not in the part that you think is at fault. There is no need to explain that what you have sent is a work in progress. I know that.
You can feel free to get help from anyone on the following issues concerning programming assignments.
But, other than from the instructor or graduate student tutor, it is considered cheating to obtain assistance for the following.
Never submit someone else's work as your own. That is plagiarism. Do not get a copy of a function definition from someone else and insert it into your program. Violations of these policies will be handled in a manner consistent with official university policy. If you submit someone else's work as your own, expect to recieve no credit. If your submission is 50% your work and 50% someone else's work, expect to receive no credit.
Note. To avoid problems with people stealing your work, do not recycle printouts of your program code in a place whether other students can pick them up. If someone asks for a copy of your work, do not supply it. Doing so risks receiving no credit for your own work.
For information about