CS Behind the Curtain (CS195 2003S)

Homework 6: A To-Do List

Summary: In this assignment, you will build a simple to-do list in C.

Assigned: Wednesday, 9 April 2003

Due: Friday, 18 April 2003

Details: Write a simple interactive to-do list in C. Each element in the to-do list should consist of

The interface to your linked-list library should include the following operations:

You may also add others you deem appropriate.

Design Options: It is up to you whether you implement a generic linked list library, a specific to-do list library, or both.

More Details Forthcoming.

Questions and Answers

How should we handle times?
There's a nice, friendly, time.h. You can use man ctime to get some initial information on conversion operations.
There isn't a code for reading or printing data of type time_t. What should we do?
Well there should be time_t to-string and from-string operations. You could convert to a string when writing to the file and unconvert when reading.
Alternately, on our machines, time_t is a long int (>/usr/include/bits.h). For portability, to write you should assign your time variable to a long int and write that long int and to read you should read into a long int and then assign to the variable or field of type time_t. That way, C's implicit coercion will handle any size differences.
Should we store the list in sorted order?
It's up to you. Since we may ask for the most important thing with different metrics of important (priority, time, etc.), it may be had to decide which is appropriate.
Should we provide a procedure for sorting the list?
It's up to you. It's not one of the core requirements, but it would certainly be a nice addition.
Do we have to reclaim the memory associated with the nods in the list when someone removes all the tasks?
Certainly. You are responsible for reclaiming space associated with the nodes of the list. Depending on your implementation, you may also be responsible for reclaiming the space associated with the values in those nodes.
What do you mean by [s]can the list, one at a time.
I mean that the user can repeatedly hit a key, such as n to have your program move on to and then print the next element.

 

History

Wednesday, 9 April 2003 [Samuel A. Rebelsky]

Sunday, 13 April 2003 [Samuel A. Rebelsky]

 

Disclaimer: I usually create these pages on the fly, which means that I rarely proofread them and they may contain bad grammar and incorrect details. It also means that I tend to update them regularly (see the history for more details). Feel free to contact me with any suggestions for changes.

This document was generated by Siteweaver on Fri May 2 14:19:39 2003.
The source to the document was last modified on Mon Apr 14 08:14:11 2003.
This document may be found at http://www.cs.grinnell.edu/~rebelsky/Courses/CS195/2003S/Homework/hw.06.html.

You may wish to validate this document's HTML ; Valid CSS! ; Check with Bobby

Samuel A. Rebelsky, rebelsky@grinnell.edu