CMSI 284
Homework #3

Print the sources to the following problems and turn them in, in the order listed below, at the beginning of class on the due date. Also place your solutions in your CVS repository as follows:

    /homework/cmsi284/src/main/c/apps/utf8_to_utf16be.c
    /homework/cmsi284/src/main/c/collections/singly_linked_queue.h
    /homework/cmsi284/src/main/c/collections/singly_linked_queue.c
    /homework/cmsi284/src/test/c/singly_linked_queue_test.c

Make sure that you have run the setup-class script so that I can checkout and run your code from CVS while grading.

  1. Write a C program that reads UTF-8 from standard input and writes the corresponding UTF-16BE to standard output. Because you are working with data from files, you will have to deal with buffers. And because UTF-8 is a variable-length encoding scheme, you'll run across something unpleasant, too.
  2. Write a C "module" (a .h and a .c file) that defines a queue of integers, implemented as a singly linked list. Include operations to create, enqueue, dequeue, get the size, determine if the queue is empty, and read the first element without removing.