The final exam happens on Friday 13 December, from 10:30am till 12:30pm, in BH 209.

This is a second programming course. Although prior experience with C++ helps, familiarity with coding algorithms in any other programming language will work just as well. We will start from scratch with C++, the textbook has a C++ Primer as Chapter P. The emphasis is on problem solving and software design with the study of data structures.

The text book for this course is Objects, Abstraction, Data Structures, and Design using C++ by Elliot B. Koffman and Paul A.T. Wolfgang, John Wiley and Sons, 2006. We cover Chapters P to 11 thoroughly, and some topics of chapter 12.

To save space, the pdf files of the slides are gradually removed.

1. A C++ Primer

L-1 Mon 26 Aug 2019: welcome to mcs 360
        C++ code hello_world.cpp , hello_there.cpp , and gcd_dowhile1.cpp .
L-2 Wed 28 Aug 2019: Elements of C in C++
        C++ code grading_scale.cpp , show_doubles.cpp , die_freq.cpp , die_freq_fun.cpp , and work_pointers.cpp .
L-3 Fri 30 Aug 2019 Arrays, Strings, and Files
        C++ code all_arrays.cpp , strings_are_arrays.cpp , use_getline.cpp , and copy_files.cpp .

2. Introduction to Software Design

L-4 Wed 4 Sep 2019: software design and abstract data types
        C++ code current_time.cpp , a_class_clock.h , a_class_clock.cpp , and time_with_clock.cpp .
L-5 Fri 6 Sep 2019: unified modeling language and a case study
        C++ code command_line_args.cpp , a data file: phonebook_data.txt, phonebook.h , phonebook.cpp , use_phonebook.cpp , use_phonebook2.cpp , and a makefile .

3. Program Correctness and Efficiency

L-6 Mon 9 Sep 2019: Bugs, Exceptions, and Testing
        C++ code test4zero.cpp , read_integer1.cpp , read_integer2.cpp , read_file1.cpp , out_of_range.cpp , except_hierarchy.cpp , and in_char_range.cpp .
L-7 Wed 11 Sep 2019: assertions and efficiency
        C++ code open_file.cpp , guess_character.cpp , find_duplicates.cpp , and find_dup_time.cpp .

4. Inheritance and Class Hierarchies

L-8 Fri 13 Sep 2019: inheritance and polymorphism
        C++ code clock.h , clock.cpp , test_clock.cpp , alarm_clock.h , alarm_clock.cpp , test_alarm_clock.cpp , and food.h.
L-9 Mon 16 Sep 2019 namespaces and class hierarchies
        C++ code point1.h , point1.cpp , test_point1.cpp , point2.h , point2.cpp , test_point2.cpp , point3.h , point3.cpp , test_points.cpp , shape.h , rectangle.h , rectangle.cpp , circle.h , circle.cpp , test_shape.cpp , processor.h , processor.cpp , computer.h , computer.cpp , and test_computer.cpp .

5. Sequential Containers

L-10 Wed 18 Sep 2019: templates and vectors
        C++ code templated_swap.cpp , swapitems.h , swapitems.tpp , use_swapitems.cpp , vector_of_names.cpp , and test_our_own_vector.cpp .
L-11 Fri 20 Sep 2019: single linked lists
        C++ code mcs360_list.h , mcs360_list.tpp , test_mcs360_list.cpp , and use_stl_list.cpp .
L-12 Mon 23 Sep 2019: double linked lists and iterators
        C++ code mcs360_double_node.h , mcs360_double_list_first.h (first basic version), mcs360_double_list.tpp , mcs360_double_list.h , mcs360_list_iterator.h , test_mcs360_double_list.cpp , and show_function_object.cpp .

6. Stacks

L-13 Wed 25 Sep 2019: the stack ADT as STL vector and list
        C++ code use_stl_stack.cpp , match_brackets.cpp , use_stl_vector_as_stack.cpp , and use_stl_list_as_stack.cpp .
L-14 Fri 27 Sep 2019: stack implementations
        C++ code mcs360_stack_stl_vector.h, mcs360_stack_stl_vector.tpp, use_mcs360_stack_stl_vector.cpp, mcs360_stack_stl_list.h, mcs360_stack_stl_list.tpp, use_mcs360_stack_stl_vector.cpp, use_mcs360_stack.cpp, mcs360_stack_our_vector.h, mcs360_stack_our_vector.tpp, use_mcs360_stack_our_vector.cpp, mcs360_stack_our_node.h, mcs360_stack_our_list.h, mcs360_stack_our_list.tpp, use_mcs360_stack_our_list.cpp, mcs360_empty_stack.h, test_empty_stack.cpp, and the makefile.
L-15 Mon 30 Oct 2019: stack applications
        C++ code parsing_postfix_string.cpp , test_postfix_evaluator.cpp , converting_infix_sum.cpp , infix_to_postfix.cpp , and test_infix_to_postfix.cpp .

7. Queues

L-16 Wed 2 Oct 2019: the queue
        C++ code use_stl_queue.cpp , printer_queue.cpp , use_stl_list_as_queue.cpp , and use_stl_vector_as_queue.cpp .
L-17 Fri 4 Oct 2019: queue implementations
        C++ code mcs360_circular_fixed_buffer.h, mcs360_circular_fixed_buffer.tc, use_buffer.cpp, mcs360_double_node.h, mcs360_circular_double_ring.h, mcs360_circular_double_ring.tc, and use_ring.cpp.
