Computer programming

Course: Tue 10-13, A115
Lab: Wed 10-14, Thu 14-18, B418b
Office hours: Mon 11-12, B418a; Thu 18-20 B418; if needed Wed 12-14 B531, Thu 12-14 B531/B528
Tutoring: gr. 1.1: Mon 11h, B418a; gr 1.2: Tue 13h, C305/C211a; gr. 2.1: Thu 12h, C305; gr. 2.2: Thu 18h, B418a
Instructor: Marius Minea, marius@cs.upt.ro (Office: B531. Phone: +40-256-403284)
Lab assistant: ing. Alexandru Iovanovici
Lab grades
Exam grades

Homeworks

Upload your solutions Midterm solutions: reverse bytes, reverse bits in bytes, print 4-digit groups, sum ints in string,
prefix expression, s-expression, see also postfix expression
Solutions for exam 1: different bits, 3-byte integers, maximum-width text, concatenate words (see also Lab 8), integer sequences (with realloc, with lists), begin/end labels
Solutions for exam 2: BCD numbers, base-26 numbers, rewriting strings, rewriting numbers, checking PDF.
Solutions for exam 3: bits from string, word count, Fibonacci words, cut fields from file, cut words from stdin

Course materials

  1. Introduction. Recursion.
    Sample program: Sierpiński triangle
  2. Recursion. Character input.
  3. Decision. Assignment. Iteration.
    Sample programs: calculator, filter tags, check nesting.
  4. Iterative processing. Bitwise operators. Variants for counting words on a line: one inner loop, two inner loops, state machine.
  5. Internal representation. Bitwise operators.
    count bits, reverse bits, bitwise addition, stream bits, bitmap processing, float structure, division of Z2 polynomials
  6. Arrays.
  7. Input/output functions.
    adding read integers with overflow check, adding integers on each line (version 1, version 2)
  8. Pointers
    traverse array, traverse argv[], sort string table
  9. Pointers. Dynamic memory allocation
    add cmdline numbers, concat argv[], eval string expression
  10. File I/O
    print file, copy files, list files from .zip, half size image
  11. User-defined types
    extended gcd, processing terms: just reading, with string args, with term args
  12. Abstract datatypes
    intlist.h, intlist.c, lstmain1.c, listlib.h, listlib.c, lstmain2.c
  13. Lists (cont.). Exceptions
    integer expression with exceptions; filter list, main program
    integer queue, queue header, program using queue
  14. Application: SAT checking. sat.c intset.h intset.c. Check with problems from here

Laboratory

  1. Lab 1: Introduction. Recursion
    Exercise: Write a program, similar to the one done in class, that draws the Koch curve, as described here.
  2. Lab 2: Recursion. Character input
  3. Lab 3: Character processing
  4. Lab 4: Iterative processing. Bitwise operators
  5. Lab 5: Bitwise operators
  6. Lab 6: Arrays
    Sample programs: multiply big numbers, reverse words, collapse string spaces, UNIX checksum
  7. Lab 7: Standard I/O
    Sample programs: search input for word, process CSV input
  8. Lab 8: Pointers
    Sample: concatenate words, add ints and floats
  9. Lab 9: Pointers. Dynamic allocation
    Sample: arg handling in scanf, read array of lines
  10. Lab 10: Files
    Sample: split file into chunks, find and replace
  11. Lab 11: Structures
    Sample: continued fraction
  12. Lab 12: Abstract datatypes
    Sample: remove duplicates from list
  13. Lab 13: Abstract datatypes
    Sample: merge sort a list

Review

Resources

Marius Minea
Last modified: Wed Jun 3 17:00:00 EET 2014