Foothill CollegeApproved Course Outlines

Physical Sciences, Mathematics & Engineering Division
C S 2CADVANCED DATA STRUCTURES & ALGORITHMS IN C++Winter 2014
4 hours lecture, 3 hours laboratory.5 Units

Total Quarter Learning Hours: 84 (Total of All Lecture, Lecture/Lab, and Lab hours X 12)
 
 Lecture Hours: 4 Lab Hours: 3 Lecture/Lab:
 Note: If Lab hours are specified, see item 10. Lab Content below.

Repeatability -
Statement: Not Repeatable.

Status -
 Course Status: ActiveGrading: Letter Grade with P/NP option
 Degree Status: ApplicableCredit Status: Credit
 Degree or Certificate Requirement: AS Degree,   Foothill GE
 GE Status: Communication & Analytical Thinking

Articulation Office Information -
 Transferability: BothValidation: 07/01/2013

1. Description -
Systematic treatment of advanced data structures, algorithm analysis and abstract data types in the C++ programming language. Coding topics include the development of ADTs from scratch, building ADTs on top of the STL templates, vectors, lists, trees, maps, hashing functions and graphs. Concept topics include searching, big-O time complexity, analysis of all major sorting techniques, top down splaying, AVL tree balancing, shortest path algorithms, minimum spanning trees and maximum flow graphs.
Prerequisite: C S 2B.
Co-requisite: None
Advisory: One of the following: ENGL 1A, 1AH, 1S & 1T or ESLL 26.

2. Course Objectives -
The student will be able to:
  1. Implement a user-defined vector abstract data type (ADT) and its associated iterator from scratch, and compare the performance to the built-in C++ standard template library (STL) vector.
  2. Implement a user-defined linked-list ADT and its associated iterator from scratch, and compare the user-defined performance to the built-in C++ STL list.
  3. Build stack, queue and sparse matrix ADTs using C++ vectors and lists.
  4. Compute the big-O, little-o, omega and theta time complexity of search and sort algorithms.
  5. Define asymptotic behavior and perform empirical benchmarks to compare brute-force techniques with divide-and-conquer strategies.
  6. Analyze the basic algorithms of a general tree ADT.
  7. Use object-oriented programming (OOP) to create alternative implementations of binary search trees in C++ and verify or compare the logN behavior of each.
  8. Describe the advantages of balanced trees and analyze the performance of AVL trees.
  9. Write code using the STL that realizes a Splay Tree using either top-down or bottom-up splaying.
  10. Define linear probing, quadratic probing and open addressing as used in the hash tables ADT.
  11. Design a priority queue using heaps in C++.
  12. Analyze, classify and measure the main non-NlogN sorts and write a clear report of the results.
  13. Implement a C++ Quicksort and at least one other NlogN sort and compare the results as the number of data items approaches infinity.
  14. Define indirect sorting and explain why it is particularly important in C++.
  15. Create a graph data structure using OOP techniques and the STL container classes, and implement shortest path, minimum spanning tree and maximum flow problems.
  16. Describe common applications for each data structure studied in the course.
  17. Arrive at a strategy for selecting the right data structure for the job.
3. Special Facilities and/or Equipment -
  1. Access to a computer laboratory with C++ compilers.
  2. Website or course management system with an assignment posting component (through which all lab assignments are to be submitted) and a forum component (where students can discuss course material and receive help from the instructor). This applies to all sections, including on-campus (i.e., face-to-face) offerings.
  3. When taught via Foothill Global Access on the Internet, the college will provide a fully functional and maintained course management system through which the instructor and students can interact.
  4. When taught via Foothill Global Access on the Internet, students must have currently existing e-mail accounts and ongoing access to computers with internet capabilities.

