Background information

Course description

In CS 315, Algorithm Design and Analysis, you learn how to design and analyze algorithms. You see many algorithms that are standard tools for the working programmer, especially algorithms for searching and sorting lists, manipulating graphs, string matching, and numeric algorithms. You learn how to analyze time and space requirements of algorithms and see the concept of NP-completeness.

This course assumes that you are familiar with basic concepts of programming in a general purpose programming language such as C, C++, or Java, including programming features such as variables, control flow, iteration, and recursion, and structures such as arrays and records. The course reviews and extends your knowledge of queues, stacks, trees, and graphs. It covers asymptotic rate of growth, big-O, big-Theta, big-Omega, and recurrences, including the Master Theorem. You should be facile with college algebra (especially polynomial, logarithmic, and exponential functions), basic concepts of logic, set theory, and proof construction, counting techniques, and basic graph theory. The course only uses a small amount of calculus.

Although many modern programming languages provide libraries or built-in functions that implement data structures and algorithms we cover in the class, you will be coding them from basic elements in order to learn the underlying principles. Not using built-ins and libraries will be frustrating.

Times and places

Class TR 12:30p-1:45 TR, Zoom 894 6727 7137, passcode 054428
Web http://www.cs.uky.edu/~raphael/courses/CS315.html
Instructor Raphael Finkel <raphael@cs.uky.edu>
Instructor Office hours M 12:30p-2:00p, W 10:00a-11:30a, Zoom 581 609 732
Instructor Telephone 7-3885
TA Patrick Shepherd <patrick.shepherd@uky.edu>
TA Office hours T 11-12:30, F 10-11:30, Zoom 884 9225 2150, passcode 566799

Homework

This course has five programming assignments. You may write your programs in C, C++, or Java, but not in any other language. The Linux machines in the MultiLab are available for your use; you may also use home machines. You can use ssh, putty, Termius, or other software to access the MultiLab. Machines include (all with .cs.uky.edu): pen, cor, lily, orchid, rose, and tansy. See https://www.cs.uky.edu/docs/users/multilab.html for more details about the MultiLab. You must use a VPN to connect to these machines if you are off-campus.

Grading

A tentative breakdown of grading weights:

 	Attendance: 10%
 	Midterm and final: 40% (15% for worse, 25% for better)
 	Programming homework:  50%
Each program can earn 100 points maximum. It can also earn extra credit on an independent scale; 0.5 is a small amount, 1.0 is a significant amount, and 2.0 is a large amount of extra credit on an assignment. Assignments often include extra-credit ideas, but you can also invent your own. There is no limit to extra credit. You only get extra credit if (1) you turn the program in on time, and (2) you describe your extra credit in your documentation. Extra credit is only used at the end of the semester to advance grades over nearby boundaries.

Attendance policy: If you attend 80% or more of the classes (ignoring classes for which you have an excused absence), you get the full 10 points. If you attend fewer than 80%, you get 0 attendance points. If illness or another event beyond your control forces you to miss a deadline or a test, let me know as soon as possible. I do not assign I (incomplete) grades to students who wait weeks before informing me of a problem.

Grade cutoffs: 90=A 80=B 65=C 50=D.

Books

The text for the course is Mark Allen Weiss, Data Structures & Algorithm Analysis in C++, any edition (there are 4 editions), Addison-Wesley Longman, 1999; ISBN 0201361221 (2nd edition), 032144146X (3rd edition), 0273769383 (4th edition). We will not follow the book closely; it is, however, a good reference. The same author has a Java version (3 editions).

Additional material is available at http://www.cs.uky.edu/~raphael/courses/CS315.html.

There are many other books on algorithm design, including ones by Manber, Sedgwick, and Wirth.

Responsible use of computers

Read the Policy governing access to and use of University of Kentucky computing resources , available at https://www.uky.edu/regs/ar10-1. You must respect the privacy of others. You must not attempt to gain access to the files or directories of another user without clear authorization from the other user. You should not attempt to intercept any network communications, such as electronic mail or user-to-user dialog. You must not intentionally interfere with or alter the integrity of the computer systems.

Plagiarism

The University Senate Rules Section 6.3.1 stipulate that all academic work, written or otherwise, that you submit must be the result of your own thought, research, or self-expression. It is a serious offense to allow other students to copy your work or to copy the work of other students (even if it is in a public computer file or on github based on similar assignments). You may not use any code you find on the Internet. If you borrow ideas, algorithms, wording, or code from other sources, you must acknowledge that fact or you have committed plagiarism. It is permissible to take algorithms from books, for instance, but you must credit the book. If you re-use code you acquired in a previous course, insert a comment indicating what course provided the code. You may certainly discuss ideas with others, but when you submit a program, it should be entirely your own code. Don't look at each other's code and don't show your code to others. If you are explicitly allowed to work in teams, then each team is treated as an individual with respect to the rules about plagiarism.

Tentative Schedule

 Th
