UMBC CMSC202, Computer Science II, Spring 1998,
Sections 0101, 0102, 0103, 0104 and Honors
Tuesday March 17, 1998
Assigned Reading:
- A Book on C:
- Programming Abstractions in C:
Handouts (available on-line): none.
Topics Covered:
- Finished discussion on the linked list implementation
of the simple list ADT from last week.
(See
header file,
implementation,
main program and
sample run.)
A few bugs were found in the original implementation.
There were memory leaks in the Delete()
and Concatenate() functions. Also, the
Delete() function did not check if the
last node of the linked list was being deleted.
The source code in the web pages have these
problems fixed now.
- Impromptu discussion about the advantages and disadvantages
of having the system do garbage collection (used by LISP and
Java) versus having the programmer explicitly free memory that is
no longer needed (used by C and C++).
- We substituted an array
implementation of the list ADT for the linked list
implementation. We used a new name "list1a.h" for the new header file to avoid confusion, but as
far as the main program is concerned
it could have been called "list1.h". Note that the main program
worked just fine without modification because all uses of the
list ADT is through the functions defined by the header file.
(See sample run.)
- Compared and contrasted the performance of the array
implementation versus the linked list implementation of
the list ADT.
- Discussed topics for Exam 2.
Last Modified:
22 Jul 2024 11:27:44 EDT
by
Richard Chang
Back up
to Spring 1998 CMSC 202 Section Homepage