4. Course Content (Body of knowledge) -
  1. The Vector ADT
    1. Implementing a vector from scratch
    2. Using STL
  2. Linked List ADT
    1. Implementing a linked list from scratch
    2. Using STL list and associated iterator
  3. Applications of Vectors and Lists
    1. Sparse Matrices
    2. Queues
    3. Stacks
    4. The "subset sum problem" and its solution using vectors and lists
  4. Time Complexity
    1. O(f) order of magnitude
    2. o(f) order of magnitude
    3. theta(f) order of magnitude
    4. omega(f) order of magnitude
    5. Constant, polynomial, logarithmic, and exponential time complexity
    6. NlogN time complexity
    7. Improper use of recursion leading to exponential time complexity
  5. Measuring Asymptotic Behavior
    1. Empirical methods of measurement (benchmarking)
    2. Brute force vs. strategies that use branching or divide-and-conquer algorithms
    3. Timing greedy and depth-first algorithms in graphs
  6. General Trees
    1. Tree nodes, roots, leaves, children and siblings
    2. Binary node implementation of a general tree
    3. Insertion and deletion in general trees
    4. Traversal with recursion
    5. Cloning trees
  7. Searching and Binary Search Trees (BSTs)
    1. Ordering condition and structure condition
    2. OOP (object-oriented-programming) Implementation
    3. Time complexity consequence of the divide-and-conquer algorithm in of BSTs
    4. The alternative "lazy deletion" implementation of tree nodes and its comparative performance to "hard deletion"
    5. Threaded trees
    6. Bin heaps
  8. Balanced BSTs 1: AVL Trees
    1. Tree height and rebalancing
    2. Single and double rotations as the fundamental rebalancing tools
    3. Implementing AVL trees by inheriting from a generic BST
  9. Balanced BSTs 2: Splay Trees
    1. Splaying
    2. Top down vs. bottom-up splaying
    3. Implementing splay trees using STL classes
  10. Hashing
    1. Hashing functions
    2. Separate chaining
    3. Linear and quadratic probing
  11. Priority Queues
    1. The percolate down operation
    2. Bin heap implementation of priority queues
    3. Heap sort
  12. Non-NlogN Sorts
    1. Insertion sort
    2. Shellsort
    3. Benchmarking non-NlogN sorts compared with the STL sort
  13. NlogN Sorts
    1. Merge sort
    2. Heapsort
    3. Quicksort
    4. Benchmarking NlogN sorts compared with the STL sort
  14. Indirect Sorting
    1. What it is
    2. Why it's needed in C++
  15. Graph Theory
    1. Structures of a graph
    2. Nodes, edges and adjacency tables
    3. Shortest path algorithms and Dijkstra
    4. Minimal spanning tree algorithms and Kruskal
    5. Maximum flow graphs and their algorithms
  16. The use of data structures in common applications areas
    1. Math
    2. Physics
    3. Chemistry
    4. Biology
    5. Astronomy
    6. Business and finance
    7. Internet
  17. Strategies for selecting the right data structure.
    1. Storage allocation and use memory for the data structure
    2. Deciding on a user-defined or built-in data structure
    3. How declaration models, binding and visibilty affect different ADT implementations.
5. Repeatability - Moved to header area.
 
6. Methods of Evaluation -
  1. Tests and quizzes
  2. Written laboratory assignments which include source code, sample runs and documentation.
  3. Final examination
7. Representative Text(s) -
Weiss, Mark Allen. Data Structures and Algorithm Analysis in C++. Third Edition. Addison Wesley, 2006.

This text is a classic text in the field and is used by many universities in both undergraduate and graduate classes on the subject of data structures.

8. Disciplines -
Computer Science
 
9. Method of Instruction -
  1. Lectures which include motivation for syntax and use of the C++ language and OOP concepts, example programs, and analysis of these programs.
  2. On-line labs (for all sections, including those meeting face-to-face/on campus) consisting of
    1. A programming assignment web-page located on a college-hosted course management system or other department-approved Internet environment. Here, the students will review the specification of each programming assignment and submit their completed lab work.
    2. A discussion web-page located on a college hosted course management system or other department-approved Internet environment. Here, students can request assistance from the instructor and interact publically with other class members.
  3. Detailed review of programming assignments which includes model solutions and specific comments on the student submissions.
  4. In person or on-line discussion which engages students and instructor in an ongoing dialog pertaining to all aspects of designing, implementing and analyzing programs.
  5. When course is taught fully on-line:
    1. Instructor-authored lecture materials, handouts, syllabus, assignments, tests, and other relevant course material will be delivered through a college hosted course management system or other department-approved Internet environment.
    2. Additional instructional guidelines for this course are listed in the attached addendum of CS department on-line practices.
 