Jan 26 0
Feb 2 1
Feb 9 1a
Feb 16 2
Feb 23 2
Mar 2 3b
Mar 9 4
Mar 16 m
Mar 23 4c
Mar 30 5
Apr 6 6
Apr 13 6d
Apr 20 7
Apr 27 7
May 4 7e n
May 13  f
Code Meaning
Linked list and tree structures
Searching (sequential, binary, selection, finding nth largest)
Sorting (insertion, selection, merge, quick, heap, tree, bin,
 radix)
Balanced trees (2-3, red-black, B)
Hashing
Graphs (depth-first search, breadth-first search, connected
 components, shortest paths, spanning trees)
Numeric algorithms (Euclidean, fast multiplication)
Strings (pattern matching)
Intractability (P, NP, NP-completeness)
Assignment 1 due (Friday 12:30am)
Assignment 2 due (Friday 12:30am)
Assignment 3 due (Friday 12:30am)
Assignment 4 due (Friday 12:30am)
Assignment 5 due (Wednesday 12:30am)
Midterm exam (in class)
Midterm post-exam discussion
Final: Thursday, May 13 10:30 am - 12:30 pm
No class - University holiday

Late penalty

Turning in work late costs 3% for each day late, starting at class time on the due date, but not including weekends or holidays. The maximum penalty is 7 days late; after that, you may hand in work and still get 79% until class time Wednesday of the last week of instruction, which is the absolute deadline. No extra credit is available on late work. If you turn in work early, you gain early credit, which offsets late penalties on other assignments but have no other value.

How to submit work

Submit all work via Canvas. Collect all the files in your assignment (including program, documentation, test data, and output, into a single file (you may use shar, rar, zip, gzip, bzip2, or tar). This online facility time-stamps your submission. You may prepare your programs on any machine you like, but it must be capable of running correctly under Linux in the MultiLab.

Programming standards

Your program and documentation will have no misspellings. Your English will be legible, grammatical, and correctly punctuated. You will not have any lines longer than 80 characters. Consult http://www.cs.uky.edu/~raphael/writing.html to see how to compose technical prose. You will lose points for misspellings and grammar errors.

Your submittal will come with external documentation. This documentation is usually in a separate file called README. External documentation includes information for the user of the program (who inhabits the space above the horizontal line in my diagram of a software tool). It tells such a user what the program is intended to do, how to invoke the program, what the program expects as input, and what sort of output to expect. If the program requires compilation, this documentation includes how to compile/link/invoke the program. A Makefile is the best way to provide this part of the external documentation. Multiple Makefiles are less useful than a single makefile with multiple targets.

Your submittal will come with internal documentation. This documentation need not be in a separate file. Internal documentation includes information for the implementer/maintainer of the program (who inhabits the space below the horizontal line in my diagram of a software tool). It tells how the program does what it does, describing any non-obvious data structures (such as pseudo-data to shorten loops). It includes comments embedded in the program documenting variables, procedures, and methods. Don't overload your program with comments, though; a well-written program is mostly self-documenting.

Your submittal will come with test data that thoroughly exercise the code and with the expected results of running the program with those test data. A typescript file is not necessary but can satisfy this requirement.

Please refer to the checklist at http://www.cs.uky.edu/~raphael/checklist.html for advice on writing high-quality programs.

If you need help

If you need assistance understanding the course material or doing the projects, the first places to turn are the instructor and the TA during office hours. Tau Beta Pi has tutors on the 3rd floor of FPAT: http://www.cs.uky.edu/~raphael/courses/TBP_Tutors.jpg. There are other resources available, enumerated at
http://www.cs.uky.edu/~raphael/courses/Student_Resources_Spring_2020.pdf.

Learning outcomes

The course should satisfy the following Student Learning Outcomes.

  1. I have acquired or improved my ability to apply knowledge of computing and mathematics appropriately to the discipline.
  2. I am able to analyze a complex computing problem and to apply principles of computing and other relevant disciplines to identify solutions.
  3. I am able to design, implement, and evaluate a computing-based solution to meet a given set of computing requirements in the context of the program's discipline.
  4. am able to apply computer science theory and software development fundamentals to produce computing-based solutions.
  5. I understand the limiting factors of resources such as time and space in algorithmic solutions.
  6. I understand how to approach the algorithm design and analysis.
  7. I understand the basic algorithms and data structures and how to compare their quality.
  8. I understand how to analyze experimentally the performance of programs.
  9. I am able to analyze a complex computing problem and to apply principles of computing and other relevant disciplines to identify solutions.
  10. I am able to design, implement, and evaluate a computer-based system, process, component, or program to meet desired needs.
  11. I understand the limiting factors of resources such as time and space in algorithmic solutions.
  12. I am able to apply basic methods to the algorithm design and analysis.
  13. I understand the fundamental algorithms and data structures, their applications, and how to compare their quality.
  14. I am able to analyze experimentally the performance of programs.

Boilerplate

All the content under "Boilerplate language" in https://www.uky.edu/universitysenate/sites/www.uky.edu.universitysenate/files/Files/Forms/Syllabus%20Template_DL_20210122.docx is included by reference.