Class meeting |
5:00–5:50 MTuWTh Brewster D105 |
---|---|
Instructor | Karl Abrahamson |
Office | Sci&Tech C-113 |
Office hours | M–Th 3:00–4:00, F 11:00–12:00 or by appointment |
Phone | 328-9689 |
abrahamsonk@ecu.edu | |
Course web page | www.cs.ecu.edu/~karl/2530/spr17/ |
My web page | www.cs.ecu.edu/~karl/ |
Lecture notes | CSCI 2530 Notes (www.cs.ecu.edu/~karl/2530/spr17/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 significant time each week outside of class reading, working the exercises and doing the assignments for this course.
The amount of time that you need to spend will depend greatly on how efficiently you work, and that will depend largely on whether you follow the instructions. I will show you how to work efficiently. It is up to you to put what I show you into practice.
In the past, many students have ignored my advice (and even their own common sense) and used software design methods that are proven time wasters. Those students have fared poorly. Hopefully, you will do better. Here are a few things that you should do and things to avoid.
Do.
Read the notes. Do the exercises in the notes. The exercises will help you to remember what you read and understand what you are doing when you work on assignments.
Come back to the notes later and read them again. You will get a lot more out of them that way.
Start to work on assignments early.
Write sensible, concise and precise documentation in your programs early. Do not try to keep information about what a function does only in your head. Writing it down forces you to make your thoughts precise, and that is crucial.
Documentation also is very valuable when you come back to your work. You will have forgotten things, and you do not want to spend time reverse-engineering what you wrote earlier.
Follow sound debugging procedures, as explained in class. Put useful traces in your program. Learn how and when to use a debugger.
Proofread what you write.
Draw pictures of data structures that you use. You cannot keep them in your head.
Ask questions when you are stuck. Do not just give up. Do not spend a lot of time trying to figure out one small issue.
Do not.
Do not wait until the due date to start an assignment.
If your program does not work, do not try random experimentation to try to get it work. That will waste your time as you make your program worse and worse.
If you start late, you will be tempted to turn in someone else's work. Do not plagiarize work, regardless of how tempting it is.
The prerequisite is CSCI 1010 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 1010, and so, according to university policy, you cannot repeat CSCI 1010 for credit after completing CSCI 2530. If you received a grade of less than C in CSCI 1010, or if you need to retake CSCI 1010 for any reason, do not take CSCI 2530 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 2540, although we introduce some of its most basic ideas in this course.
This course also introduces software design, development and debugging techniques. You will learn to work more like an expert.
For many of you, the material in this course is the closest you will come to machine language, an important topic for software developers to understand. This course therefore concentrates on the C subset of C++, with only a few features of C++ used. We will not use C++ libraries such as the Standard Template Library. We will see how things are done at a level close to machine architecture without relying on others do have implemented the ideas for us.
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).
Basics of the C subset of C++. 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, developing, understanding, testing and debugging programs and components of programs.
After successfully completing this course, students will have the following abilities.
There will be 7 quizzes, on the following dates.
There will be no makeups for missed quizzes.
Each quiz will take somewhat over half of the class period. Before the quiz we will review for the quiz.
You can bring one prepared 8.5x11" piece of paper, written on both sides, to each quiz. You can write anything that you like on that paper. I will not collect it.
I will drop your lowest quiz grade and count the remaining 6.
The final exam will be at 7:00pm–9:30pm Wednesday, April 26. 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.
Grading | |
---|---|
6 quizzes (best 6 of 7) | 33% (5.5% each) |
A comprehensive final exam | 23% |
Nine programming assignments | 35% total. By assignment number: (0: 1%) (1: 3%) (2: 3%) (3: 3%) (4: 3%) (5: 3%) (6: 6%) (7: 6%) (8: 7%) |
Attendance | 9% |
You will start with 9 points for attendance and lose one point for each unexcused absence. I will base attendance not only on what I record in class but also based on whether you took a quiz and on whether you were present to pick up a quiz when it was returned.
Tentative cutoffs for grades will be as follows. These cutoffs will not be raised.
Grade cutoffs | |
---|---|
A | 93% |
A– | 90% |
B+ | 87% |
B | 83% |
B– | 80% |
C+ | 76% |
C | 72% |
C– | 68% |
D+ | 64% |
D | 60% |
D– | 56% |
IMPORTANT |
---|
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% overall grade in the programming assignments.This supersedes 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 are available from the course web page. Scroll to the bottom of the page.
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.
The first few assignments are considerably shorter than later assignments. Do not become complacent.
I will compile and run programs using the g++ compiler on Linux. I will use the following flags when compiling programs:
-g -Wall -W -Wshadow -OI strongly suggest that you test your programs using the same compiler with the same flags.
Students who do inadequate testing can expect poor grades.
Never make a modification, no matter how trivial, without testing your work before submitting it.
Grading of submissions is explained in the notes. Read that page about how programs will be graded so that you are aware of expectations.
An important point concerns programs that do not compile without fatal errors. I expect you to write working computer programs. I expect you to test your programs on several inputs. If your program does not compile, I know that you have not tested it even once. Accordingly,
IMPORTANT |
---|
A program that does not compile without fatal errors receives a grade of 0, regardless of how much work you have put into it or of how close it is to working. |
Plagiarism of programming assignments is a serious problem. Never submit someone else's work as your own. Do not get a copy of a function definition from someone else and insert it into your program. You are expected to do all of your own work. If your submission is 50% your work and 50% someone else's work, then your work is considered to be plagiarized.
IMPORTANT |
---|
If I believe that you have submitted plagiarized work,
you will receive a grade of −50 points on
that assignment.
Yes, your points will be negative. If you share your work with another student, expect that student to submit your work with his or her name on it. That has happened many times. Both of you will receive a score of −50. |
If I say that your assignment is plagiarized and you do not agree, you are welcome to discuss it with me to explain the circumstances.
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.
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 choice, 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.
Resolve to work hard and get a good grade in this class.
Attend class. Arrive on time.
Do not bring distractions to class. If you read your email, listen to music, send and receive text messages or engage in other distracting activities during class, you will get very little out of class. That will show up in your grade.
Ask questions in class. If you do not understand something, ask a question about it.
Ask questions outside of class. If you have a question about an assignment, submit your work so far as a question, as explained in the assignment, and send me an email with your question. Ask questions early. Do not wait until the last minute.
Please use a subject indicating that you are asking a question for CSCI 2530, and always include your name in your email. A reasonable subject for a question about assignment 3 is
CSCI 2530 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.
Schedule time to work outside of class.
Do not allow yourself to fall behind. Work on the assignments 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!
Read the lecture notes twice. Take a break (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 think clearly, and sleep afterwards is critical for moving new information into permanent memory.
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.
Quiz dates list review material for the quiz. You should be able to understand what each quiz will cover based on that review material.
This outline is tentative and might need to be adjusted, based on how many questions there are and on how quickly we are able to cover topics.
Date | Topics | Reading | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
M. 1/9 | Class canceled due to ice. | |||||||||||||||
Tu. 1/10 |
Introduction: Syllabus. General advice. Avoiding the swamp. C, C++, Java and Smalltalk. |
|
||||||||||||||
W. 1/11 |
Assignment 0 assigned. System: System: Linux, xlogin. Compiling and running C++ programs. Grading of programming assignments. Coding standards. C++: Expressions and statements Creating and using variables. |
|||||||||||||||
Th. 1/12 |
C++: Numeric types and constants. Types bool and char. Arrays |
|
||||||||||||||
M. 1/16 | Holiday | |||||||||||||||
Tu. 1/17 |
C++: Functions Defining functions Parameters Scope |
|
||||||||||||||
W. 1/18 |
Assignment 0 due. C++: Boolean values and expressions. Comparisons. Converting from English to boolean expressions If-statements. Compound statements. Indentation. |
|
||||||||||||||
Th. 1/19 |
Quiz 1: Numeric and boolean expressions. Precedence. Variables. If-statements. Defining functions. Elementary arrays. |
|||||||||||||||
M. 1/23 |
C++: While-loops. Functions with loops. Planning a loop. Hand-simulating loops. Watch out: semicolons |
|
||||||||||||||
Tu. 1/24 |
Function contracts. Procedures. Input and output using cstdio. |
|||||||||||||||
W. 1/25 |
Assignment 1 assigned. C++: The main function For-loops. Breaking out of loops. |
|
||||||||||||||
Th. 1/26 |
Algorithms: Scan algorithms with loops. Search algorithms with loops. |
|
||||||||||||||
M. 1/30 |
C++: Function calls and frames. Algorithms: Recursion. Recursive algorithms and equations. |
|
||||||||||||||
Tu. 1/31 |
Algorithms: Scan algorithms with recursion. Search algorithms with recursion. Tail recursion. |
|
||||||||||||||
W. 2/1 |
Assignment 2 assigned. C++: The memory and pointers. Pointer diagrams Operations on pointers. |
|
||||||||||||||
Th. 2/2 |
Assignment 1 due. Quiz 2: Loops. Defining functions. Recursion. Scan algorithms. Search algorithms. |
Review: (work the exercises!)
|
||||||||||||||
M. 2/6 |
C++: Parameter passing. Call by value and by reference. Areas of memory. The new and delete operators. Memory leaks. Dangling pointers. |
|
||||||||||||||
Tu. 2/7 |
Arrays. Arrays as pointers. Arrays as parameters. |
|
||||||||||||||
W. 2/8 |
C++: Const array parameters. Allocating and deallocating arrays. Examples with arrays. |
|
||||||||||||||
Th. 2/9 |
Assignment 2 due. Assignment 3 assigned. Assignment 3. Equivalence relations. A data structure for managing equivalence relations. |
|
||||||||||||||
M. 2/13 |
C++: Array size. Pointer arithmetic. Characters. Null-terminated strings. String constants. Functions on null-terminated strings. |
|
||||||||||||||
Tu. 2/14 |
C++: More on null-terminated strings. Header files. Linking. Function prototypes. |
|
||||||||||||||
W. 2/15 |
C++: Structures. Operations on structures. Arrays of structures. Constructors. Passing structures to functions. |
|
||||||||||||||
Th. 2/16 |
Quiz 3: Parameter passing modes. Pointers. Allocating and deallocating memory in the heap. Arrays. Arrays as pointers. Allocating arrays. Null-terminated strings. |
Review: (work the exercises!) |
||||||||||||||
M. 2/20 |
Assignment 3 due. Assignment 4 assigned. Assignment 4. Weighted graphs. Minimal spanning trees. Kruskal's algorithm. |
|
||||||||||||||
Tu. 2/21 |
C++: Pointers to structures Recursive structures Data structures: Linked lists. Functions on linked lists. |
|
||||||||||||||
W. 2/22 | Data structures:
|
|||||||||||||||
Th. 2/23 |
Algorithms: Linked lists. Recursive algorithms and equations. |
|
||||||||||||||
M. 2/27 |
Data structures: Linked lists. Destructive algorithms. Memory sharing. |
|
||||||||||||||
Tu. 2/28 |
Debugging: Tracing. Controlling tracing. Using gdb. |
|
||||||||||||||
W. 3/1 |
Assignment 5 assigned. Assignment 5. Priority queues. |
|
||||||||||||||
Th. 3/2 |
Assignment 4 due. Quiz 4: Structures. Linked lists. Conceptual lists. Equations on conceptual lists. Iterative and recursive algorithms on linked lists. |
Review: (work the exercises!) |
||||||||||||||
M. 3/6 to F. 3/10 | Spring break | |||||||||||||||
M. 3/13 |
Assignment 6 assigned. Assignment 6. Shortest paths and Dijkstra's algorithm. Simulation. Events and the event queue. Representing a graph using an adjacency list. |
|
||||||||||||||
Tu. 3/14 |
Algorithm analysis: Running time as a function of input size. Big-O and big-Θ notation. Logarithms. |
|
||||||||||||||
W. 3/15 |
Assignment 5 due. Data structures: Binary Trees. Functions on trees. |
|
||||||||||||||
Th. 3/16 |
Data structures: Traversing a tree. Trees as representations of sets. Binary search trees. |
|
||||||||||||||
M. 3/20 |
More on binary search trees. Insert. Remove. |
|
||||||||||||||
Tu. 3/21 |
Data structures: Height-balanced binary search trees. Rotations. |
|
||||||||||||||
W. 3/22 |
Data structures: More on balanced binary search trees. |
|
||||||||||||||
Th. 3/23 |
Quiz 5: Analysis of algorithms. Binary trees. Binary search trees. |
Review: (work the exercises!)
|
||||||||||||||
M. 3/27 |
Assignment 7 assigned. Assignment 7. Longest increasing sublists |
|
||||||||||||||
Tu. 3/28 |
Assignment 6 due. More on assignment 7. Reference counts. |
|
||||||||||||||
W. 3/29 |
Data structures: Binary search trees as tables. Hash tables with chaining. |
|
||||||||||||||
Th. 3/30 |
Data structures: Hash tables with open addressing. |
|
||||||||||||||
M. 4/3 |
Data structures: Heaps and priority queues. Operations on heaps. |
|
||||||||||||||
Tu. 4/4 |
Assignment 8 assigned. Assignment 8. Huffman trees. Creating a Huffman code. |
|
||||||||||||||
W. 4/5 |
More on assignment 8. Encoding. Decoding. Writing and reading a tree. |
|
||||||||||||||
Th. 4/6 |
Quiz 6: Balanced binary search trees. Heaps. Hash tables. |
Review: (work the exercises!)
|
||||||||||||||
M. 4/10 |
Algorithms: Sorting. Naive sorting. Analysis of naive sorting. MergeSort. Analysis of MergeSort. |
|
||||||||||||||
Tu. 4/11 |
Assignment 7 due. Algorithms: Quicksort. |
|||||||||||||||
W. 4/12 |
Algorithms: Heapsort. Analysis of Heapsort. |
|
||||||||||||||
Th. 4/13 |
Algorithms: A lower bound for sorting. |
|||||||||||||||
M. 4/17 |
Review: Equations on linked lists. |
|
||||||||||||||
Tu. 4/18 |
Review: Scan and search algorithms. |
|
||||||||||||||
W. 4/19 |
Review: Null-terminated strings. |
|
||||||||||||||
Th. 4/20 |
Quiz 7: Sorting Linked lists. Null-terminated strings. |
Review: (work the exercises!)
|
||||||||||||||
M. 4/24 |
Review. Binary search trees. |
|
||||||||||||||
Tu. 4/25 |
Assignment 8 due. Today is treated like a Friday. We do not meet. |
|||||||||||||||
W. 4/26 | Final exam, 7:00pm–9:30pm, Brewster D105 |
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.
For information about
please see the auxiliary information at http://www.cs.ecu.edu/~karl/2530/spr17/syllabus-aux.html.