(Latest Revision: 03/27/2001)
Week 07 Notes for CS 2500, Section 001 -- Spring 2001
CS 2500, Section 001, Monday, March 26, 2001
- Look at Upcoming Schedule
- Class starts at 10:10. I take roll at 10:20
- Announcement(s)
- The level two version of program #3 is due today
-
- Any questions on level two problems?
- Everybody doing OK writing code to open a file and read strings
and int's from the file? -- need help?
-
- Check out new file "prototypes.lev3" in the assignment directory for an
outline of an almost entire solution to the problem.
- I advise CS 2500 students to finish a little more of the program by
April 02 than is actually due: the work to finish out from
"doCommands" down is considerable -- so get to work on it. In my
soluton to this problem, I have about 20 functions. Eleven of these
functions are in the part of the program that is not due until
the final date.
- Discuss what is expected for the version of the program to be turned in
next Monday.
- Working on level #3, I found I wanted "gender" to be an additional
parameter of getNextClient and putClientInList. (Gender is not
stored in my version of the client record)
- What do we need to do to "glue" the list code to the main program
file?
- Define the client record type in the listA.h file, or via
a #include.
- plug in "values" for MAX_LIST constant and listItemType.
- In main program, equate "clientList" to "listClass" -- or
whatever is required by the terminology used by the
programmer.
-
- In "putClientInList," when we want to insert an item at the end of
a list, how do we know what position to give to function
"ListInsert(int NewPosition, listItemType NewItem, bool& Success)?"
-
-
CS 2500, Section 001, Wednesday, March 28, 2001
- Look at Upcoming Schedule
- Class starts at 10:10. I take roll at 10:20
- Announcement(s)
- Sample calls to a list operation in program #3:
- clientData[0].ListInsert(4, item, success) ;
- clientData[genderID].ListInsert(place, item, success) ;
- Discuss virtues of abstract data typing and modular code.
- Easier to design correctly
- Easier to change implementations
- protects integrity of data from users
- Easier to re-use code
- Look at the
data structures talk
- Start discussing linked lists.
- The interface to our linked list is the same as the interface to
our array list. This is a case where the ADT remains the same.
It is only the implementation that differs.
- Note what is different in ListP.h from ListA.h
- In the ListP.cpp implementation file we see the use of pointers,
linking, dynamic memory allocation/deallocation using the "new
dataType"/"delete pointerToData" functions/syntax.
- Look at various samples of insertion code. Get help from example
*.jpg files.
- Look at a couple of cases of retrieval.
- Consider deletion
- Review the pro's/con's and performance differences between
pointer-based and array-based implementations.
-
CS 2500, Section 001, Friday, March# 30, 2001
- Look at Upcoming Schedule
- Class starts at 10:10. I take roll at 10:20
- Announcement(s)
- This is the Cesar Chavez holiday -- no class today. We "make up"
this class day at the end of the term.
-
-