L-18 Mon 7 Oct 2019: simulations
        C++ code use_deque.cpp, array_of_arrays.cpp, poisson_number_generator.h, poisson_number_generator.cpp, random_poisson_numbers.cpp, use_poisson_number_generator.cpp, and simulate_waiting.cpp.

L-19 Wed 9 Oct 2019: review of lectures 1 to 18 for the first midterm exam
        some answers to the review questions
L-20 Fri 11 Oct 2019: first midterm exam, questions for version (a) with answers, and questions for version (b) with answers.

8. Recursion

L-21 Mon 14 Oct 2019: recursive definitions
        C++ code recursive_factorial.cpp, recursive_on_stl_list.cpp, and recursive_gcd.cpp.
L-22 Wed 16 Oct 2019: binary search
        C++ code towers_of_hanoi.cpp, binary_search_in_vector.cpp, fibonacci.cpp, and fast_power.cpp.
L-23 Fri 18 Oct 2019: enumeration and backtracking
        C++ code enumerate_bits.cpp, enumerate_words.cpp, percolation.cpp, gcd_stack.cpp, and fib_stack.cpp.

9. Trees

L-24 Mon 21 Oct 2019: binary search trees
        C++ code mcs360_integer_tree_node.h, mcs360_integer_tree.h, mcs360_integer_tree.cpp, and test_mcs360_integer_tree.cpp
L-25 Wed 23 Oct 2019: expression trees and the heap
        C++ code split_expression.cpp, mcs360_binary_expression_node.h, mcs360_binary_expression_tree.h, mcs360_binary_expression_tree.cpp, mcs360_binary_expression_test.cpp, mcs360_integer_heap.h, mcs360_integer_heap.cpp, and mcs360_integer_heap_test.cpp.
L-26 Fri 25 Oct 2019: priority queues and Huffman trees
        C++ code mcs360_integer_tree_v2.h, mcs360_integer_tree_v2.cpp, test_mcs360_integer_tree_v2.cpp, mcs360_integer_heap_v2.h, mcs360_integer_heap_v2.cpp, test_mcs360_integer_heap_v2.cpp, and use_stl_priority_queue.cpp.

10. Sets and Maps

L-27 Mon 28 Oct 2019: pairs, sets, and maps
        C++ code freq_stl_pair.cpp, freq_stl_set.cpp, freq_stl_map.cpp, set_membership.cpp, and set_functions.cpp.
L-28 Wed 30 Oct 2019: hashing
        C++ code use_size_t.cpp, hash_words.cpp, mcs360_open_hash_table.h, mcs360_open_hash_table.cpp, mcs360_open_hash_test.cpp, mcs360_chain_hash_table.h, mcs360_chain_hash_table.cpp, and mcs360_chain_hash_test.cpp.
L-29 Fri 1 Nov 2019: applications of maps
        C++ code build_Huffman_code.cpp.

11. Sorting

L-30 Mon 4 Nov 2019: quadratic sorting algorithms
        C++ code use_stl_sort.cpp, selection_sort.cpp, bubble_sort.cpp, and insertion_sort.cpp.
L-31 Wed 6 Nov 2019: better sorting algorithms: Shell sort, merge sort, and heap sort
        C++ code shell_sort.cpp, merge_sort.cpp, and heap_sort.cpp.
L-32 Fri 8 Nov 2019: quicksort
        C++ code partition.cpp, partition_with_iterator.cpp, quicksort.cpp, quicksortv2.cpp and quicksortv3.cpp.

12. Balancing Binary Search Trees

L-33 Mon 11 Nov 2019: balancing search trees
        C++ code mcs360_search_tree_test.cpp.
L-34 Wed 13 Nov 2019: red-black trees
L-35 Fri 15 Nov 2019: B-Trees
        C++ code mcs360_btree_node0.h, mcs360_btree0.h, mcs360_btree0.tpp, mcs360_btree_node_test0.cpp, and mcs360_btree_test0.cpp.
L-36 Mon 18 Nov 2019: Code to Balance Search Trees
        C++ code mcs360_btree_node.h, mcs360_btree.h, mcs360_btree.tpp, mcs360_btree_node_test.cpp, and mcs360_btree_test.cpp.

L-37 Wed 20 Nov 2019: review questions for the second midterm exam
        Some answers are in the review lecture slides.
        C++ code charcount.cpp, chebyshev.cpp, and weather.cpp.
L-38 Fri 22 Nov 2019: second midterm exam, questions for version (a) with answers, questions for version (b) with answers, and questions for version (c) with answers.

13. Graphs

L-39 Mon 25 Nov 2019: graphs
        C++ code adjacency_matrix.cpp and adjacency_list.cpp.
L-40 Wed 27 Nov 2019: graph traversals
        C++ code graph_traversals.cpp and mazepath.cpp.

Review

L-41 Mon 2 Dec 2019: review questions for the first 18 lectures
        Some answers are in the review lecture slides.
L-42 Wed 4 Dec 2019: second review for the final exam
        Some answers are in the review lecture slides.
L-43 Fri 6 Dec 2019: third review for the final exam
        Some answers are in the review lecture slides.

The final exam happens on Friday 13 December, from 10:30am till 12:30pm, in BH 209.