CS361, Summer 2021

CS361 Outline

Summer 2021

Welcome to CS361

  • The course is divided into three parts. Each part contains multiple modules, including some assignments, and an exam.

  • Each module consists of a series of activities. These include reading, taking self-assessment quizzes, and doing assignments.

    • Not every assigned activity requires you to submit something for grading. Nonetheless, you are expected to complete all of them.

    • If an activity is not marked with its own due date, then it is considered to be due at the end of the date range given for that module.

KEYS TO SUCCESS IN THIS COURSE:

  • READ THE SYLLABUS

    The syllabus lays out the basic course policies. It tells you what you need to do to earn a passing grade. It tells you when you need to have done that by. It tells you how to get in touch with me if you run into problems.

  • HAVE A SCHEDULE

    You have some freedom to schedule your own time in this course, but you DO need to set up a schedule. Don’t forget that this course exists and that you are registered for it. Don’t think you can repeatedly set it aside for weeks at a time and make up the time later.

  • IF YOU DON’T UNDERSTAND SOMETHING, ASK QUESTIONS

    In a web course, my role as Instructor changes from “lecturer” to “tutor”. You can ask questions in the course Forums. You can send me email. You can also contact me during office hours. You’ll find more information on these options in the syllabus and other documents on the Course Policies page.

    Some people are too shy to ask questions. Some are too proud to ask questions. My advice to both groups is to get over it! Part of being educated is knowing how to exploit your available information resources. In this course, I am one of those resources.

Upcoming Events
1 Part I 05/17/2021 - 06/15/2021
1.1 Overview and ADTs Review 05/17/2021 - 05/24/2021

Overview

Coming into this course, you should already be familiar with Abstract Data Types and with the way that C++ classes are used to implement them.

To be certain that everyone is on the same page, however, this module examines some critical information about ADTs, classes, templates in C++. Most of this material should be review for you. (If not, you can find more detailed treatments on the websites for the pre-requisite courses CS250 or CS333.) But it may be some time since you have seen it, or, if you are a recent transfer to ODU, your prior courses might not have covered all of it.

Because the C++ language is evolving, there may be some code that looks unfamiliar simply because it takes advantage of the C++17 standard.

Activities
  1. lab Do: Add your personal intro in the Forums on Blackboard.

  2. event Attend: Orientation 05/18/2021, 7:00PM EDT

  3. reading Read Weiss, Ch 1

  4. lab Do: Setting Up Your Personal Programming Environment 05/19/2021
  5. lecture Read: Abstraction and Abstract Data Types
  6. lecture Read: ADT Interfaces in C++
  7. lecture Read: Implementing ADTs in C++
  8. selfassess Take the self-assessment: Visibility & Type Annotations (in Self-Assessments in Blackboard)
  9. lecture Read: Copying and Moving Data
  10. video Watch Working on Assignments

  11. selfassess Take the self-assessment: Working with Classes (in Self-Assessments in Blackboard)
  12. asst Do the assignment: A Read Letter Day Due: 05/25/2021

1.2 Templates and Iterators 05/24/2021 - 05/29/2021

Overview

  • Templates are a mechanism for writing algorithmic patterns that can be applied to a wide variety of different data types.

  • Iterators are a data abstraction for the notion of a position within a container of data. Iterators allow us to express many simple algorithms in a simple form, regardless of whether the underlying container is an array, a linked list, a tree, or some other data structure.

Templates and iterators are often used together to provde patterns for code that can be applied to a wide range of underlying data structures.

1.3 Algorithm Analysis 05/30/2021 - 06/04/2021

Overview

An important theme throughout this semester will be viewing the process of developing software as an engineering process. Now, engineers in traditional engineering disciplines, civil engineers, electrical engineers, and the like, face trade offs in developing a new product, trade offs in cost, performance, and quality.

Software developers face the same kinds of choices. Early on, you may have several alternative designs and need to make a decision about which of those designs to actually pursue. It’s no good waiting until the program has already been implemented, written down in code. By then you’ve already committed to one design and invested significant resources into it.

In this module, we’ll look at mathematical techniques for analyzing algorithms to determine what their speed will be, or, more precisely, how badly their speed will degrade as we apply them to larger and larger amounts of data. The key to doing this will be to analyze the code for its worst case complexity.

