CS 2213/1 Final Exam
Review

The exam will be on

Monday, 9 May 2005, 10:30 am - 1:15 pm.


Quizzes, Exams, and Recitations: You should refer to the Calendar for the following material:

Many of these items will also be mentioned below.


Topics:

No question will come directly from the Weiss book that is not also discussed below. (But the Weiss book might help your understanding.)

Unix:

  1. Unix Basics Know all the commands given.
  2. vi Editor Know the 18 emphasized commands.
  3. lint/make Know how to compile, how to invoke lint, and the basics of the make utility. (Not emphasized.)

C Basics:

  1. dice program Study this program and be familiar with:

  2. Rec 1: Introduction Study the dice.c program.
  3. C I/O: (The final link to self-reproducing programs discussed later.)
  4. Random Numbers: just the first (introductory) section.
  5. Rec 2: Input/Output and Random Numbers.
  6. Separate Compilation: Understand the use of separately compiled files in C with header files.
  7. Sieve: Study the comparison and contrast between the C program in 3 files and the Java program in 2 files:

  8. Stack: This is a 3-way comparison, but questions will be about the C version of a stack.
  9. O-O Prog: Pay special attention to the table that describes how
  10. Copy: These character-by-character copy programs are needed for Recitation 3, but it is important to see how C uses getchar() and a test for EOF to copy a file. To copy line-by-line, just realize that in C files appear as if lines are separated from one another by a single newline character.
  11. Rec 3: Palindromes.

C Pointers (same as Java references):

  1. Pointers Basic pointer notation and concepts, including especially the "address of" operator & and the "dereferencing" operator *. The star is also used to declare pointers. Also the material in the table titled "Pointer examples: pointers.c".
  2. Swapping Mainly just the second example titled "C Swap Program with Pointers -- Works" that shows a function that will interchange the values stored at the referenced locations of two pointer parameters.
  3. Rec 4: Pointers, etc.
  4. Pointers and Arrays All of this, with emphasis on the section "Indexes versus pointers for arrays in C". (Not much emphasis on the large section titled "Array Basics (lecture notes by Mike Maltrud)", since it is mostly standard array material that is the same in C and in Java.)
  5. Rec 5: Pointers and Arrays

Strings:

  1. String Examples Creating strings, accessing and printing chars from them
  2. String Basics (less emphasis on this material)
  3. String Functions Examples of functions that work with strings
  4. Rec 6: Strings
Arrays of Strings:
  1. Print Array of Strings
  2. Rec 7: Array of Strings : command line arguments (skip self-reproducing programs)
  3. Array of Strings as Parameter (less emphasis)
2-dimensional arrays:
  1. 2d-arrays
  2. Rec 8: Pascal's Triangle : 2-dimensional arrays -- three ways to look at them:
structs:
  1. Structs Overview
  2. Simple "bare" structs seldom used
  3. Rec 9: Structs and RPN Using bare structs, and an array of structs
  4. Java vs. C Using pointers (or references) to structs
  5. Structs as parameters Examples of both "bare" structs and pointers to structs
Use of structs:
  1. Linked List Stack Use of self-referential structs
  2. Rec 10: Linked list queue
Files:
  1. File Input/Output
  2. Rec 11: Merging Files

Binary trees:

  1. Rec 12: Binary trees
Hashing:

  1. Rec 13: Hashing
Graphs:

  1. Rec 14: Graph algorithms
Time in C/Unix:

  1. Time in Unix (No questions on this)
Heapsort:

  1. Heapsort

Possible Questions:

Please consult this location over the next few days for sample problems.

  1. C macros (with #define): possible question.

  2. Pointers: some kind of question.

  3. Strings: some kind of question. Study mallocing storage for a string.

  4. Arrays of strings: Possible question, such as, say, "print an array of strings, one to a line, without using square brackets".

  5. 2-dimensional arrays: Probably a question. Understand the two different kinds of 2-dimensional arrays:

  6. structs: some kind of question. We used an arrays of structs and an array of pointers to structs. Understand the contrast with arrays:

  7. Linked lists: Probably a question. Understand code to chase down a linked list to the NULL at the end, using code like: while (p != NULL) { /* do something */ p = p -> next;}, where p points to the first node of the linked list. This trashes the pointer p, since it will have value NULL at the end. See the function printstack2 in Linked List Stack.

  8. File Input/Output: possible question.

  9. Merge files: possible question.

  10. Binary search trees: perhaps one question. You should understand how binary search trees work.

  11. Hashing: definitely one question. Understand both methods: open addressing and bucketing, though the recitation used open addressing.

  12. Graphs and graph algorithms: definitely one question. Be sure to study the adjacency list representation and how to construct it as in Recitation 14:. You should also check out Question 30 in the course list of Questions.

  13. Time: No question about time in Unix.

  14. Heapsort: definitely one question, perhaps just tracing through the actions of heapsort. For practice, try using the following numbers (where A[0] is not used) (answer is here):


Copyright © 2011, Neal R. Wagner. Permission is granted to access, download, share, and distribute, as long as this notice remains.