10. Lab Content -
  1. Implementation of time-intensive algorithms on various data types
    1. Design and implement an algorithm whose execution time and/or memory requirements grow significantly when data size increases.
    2. Use generics (A.K.A. templates), which are a universal tool in advanced data structures, in some aspect of the algorithm.
    3. Demonstrate that the algorithm adapts correctly when the generic that you use is applied to at least two distinct underlying data types.
    4. Document the results of the algorithm when the program is applied to different sized data and different underlying data types.
  2. Using linked-list ADTs to optimize for size-varying or space-sensitive data types
    1. Demonstrate the ability to use programming language-supplied linked-list structures in a problem that is not easily solved using fixed-size ADTs such as arrays.
    2. Incorporate generics so as to allow the algorithm to work on various underlying data types.
    3. Try different sized data for the linked-list and demonstrate that it handles growth properly.
    4. Summarize the results along with sample program runs.
  3. Analyzing time complexity in the lab
    1. Implement an assigned algorithm after first predicting its time complexity (linear, quadratic, NlogN, etc.).
    2. Run the algorithm on various sized data sets, recording times.
    3. Describe the largest size data set that the computer can handle without running out of memory or taking an unreasonable amount of time.
    4. Compare the expected growth rate with the observed growth rate.
  4. Demonstrating competence with binary search trees
    1. Implement a binary search tree (BST) from scratch, or make significant assigned adjustments to an existing BST data structure supplied by your instructor.
    2. Use recursion as appropriate for some of the BST methods.
    3. Demonstrate that the class works on various underlying base type by use of generic specialization.
    4. Supply runs and report on expected vs. observed time complexity.
  5. Demonstrating competence with balanced trees
    1. Implement a some assigned balanced tree algorithm (such as AVL, splay or red-black) from scratch, or make significant adjustments to an existing balanced tree algorithm supplied by your instructor.
    2. Use recursion as appropriate for some of the balanced tree methods.
    3. Demonstrate that the class works on various underlying base type by use of generic specialization.
    4. Supply runs and report difference between balanced tree times and simple BST times.
  6. Incorporating hash tables into programs
    1. Produce a lab that creates or modifies a hash table and hashing function.
    2. Write a client that tests out the hash table on various data.
    3. Using a large data set, demonstrate that near-constant time access is produced by the hashing function and hash table.
    4. Supply runs and report results with varying sized data sets.
  7. Analysis of a single sort algorithm
    1. Implement a single sort algorithm as directed by the instructor.
    2. Experiment with coding adjustments to try to improve the performance.
    3. Compare the known time complexity of that algorithm with what you observe using increasingly larger data sets.
    4. Attempt to explain any discrepancies in the expected vs. observed growth rate of the sort algorithm.
  8. Analysis of multiple sort algorithms
    1. Implement multiple sort algorithms, at least two of which involve Shell sort and quicksort.
    2. Experiment with coding adjustments to try to improve the performance on any one of them to see if you can beat the fastest of the algorithms.
    3. Time the algorithms on very small to very large data sets.
    4. Report on which algorithms work better on small sets, and which on large sets.
  9. Writing projects that use graph theory
    1. Implement a generic (a.k.a. template) that will realize/specialize a graph of any underlying data type, either from scratch or using code provided by your instructor .
    2. Write one of the common algorithms for graphs: shortest path, maximum flow or minimum spanning tree.
    3. Discuss the problems that arise when debugging labs which involve data structures as complex as graph theoretic algorithms
    4. Devise a reasonable output for displaying graphs and supply samples with your program runs.
 
11. Honors Description - No longer used. Integrated into main description section.
 
12. Types and/or Examples of Required Reading, Writing and Outside of Class Assignments -
  1. Reading
    1. Textbook assigned reading averaging 30 pages per week.
    2. Reading the supplied handouts and modules averaging 10 pages per week.
    3. Reading on-line resources as directed by instructor though links pertinent to programming.
    4. Reading library and reference material directed by instructor through course handouts.
  2. Writing
    1. Writing technical prose documentation that supports and describes the programs that are submitted for grades.
    2. Writing specifications using prose to connect natural English language to the formulaic programming languages.
13. Need/Justification -
This course is a required core course for the A.S. degree in Computer Science.



Course status: Active
Last updated: 2014-03-11 13:42:08


Foothill CollegeApproved Course Outlines