Computer Science CS 515 Data Structures Fall 2015 Instructor: Karen Jin Office: Kingsbury W253 jin at cs.unh.edu Office Hours: Open Door and by www.cs.unh.edu/~jin appointment TA: Lecture: Lab: Madison Clark- Turner mbc2004 at wildcats.unh.edu Section 01: MWF 9:10am - 10am Section 02: MWF 10:10am 11am Section 01: M 12:10pm - 2pm Section 02: M 2:10pm - 4pm Section 03: M 4:10pm - 6pm Lecture Room: Lab Room: Kingsbury N113 Kingsbury N21 Course Description This class has a number of goals: to provide an introduction to the C++ programming language; to provide an introduction to address and dynamic memory manipulation; to provide an introduction to the analysis of algorithms; to introduce a number of sorting algorithms; to introduce more advanced data structures; and to provide an insight as to how the basic and advanced data structures may be implemented. Prerequisites: CS416 Evaluation Criteria 3% Programming Assignments 24% Labs 15% Test 1 20% Test 2 3% Class Participation Programming Assignments: There will be tentatively 12 individual programming assignments. See intro slides for details on academic integrity. Assignments are always due on Monday night at 11:59 p.m. You have 15 minutes grace period till 12:14 a.m. to submit your program. There are no late day submissions. 1
You may resubmit any programming assignments within approximately 24 hours after the initial grading results are released. Each assignment is calculated by the formula below: < S (20 F + 0) if S > F final grade = : first grade otherwise where F = first grade 100 and S = second grade 100 Students will not be given extensions for programs unless they have extenuating circumstances as decided by the instructor. Programs will be graded mainly on "external correctness" (behavior) and also on "internal correctness" (style and design). Disputes about homework grading must be made to course TA within 1 week of receiving the second program grade. Labs There will be one lab each week. You must attend the lab session you are registered in. Lab attendance is not mandatory. However, you will receive 50% credit on the point deduction of your submission if you have attended the lab and the deduction is less than 100 points. < 100-50% D if attended the lab && D < 100 final grade = : 100 - D otherwise where D = points deduction The deadline of lab is on every Saturday night 11:59pm. You have 15 minutes grace period till 12:14 a.m. to submit your programs. You are encouraged to work with a lab partner for all lab programs. You may share code between you and your lab partner but each of you must turn in separate submissions. There will be no make- ups for labs. Late submissions are not accepted. Disputes about lab grading must be made to course TA within 1 week of receiving the grade. Tests There will be two tests. Students must obtain at least 50% on both tests to pass the course (with D- or better). Test 1 will be held on September 2 in class. Test 2 will be held during the UNH final exam week. You are allowed one page X11 double- sided hand- written cheat sheet for both tests. Books, notes and electronic devices are not allowed. Make- up tests will be given only in case of a serious emergency. You must show evidence that you are unable to take the test, such as a doctor's note. No make- ups will be granted for personal reasons such as travel, personal hardship or leisure. 2
Class Participations: Individual or group based written exercises will be handed out during most lecture meetings. The completion of these exercises will be used as a base to measure your class participation. Texts and Resources The recommended textbook for this course is: Data Structures and Algorithm Analysis in C++, 4/e by Mark Allen Weiss Here are some recommended reference books for C++ language. They are both available on Safari Books online. C++ Primer, 5/e by Lippman. Effective C++ and More Effective C++, by Scott Meyers The class notes are available on the course website. We will be using Piazza for class discussion. Course announcements and other resources will be posted through Piazza. https://piazza.com/unh/fall2015/cs515/home Student Learning Outcomes The followings are the tentative student learning outcomes we plan to cover in this course. Describe the fundamental components of C++ language such as variables, pointers and references, control structures, functions, classes and objects. Understand C++ language features such as stream I/O, operator overloading, class and function templates, inheritance and polymorphism, exception handling. Understand and utilize basic STL containers and algorithms. Understand the difference between Abstract Data Types (ADTs) and concrete data structures. Implement and utilize common data structures using C++. Describe and implement stack, queue and variations of list data structure. E.g. ring, doubly linked list, doubly linked ring. Implement a binary search tree data structure and its depth- first and breadth- first traversals. Describe skip list and understand the concept of randomized algorithms. Describe AVL trees, 2-3- 4 trees, Red- Black trees and B- trees; describe common applications of AVL trees, 2-3- 4 trees, Red- Black trees and B- trees. Describe hashing and implement mechanisms to deal with collisions in a hash- table. E.g. linear probing, quadratic probing and double hashing. Understand modern hashing techniques such as Cuckoo hashing. Describe binary tries and multi- way tries; describe their applications in string search and matching. Describe and implement binary heaps. Implement the priority- queue ADT using lists and heaps. Understand and implement the Floyd s O(N) heap construction algorithm. Understand Map/Set ADT and compare the performance of various implementations using concrete data structures. E.g. linked lists, search trees, hash tables and tries. Select an appropriate data structure to implement an ADT under a given set of constraints. Determine the efficiency category of operations using big O notation. Understand the basic concept of amortized analysis. 3
Analysis, compare and implement various sorting algorithms, including: bubble sort, insertion sort, selection sort, quicksort, merge sort, heap sort, bucket sort and radix sort. Understand the lower bound of comparison- based sorting algorithms. Describe and implement the graph ADT; implement depth- first and breadth- first graph traversals. Describe and implement the Disjoint- Set ADT and its application in graph algorithms. Describe and implement the minimum spanning tree algorithms: Prim's algorithm and Kruskal s algorithm. Describe and implement Dijkstra's single source shortest path algorithm; Floyd- Warshall s all- pair shortest path algorithm. Select and use appropriate algorithm to solve graph problems. Describe algorithm classes: - Greedy algorithms: Dijkstra s algorithm, Prim s algorithm and Kruskal s algorithm, Huffman code. - Divide and conquer: merge sort, quick sort. - Dynamic programming: Floyd- Warshall s algorithm. - Randomized algorithms: skip list insert. Select and use appropriate abstract data types, data structures, and algorithms to solve moderately complex problems. Program testing and debugging. Tentative Class Schedule Week 1: Basic C++; Memory model; Pointers and References Week 2: Functions; objects/class; file I/O Week 3: Operator overloading; class template; STL Week 4: ADT; stack, queue, binary search tree; Skiplists; Week 5: Map ADT and Set ADT; balanced binary search tree; Week 6: AVL tree,; Week 7: 2 3-4 tree and Red- black tree; Week : B- tree; C++ Polymorphism Week 9: Hashing; Week 10: Binary Heap; Priority Queue ADT Week 11: Huffman encoding; Tries Week 12: Sorting; Disjoint Set ADT; Week 13: Graph; Greedy algorithm; Minimal Spanning Tree; Kruskal s algorithm; Prim s algorithm; Week 14: Dynamic Programming; Dijkstra s shortest path algorithm; Folyd- Warshall s algorithm; Disability Services The University is committed to providing students with documented disabilities equal access to all university programs and facilities. If you think you have a disability requiring accommodations, you must register with Disability Services for Students (DSS). If you have questions about the process, please contact DSS at (603) 62-2607 or disability.office@unh.edu. If you are registered with DSS, and eligible for accommodations that you would like to utilize in this course, please forward that information to me in a 4
timely manner so that we can meet privately in my office to review those accommodations. Emotional or Mental Health Distress Your academic success in this course is very important to me. If, during the semester, you find emotional or mental health issues are affecting that success, please contact the University s Counseling Center (3 rd fl, Smith Hall; 603 62-2090/TTY: 7-1- 1) which provides counseling appointments and other mental health services. University Policy on Academic Honesty links to Students Rights, Rules and Policies Classroom Behavior Expectations To insure a climate of learning for all, disruptive or inappropriate behavior (repeated outbursts, disrespect for the ideas of others, etc) may result in exclusion (removal) from this class. As a reminder, cell phone/pda, etc. use, including text messaging, is not permitted in this class by Faculty Senate rule unless by instructor permission. (2009, Behavioral Intervention Team) 5