Activities
  1. lecture Read: Analysis of Algorithms: Motivation
  2. reading Read Weiss, Ch 2
  3. lecture Read: Analysis of Algorithms: Worst Case Complexity
  4. lecture Read: The Algebra of Big-O

  5. selfassess Take the self-assessment: Big-O Algebra
  6. lecture Read: Worst-Case Complexity Analysis

  7. selfassess Take the self-assessment: Complexity: step-by-step, short program fragments (in Blackboard)
  8. lecture Read: Case Studies: Analyzing Standalone Functions

  9. selfassess Take the self-assessment: Complexity: functions (in Blackboard)
  10. video Watch Worst-Case Analysis (example)

  11. selfassess Take the self-assessment: Respondus check (in Blackboard) Due: 06/01/2021

  12. quiz Take the quiz: Quiz: Worst Case Complexity (in Blackboard) Due: 06/04/2021
1.4 Sequences 06/05/2021 - 06/13/2021

Overview

A substantial amount of the data that we work with is arranged into a simple linear ordering, one thing after another. Of course, you are already quite familiar with one way of doing this, by putting the data into arrays.

In this module we explore the common variations on ADTs for maintaining data in a sequence: vectors, linked lists, stacks, and queues.

The combination of templates and iterators, combined with a wider range of container types, brings us to generic programming, an important and pervasive style of coding in C++.

1.4.1 Vectors
Activities
  1. reading Read Weiss, Ch 3
  2. lecture Read: Vectors
  3. selfassess Take the self-assessment: Self-Assessment: Working with Vectors
  4. lecture Read: Implementing the Vector Class
1.4.2 Lists
Activities
  1. lecture Read: Linked Lists
  2. lecture Read: Linked List Applications
  3. lecture Read: Standard Lists
  4. selfassess Take the self-assessment: Linear Sequences
  5. asst Do the assignment: Lists & Iterators Due: 07/12/2021

1.4.3 Generic Programming
Activities
  1. lecture Read: Generic Programming
  2. selfassess Take the self-assessment: Self-Assessment: Generic Programming
1.5 Stacks and Queues 06/09/2021 - 06/13/2021
Activities
  1. lecture Read: Recursion
  2. selfassess Take the self-assessment: Self-Assessment: Recursion
  3. lecture Read: Stacks
  4. lecture Read: Queues
  1. video Watch Working with Queues

  2. lecture Read: Deques

1.6 End of Part I
Activities
  1. exam Take the exam: Exam 1 (on Blackboard) 06/13/2021 - 06/15/2021
2 Part II 06/14/2021 - 07/12/2021
2.1 Average Case Complexity
2.1.1 Average Complexity 06/14/2021 - 06/20/2021

Overview

In Part I, we analyzed the speed of algorithms exclusively from the point of view of the worst case. One might argue that this is unnecessarily pessimistic on our part. There are some algorithms for the worst case input is rare enough that we might not be worried about it, particularly if we believe that typical inputs can be handled much more quickly.

We therefore next turn to the idea of average case complexity a measure of how the average behavior of a program degrades as the input sets get larger and larger.

2.1.2 Sorting 06/21/2021 - 06/24/2021

Overview

Sorting algorithms arrange data stored in a sequence into a new desired order.

Because the data structures involved are elementary (arrays, vectors, and, occasionally, linked lists) and because the need for sorted data arises in so many practical applications, you probably learned learned one or more sorting algorithms in your earliest programming classes.

But sorting is actually a fairly subtle problem, and the sorting algorithms taught to beginning programmers are chosen for simplicity, not performance. They are often slow and rather clumsy.

In this section we’ll look at more sophisticated sorting algorithms. We’ll also consider the fundamental limits on just how fast a sorting algorithm can get, and we’ll see that some practical algorithms actually approach that upper speed limit.

Activities
  1. reading Read Weiss, Ch 7

  2. lecture Read: Sorting --- Insertion Sort

  3. lecture Read: Sorting Speed Limits

  4. lecture Read: Sorting --- Merge Sort

  5. lecture Read: Sorting --- Quick Sort

  6. selfassess Take the self-assessment: Self-Assessment: Sorting

2.2 Trees 06/25/2021 - 07/04/2021

Overview

Most of the data structures we have looked at so far have been devoted to keeping a collection of elements in some linear order.

Trees are the most common non-linear data structure in computer science. Trees are useful in representing things that naturally occur in hierarchies (e.g., many company organization charts are trees) and for things that are related in a “is-composed-of” or "contains manner (e.g., this country is composed of states, each state is composed of counties, each county contains cities, each city contains streets, etc.)

