This lab concerns the linked lists and dynamic memory allocation.                 
~cs253/Labs/LinkedList
to a convenient place in your home directory.
main.cc
& ll.cc
together.
Makefile
so that you won't have to type g++
again.
Use at least -Wall
.
this->
, which are always suspicious. Remove them.
Does everything still work?
.initialize()
methods often indicate that the author
doesn't understand constructors. Turn them into ctors.
.remove()
uses a pointer argument to return a value.
How crass—use a reference, instead.
.print()
that displays the list.
Add another case in main()
that uses it.
.print()
is tacky. Replace it with an overloaded <<
operator so you can use <<
on a LinkedList
object,
just like any other type.
LinkedList
object is destroyed? Fix that.
User: Guest