COMP-208 Computers in Engineering

Section 2, Fall 2007

Jun Wang
School of Computer Science
McGill University

Lecturer

Email: jwang90@cs.mcgill.ca

Office: McConnell Room 107

Office hours: Monday: 3-4pm; Thursday: 4-5pm

Announcements

  • Dec. 5, 2007
    TAs will hold a final review on Dec. 14. Time and location to be determined. Check WebCT for announcement.
  • Nov. 23, 2007
    CORRECTION: contray to what's announced in class, there will be one more topic--linear algebra.
  • Nov. 8, 2007
    Assignment #5 posted on WebCT.
  • Oct. 23, 2007
    Assignment #4 posted on WebCT.
  • Oct. 16, 2007
    Special office hours: Wed. Oct.17, 3-6pm.
  • Oct. 11, 2007
    Assignment #3 posted.
    Midterm seating arrangement on WebCT.
  • Oct. 02, 2007
    Assignment #2 due date extended to Oct. 9.
  • Sep. 13, 2007
    Assignment #1 posted on mycourses(WebCT).

Relevant information

Sample programs

  • Nov. 27, 2007
    • gauss.c Implementation of the Gaussian elimination method.
    • gauss2.c Another implementation of the Gaussian elimination method. This version allows matrix of any size.
  • Nov. 22, 2007
    integral.c (Using 3 methods to integrate the function f(x) = 1/(1+x*x).)
  • Nov. 8, 2007
    • find_min.c (A recursive function to find the index of the minimum number in an array.)
    • hanoi.c (An implementation of the Tower of Hanoi problem.)
  • Nov. 6, 2007
    • selsort.c - A selection sort program.
    • insertsort.c - An insertion sort program.
    • linear.c - Determine the performance of linear search. The number to be searched is randomly selected from all the numbers of an array and an extra number.
    • linear2.c - Determine the performance of linear search. The number to be searched is randomly selected from all the numbers of an array, so the number is always found.
  • Nov. 1, 2007
    binsearch.c (A binary search program; bubble sort is used to sort the array.)
  • Sep. 20, 2007
    diff.f (in-class exercise on Sep. 20, 2007). This program gets 2 integers from user, and prints the bigger number and the difference (non-negative) of the 2.

Lecture notes

Week 1

  • lecture 01 - Sep. 04, 2007
    What is a program?
  • lecture 02 - Sep. 06, 2007
    Architecture, Programming Languages

Week 2

Week 3

Week 4

  • lecture 07 - Sep. 25, 2007
    Counter-controlled Loops
  • lecture 08 - Sep. 27, 2007
    Arrays, Expression-controlled Loops

Week 5

Week 6

  • Class cancelled - Oct. 09, 2007
  • lecture 11 - Oct. 11, 2007
    Multidimensional array; Function

Week 7

  • lecture 12 - Oct. 16, 2007
    Subroutines
  • Midterm exam - Oct. 18, 2007

Week 8

Week 9

  • lecture 15 - Oct. 30, 2007
    Arrays, function prototypes, pointers
  • lecture 16 - Nov. 1, 2007
    More on pointers; File I/O; Bubble sort; Binary search

Week 10

  • lecture 17 - Nov 6, 2007
    Selection sort; insertion sort; recursion
  • lecture 18 - Nov 8, 2007
    More on recursion

Week 11

  • lecture 19 - Nov. 13, 2007
    Merge sort; root finding
  • lecture 20 - Nov. 15, 2007
    Initial value problem

Week 12

  • lecture 21 - Nov. 20, 2007
    Initial value problem
  • lecture 22 - Nov. 22, 2007
    Numerical integration.

Week 13

Week 14