Trees also turn out to be exceedingly useful in implementing associative containers like std::set. Properly implemented, a tree can lead to an implementation that can be both searched and inserted into in O(log N) time. Compare this to the data structures we’ve seen so far, which may allow us to search in O(log N) time but insert in O(N), or insert in O(1) but search in O(N).

2.2.1 General Trees
Activities
  1. reading Read Weiss, Ch 4

  2. lecture Read: Trees

  3. asst Do the assignment: Trees Due: 07/01/2021

2.2.2 Search Trees
Activities
  1. lecture Read: Binary Search Trees
  2. lecture Read: Traversing Trees with Iterators
  3. reading Read Weiss, Ch 12.2
  4. lecture Read: Balanced Search Trees
2.2.3 Sets and Maps
Activities
  1. lecture Read: Sets and MultiSets
  2. lecture Read: Maps and MultiMaps
  3. video Watch Working with Sets & Maps

  4. selfassess Take the self-assessment: Self-Assessment: Sets and Maps

  5. asst Do the assignment: Associative Containers Due: 07/07/2021

2.3 Hashing 07/05/2021 - 07/11/2021

Overview

Hashing is an alternative to trees for providing fast associative containers (sets and maps).

Hashing stored data in arrays (primarily), but does not store them in any predictable order, or even contiguously. Instead, hashing uses a special “hash function” to compute a desired location for any key we want to insert. If you don’t actually know the internal details of the hash function, its choices of locations would seem arbitrary, almost random.

Nonetheless, it works, and in many cases works well. Hash tables can often store and search for data in O(1) average time.

Activities
  1. lecture Read: Hashing

  2. reading Read Weiss, Ch 5

  3. lecture Read: Resolving Collisions

  4. lecture Read: Rehashing (Variable Hashing)

  5. lecture Read: Hash-Based Sets and Maps
  6. selfassess Take the self-assessment: Self-Assessment: Unordered Sets
  7. asst Do the assignment: Hashing Due: 07/13/2021

2.4 End of Part II
Activities
  1. exam Take the exam: Exam 2 07/11/2021 - 07/12/2021
3 Part III 07/12/2021 - 08/05/2021
3.1 Algorithm Design Techniques 07/12/2021 - 07/23/2021

Overview

By this point in the semester, you’ve learned a lot of algorithms. Many practical problems can be solved by direct application of these. But what do you do when faced with an unfamiliar problem, one for which none of the “canned” algorithms in your personal toolbox are suitable?

When you have to design your own algorithms, you should consider some of the common patterns or styles that are available to you. This lesson looks at these styles, many of which we have seen before, and a few new ones as well.

3.2 Heaps and Priority Queues 07/24/2021 - 07/29/2021

Overview

A priority queue is an ADT that allows us to repeatedly find and remove the largest (or smallest) item from a colleciton of data. They take their name from the idea that they implement a “queue” of items awaiting processing, but one in which some items have higher priority than others and so get to jump to the head of the line if nothing ahead has even higher priority.

Priority queues are generally implemented using heaps, a tree with very special ordering properties.

Activities
  1. reading Read Weiss, Ch 6
  2. lecture Read: Priority Queues
  3. lecture Read: Heaps
  4. lecture Read: Heapsort

3.3 Graphs 07/30/2021 - 08/05/2021

Overview

A graph is a collection of vertices (nodes) connected by edges in arbitrary fashion. Graphs are used to represent data relationships that are far more complicated than could be represented using trees or lists.

Activities
  1. reading Read Weiss, Ch 9
  2. lecture Read: Graphs --- the Basics
  3. lecture Read: Graphs --- ADT and Traversing

  4. lecture Read: Graphs --- Sample Algorithms
  5. video Watch Graph algorithms: traverse and min path

  6. selfassess Take the self-assessment: Graph Basics

  7. lecture Read: Sharing Pointers and Garbage Collection
  8. video Watch Graph algorithms: max-flow and min-cut

  9. asst Do the assignment: Graphs Due: 08/05/2021

3.4 End of Part III
Activities
  1. exam Take the exam: Final exam (cumulative) 08/05/2021 - 08/06/2021
Symbol Key
conference Conference
slides Slides & Lecture Notes
text Textbook readings
exam Exam
lab Lab Assignment
asst Assignment
project Project
unix CS252 (Unix) Assignment

All times in this schedule are given in Eastern Time.