CISC-121*Introduction to Computer ScienceWinter 2013 |
![]() Image by Alatryste, used under Creative Commons Licence |
Date | Subject | Text |
13-4-24 | Quiz 2 | Solutions |
Instructor |
Dr. Robin W. Dawes |
![]() |
Goodwin
537 |
||
dawes AT cs
DOT queensu
DOT ca |
||
http://sites.cs.queensu.ca/dawes/ |
||
533-6061 (but
e-mail is a much
better idea) |
||
Office Hours:
24/7, by appointment |
TAs |
Name |
Email |
Office
Hours |
Picture |
Khalid Elgazzar |
elgazzar AT cs DOT queensu DOT ca |
![]() |
||
Susanne Morrill |
8sm49 AT queensu DOT ca |
![]() |
Calendar
Description |
Introduction to design and analysis of algorithms. Control structures: recursion, backtracking, exits. Data structures: structures, sequences, linked lists and references, binary search trees. Elementary searching and sorting. Introduction to assertions and loop invariants. Introduction to order-of-magnitude complexity. Introduction to numerical computation. Documentation, testing and debugging. |
Text |
Think Python, by Allen B. Downey (free online version) |
Syllabus |
Principles of good programming
Fundamentals of procedural programming Recursion Complexity analysis Linear structures Heirarchical structures Searching and sorting Numerical computation and errors Classes and object-oriented programming |
Marking
Scheme |
2 quizzes @ 15%
1 final exam @ 50% 4 marked lab assignments @ 5% You must pass the final exam to pass the course. There will be no make-up quizzes for missed quizzes. In case of a quiz missed for medical or emergency reasons, an alternative marking scheme may be available. Students with special needs are responsible for contacting the instructor at least a week before each quiz. Please see the Queen's Disability Services page for students for more information. |
Class
Schedule Labs |
Tuesday 9:30
- 10:20 Thursday 8:30 - 9:20 Friday 10:30 - 11:20 |
All
class meetings are in Dupuis 217 All labs are in Jeffery 157 |
|
Assignment and Quiz Schedule |
Date |
Location |
Material |
Quiz 1 |
February 5, 2013 | ||
Quiz 2 | March 12, 2013 | ||
Assignment 1 |
|||
Assignment 2 |
|||
Assignment 3 |
|||
Assignment 4 |
Tuesday, January 8 Plan: Intro and Review Notes: History of Computing |
Thursday, January 10 Plan: Intro and Review Notes: Sequence, Selection, Repetition Demo Code: if statements and loops |
Friday, January 11 Plan: Intro and Review Notes: Repetition, Repetition, Repetition ... Demo Code: Collatz Conjecture |
Tuesday, January 15 Plan: Fundamentals of Programming Notes: Functions |
Thursday, January 17 Plan: "go to, go to; you have known what you should not " Notes: Structured Programming Demo Code: Hammurabi in BASIC Hammurabi in bad Python |
Friday, January 18 Plan: Concision in style, precision in thought, decision in life. Notes: Programming Style Demo Code: Hammurabi in bad Python, using EasyGui |
Tuesday, January
22 Plan: Top Down Programming Exercise Notes: Guessing Game |
Thursday, January 24 Plan: Lists Notes: Aliasing and Slices |
Friday, January 25 Plan: More Lists Notes: List functions Demo Code: List stuff |
Tuesday, January 29 Plan: Local and Global Variables |
Thursday, January 31 Plan: Dictionaries Notes: Global and local variables, and dictionaries |
Friday, February 1 Plan: Recursion Demo Code: Recursive Functions |
Tuesday, February 5 Plan: Binary Search Notes: Recursion and Binary Search Demo Code: Binary Search |
Thursday, February 7 Plan: Notes: More Recursion - Clever Multiplication |
Friday, February 8 Plan: Quiz 1 |
Tuesday, February 12 Plan: |
Thursday, February 14 Plan: |
Friday, February 15 Plan: Introduction to Objects Notes: Creating Objects |
*** Reading Week *** | ||
Tuesday, February 26 Plan: |
Thursday, February
28 Plan: |
Friday, March 1 Plan: More Objects Notes for Week 7: More about objects Demo Code: Date.py Book.py program that uses Book and Date |
Tuesday, March 5 Plan: Complexity |
Thursday, March 7 Plan: Complexity |
Friday, March 8 Plan: Complexity Notes for Week 8: Complexity Demo Code: growth of functions |
Tuesday, March 12 Plan: Guest Lecture |
Thursday, March 14 Plan: Guest Lecture Notes for Week 9: Computer Arithmetic |
Friday, March 15 Plan: Quiz 2 |
Tuesday, March 19 Plan: Complexity of Recursive Functions |
Thursday, March 21 Plan: continued |
Friday, March 22 Plan: continued Notes for Week 10: Complexity of Recursive Functions |
Tuesday, March 26 Plan: |
Thursday, March
28 Plan: |
Friday, March 29 Plan: Good Friday |
Tuesday, April 2 Plan: Linked Lists Notes for Week 11 and part of Week 12: Linked Lists Demo Code: Linked Lists |
Thursday, April 4 Plan: |
Friday, April 5 Plan: |
Week |
Lab
Instructions |
Solutions |
1: Jan 7 - 11 |
no lab | |
2: Jan 14 - 18 |
Working with the Collatz Conjecture Collatz Extensions |
My solution |
3: Jan 21 - 25 |
Improving the Hammurabi Game | My solution |
4: Jan 28 - Feb 1 |
Social Networks Provided Code: Social_Network.py |
My solution |
5: Feb 4 - 8 |
Recommendation Machines Provided Code: Recommendation Starting Point.py |
My solution |
6: Feb 11 - 15 | Week 5 Lab continued | |
*** Reading Week *** | ||
7: Feb 25 - Mar 1 |
Ancient Egyptian Fractions | My solutions: Solution 1 (slow) Solution 2 (faster) |
8: Mar 4 - 8 |
Image Manipulation Provided Code: Starting Point Provided Images (zipped file) |
My solution |
9: Mar 11 - 15 |
Week 8 Lab continued | |
10: Mar 18 - 22 |
no lab |
|
11: Mar 25 - 29 |
Your choice: Steganography or Trees Provided Code: Starting code for Steganography Starting code for Trees Provided Images (zipped file) Provided Text Samples (zipped file) |
My Steganography Solution My Trees Solution |
12: Apr 1 - 5 |
Text
Section |
Exercises |
1.8 |
1.2 |
2.12 | 2.3 |
3.6 | 3.1, 3.2 |
3.15 |
3.3 (use column 50
rather than 70 if you prefer) 3.4 3.5 (think about how to generalize this to print any size grid) |
Source |
Section |
Read Before ... |
Comments |
Learning (Your First Job) |
All |
January 11 |
Essential reading for all students |
Computer Science For Fun | Any | whenever | purely recreational |
Think Python (TP) | Chapter 1 | should be no surprises here | |
TP | Chapter 2 | easy peasy | |
TP | Chapter 3 | getting a bit more interesting | |
TP | Chapter 5 | starting the good stuff | |
TP | Chapter 15 | ||
TP | Chapter 10 | ||
Quiz 1 | Sample Quiz 1 - this is from a previous year. The material covered this year is slightly different - for example we have not yet covered strings - but the general format and style of the questions is a good indicator of what you can expect on Friday's quiz. |
Quiz 2 | Sample Quiz 2 - once again, the material covered in the year this quiz was given was slightly different from what we have covered this year. Our test will naturally be based on what we have covered. |
Final |
Students are responsible for familiarizing themselves with the regulations concerning academic integrity and for ensuring that their assignments conform to the principles of academic integrity. Information on academic integrity is available in the Arts and Science Calendar (see Academic Regulation 1 on the Arts and Science website) and from the instructor of this course.
Departures from academic integrity include plagiarism, use of unauthorized materials, facilitation, forgery and falsification, and are antithetical to the development of an academic community at Queen's. Given the seriousness of these matters, actions which contravene the regulation on academic integrity carry sanctions that can range from a warning or the loss of grades on an assignment to the failure of a course to a requirement to withdraw from the university.
In CISC 121, academic integrity means that the work you hand in as your own (quizzes, final exam and assignments) really is your own. You may ask other people for general help in the course -- by which I mean general explanations and help with practice problems that are not being handed in. You may talk in general terms with other students about marked assignments, as in discussing strategies ("how are you handling the case where the list is empty?") or requirements ("are we supposed to print out all the data or just the average?"). You may not share code or even pseudo-code with anyone else.
I do allow you to work in pairs on assignments, in which case you are obviously allowed to work closely with your partner. To avoid possible misunderstandings, only one of you should hand in the assignment and the assignment should clearly identify both students who contributed to it.
The preceding text on academic integrity was written by Prof. Margaret Lamb and is used here with her permission.
EasyGui | A free, easy-to-use graphical user interface | easygui_v0.95.zip |
Pypng | A free, easy-to-use png image handling package | pypng-0.0.12.zip |