CS 130B (Spring 2016)
Data Structures and Algorithms

Professor Teofilo F. Gonzalez
Department of Computer Science
University of California, Santa Barbara



  • Prerequisites

  • CMPSC 130A,

    Go To Top



  • Admission

  • Undergraduate Non-CS Majors (except EE & CE & Creative Studies (CS emphasis) who meet the prerequisites (CMPSC 130A)) must PETITION through the CS Department to register in CS 130B. This course is not open to CS or CE Pre-Majors. You could receive an automatic F- if you are a student who must PETITION through the CS Department to enter CS 130B, but did not PETITION to register in CS 130B. Note: petitions to register in this course by CS or CE Pre-Majors are always denied. The rules for graduate students are different.

    Go To Top



  • E-mail

  • I sent you e-mail through the e-mail address provided by the Registrar's office (umail account). It it important that you check your e-mail on that account regularly or add a forwarding instruction so that you receive your e-mail in an account your read regularly. Course announcements and the partial grades will be distributed through this list. You will need a CSIL computer account (or CSIL Access for non-CS majors with COE accounts) for this course. For students with COE accounts the CSIL access has been provided automatically. For CS Majors your previous CSIL account was activated automatically (same userid and password). If this is not done automatically or if you do not fall into the above categories, please get a COE account through this link . If all of this fails please go to the CS Office (2104 Harold T. Frank Hall) and ask the Staff to activate your CSIL access or CSIL account because you are taking CS 130b. The COE Computer Accounts (which handles the CSIL accounts) periodically cancels accounts. If this happens to you go to the CS Office to get your account reinstated. If the CS office is closed send me e-mail (with copy to the TA and support@cs.ucsb.edu) indicating that this has happened and we will try to get it reinstated as soon as possible. Sometimes the COE sends you e-mail to your CS account warning you that if you do not change certain feature (password, disk space, etc.) your account will be closed. So you need to READ your CS account mail at least every day or or forward your email.

    Go To Top



  • Assignments

  • There will be a couple of individual assignments (the number depends on their complexity). They will be assigned during a lecture and will have as deadline the next lecture (or discussion session). You will receive a grade for each of these assignments, but some of the assignments might not be carefully graded. Also, it may be that some individual assignment points will be redistributed among group projects held during discussion sessions. Turn in all your written assignments at the 130B Turnin Box located in 2108 Harold T. Frank Hall. The written assignments will have several different due dates and deadlines. There will be one programming assignment. The Programming assignment will be due on Tuesday May 31th. The code for the Programming Assignment must compile and execute in the LINUX PCs in the CSIL Lab. The code must be in G++ and follow the specifications and guideline that will be provided. JAVA IS NOT ALLOWED. JAVA IS NOT ALLOWED. JAVA IS NOT ALLOWED. In the past, students have used C++ or G++ on their PCs, and then transfer their code to the LINUX Unix PCs. This process is acceptable. However, we must warn you that C++ and G++ compilers are different, and your code might work on your PC, but not in the LINUX PCs. So if you follow this approach, make sure that you leave some time to debug your code on the LINUX PCs, even if the program works correctly on your PC. We can only run your code on the LINUX PCs in CSIL. We can only run your code on the LINUX PCs in CSIL. We can only run your code on the LINUX PCs in CSIL. All the assignments will have a due date and a deadline. If you hand them in after the due date, then 6% of the total points the FULL ASSIGNMENT is worth (not just the part that is late) will be automatically deducted each day (rounded up) the assignment (or part of the assignment) was late (excluding Saturdays, Sundays and University Holidays). Assignments will not be accepted after their deadline.

    Go To Top



  • Exams

  • There will be five quizzes, two mid-term exams and a final exam. The quizzes will be held during part of the lecture on (Thursday) April 7th, (Thursday) April 14th, (Thursday) April 28th, (Thursday) May 5th, and (Thursday) May 12th. The mid-term exams will be held during the lecture period on Thursday April 21th, and Thursday May 19th. The final exam will be on Tuesday June 7th, (8:00 - 11:00 am). All of the exams are closed book and notes. However you are allowed to bring one 8.5" by 11" page (you may write on both sides) with notes to the examinations, but not to the quizzes. The quizzes and exams will be based on all the material covered up to the day of the exam in the lectures and discussion sessions. The quizzes will also include the material covered during the lecture period where the quiz will take place. There will be no makeup exams. There will be no makeup exams. There will be no makeup exams. In the past 41 years there have been very few exceptions to this rule.

    Go To Top



  • Grading Policy

  • The TENTATIVE weights for the assignments and exams are given below.

    Assignment/Exam Number Points
    Written Assignment 80
    Programming Project 1 240
    Quizzes (Best of) 4 (grades) 120 (about 30 each)
    Two Mid-Term Exam 1 260
    Final Exam 1 300

    To make the projects count a little bit more, we always include in the final exam a couple of questions from the projects. Also it may be that some points will be redistributed among group projects held during discussion sessions.

    There will be no incomplete grades, there will be no incomplete grades, there will be no incomplete grades, and there will be no incomplete grades. The Statue of Limitations for any grading is one week after the graded assignment is handed back to the class or the day of the final exam (whichever comes first). I.e., if there is an error in the grading, it must be settled within 8 days of the time the assignment or exam was returned to the class and before the final exam. If you have any questions about the grading, see the TAs (I will provide you with his office hours later on). If you cannot reach an agreement, please see the instructor. Only letter grades will be given, i.e., A+, A, A-, B+, B, B-, C+, C, C-, D+, D, D-, and F.

    The grades are normally computed as follows: First we consider all students in the class and everyone receives a tentative grade. For graduate students this tentative grade is their final grade. Then the undergraduate students receive their final grade by considering only the undergraduate students in the class. Note that if the number of grad students is very small, the second step will not take place as there would be no difference. Normally, students with the average number of total points receive a C+ or B-. It will in the B- range (or slightly higher) if the students are active participants in class and almost all of the students show up for class during the whole quarter, but in the C+ range (or lower) if the students are not active participants in class. The average points for the written homework assignments is normally very high (80% - 90%), but is lower for the project, quizzes and exams. Very few students get the total number of points in my exams, but about 20% of the students receive full credit for their programming projects.

    All the written assignments, quizzes, exams and the programming project must be done INDEPENDENTLY. Why work independently? Because quite of bit of the learning process for this course is learning by doing (proving, analyzing, trying, etc.) and the skills you will develop will not only help you solve problems in this course, but they will also help you solve problems in the future. To motivate you into working independently we will recycle up to 40 points that you loose in the WRITTEN Assignments and the programming project. These recycled points will be assigned to the final exam. I.e., If the total number of points that you earned in the written assignment, quizzes and programming assignment is 410, then the MINIMUM of (440 - 410) and 40 points will be assigned to the final exam. In this example the final exam will be worth 30 extra points. So, if in the final exam you earn 80% of the 300 the final is worth, you will recover 80% of the points lost in the written homework assignments, which is 0.80 * 30 = 24.0 points. If the above rule does not motivate you to work independently and we can prove that two or more students solved together an assignment or part of an assignment, the case will be reported to the appropriate administration officials. You are allowed to study in groups and you may discuss the homework problems with other people in order to fully understand the problems you are being asked to solve in the homework; however, you may not SOLVE the assignment or any part of the assignment or the exams in groups, and you may not ask anyone how to solve any particular problem or subproblem in a homework assignments. If we can prove that two or more students solved together an assignment (exam or project) or part of an assignment (exam or project), the case will be reported to the appropriate administration officials.

    Go To Top



  • Student Services

  • Campus Learning Assistance Service: 893-3269. CLAS helps students increase their mastery of course material through course-specific tutoring and academic skills development. Check out their tutorial groups and drop-in tutoring schedules posted on their web site: www.clas.ucsb.edu. Sign up for services at their main office, Building 477 9-5 daily.

    Counseling & Career Services: (893-4411, www.counseling.ucsb.edu) offers counseling for personal & career concerns, self-help information and connections to off-campus mental health resources.

    Disabled Students Program: 893-2668; www.sa.ucsb.edu/dsp DSP provides academic support services to eligible students with temporary and permanent disabilities. Please inform me (Prof. Gonzalez) if you require special classroom accommodations due to a disability. You must register with DSP prior to receiving these accommodations. Please, do not leave this to the "last minute" (just before the final exam).

    Go To Top



  • Policy on Academic Integrity

  • The university, the department, and this instructor all take the issue of academic integrity very seriously.  A university requires an atmosphere of mutual trust and respect.  While collaboration is an integral part of many scholarly activities, it is not always appropriate in a course, and it is never appropriate unless (1) explicitly allowed and (2) due credit is given to all participants in the collaboration.  This goes for both ideas and programming or other work.

    The university labels each of the following activities as academic misconduct:

    • Cheating. Whether on exams or homework assignments, this includes copying the work of other students, and asking or allowing another student to do your work.

    • Plagiarism. Also known as "academic theft," it refers to the use of another's ideas or words (or source code) without proper attribution or credit.

    • Collusion. "Any student who knowingly or intentionally helps another student to perform any of the above acts of cheating or plagiarism is subject to discipline for academic dishonesty. There  is no distinction between those who cheat and plagiarize and those who willingly allow it to occur."

    The following are examples of violations of academic conduct (this list is not inclusive):

    • Working together (that is, actually writing the computer code) with another student.
    • Showing any portion of your code (no matter how small) to another student.
    • Viewing any portion (no matter how small) of the code of another student.
    • Copying any portion, no matter how small, of another student's code for use in your program.
    • Modifying another student's work to make it "your own."
    • Sharing solutions in the form of pseudocode.
    • Asking a fellow student to help you find a bug in your program, or to help you write any portion of your program, no matter how small.
    • Using the Internet or Library to seek explicit solutions to programming projects.
    • Knowingly allowing any of the above to take place.

    The following is a description of allowed forms of seeking help with a programming assignment (this list is not inclusive):

    • Discussing your project with your TA, professor, a CS tutor, or the email help-desk.
    • Discussing the general ideas of solving the project, or relevant lecture and textbook materials, with a friend or fellow student.
    • Using the Internet or Library to read about the general principles that apply in the project.

    For some views on academic integrity at UCSB, please see:

    Any act of cheating will result in an "F" for the course and a report to the associate dean of students. This includes any sharing of computer code.

    Summary: Academic integrity is absolutely required - dishonesty (cheating, plagiarism, etc.) benefits no one and will not be tolerated! If you are not sure whether or not something is appropriate, ask the instructor or a TA beforehand. (Don't try the "I didn't know" route.)

     

    Go To Top



  • Course Outline and Reference Books

  • Introduction
  • Analysis of algorithms: correctness, time and space complexity.
  • Techniques for Efficient Computation
  • Greedy Algorithms (about 2.5 weeks)
  • Divide and Conquer (about 2 weeks)
  • Dynamic Programming (about 2 weeks)
  • NP-completeness (about 1 week)
  • Branch and Bound
  • Backtracking
  • Local Search Techniques (if time permits)
  • Misc.
  • Reference Books
  • [AHU] Aho A., Hopcroft J. and Ullman J., "Data Structures and Algorithms", Addison-Wesley, Reading, Mass. (1983). QA 76.9 / D35 / A38

  • [CLR] Corman, T., Leiserson, C. E., and Rivest, R. L., "Introduction to Algorithms," McGraw Hill, 1990. QA76.6 / .C662 / 1990

  • [HS] Horowitz, E., Sahni, S. , and Rajasekaran, S., "Fundamental of Computer Algorithms in C++," Computer Science Press, (1997).

  • [KR] Kernigham, B. W. and D. Ritchie, "The C Programming Language," Prentice Hall, 1978. QA 76.73 / C15 / K47

  • [S] Sedgewick, R. "Algorithms," Addison-Wesley 1983.

  • [Sa] Sahni, S., "Data Structures, Algorithms and Applications in C++," Second Edition, Silicon Press, 2005. REQUIRED TEXTBOOK http://www.cise.ufl.edu/~sahni/dsaac

  • [St] Stroustrup, B., "The C++ Programming Language, 2nd Edition," Addison-Wesley, Menlo Park, CA (1991). (QA76 / 73 / C15 S79)

  • [K] Knuth, D. E., "Sorting and Searching: The Art of Computer Programming," Addison-Wesley, Menlo Park, CA (1973). QA 76.6 / K64 / v.3

  • [W] Weiss, M. A., "Data Structures & Algorithm Analysis in C++," Third Edition, Addison-Wesley, (2006).
  • Go To Top