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.
this->
, which are always suspicious. Remove them.
Does everything still work?
.initialize()
often indicate that the author
of the code 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.
For extra fame & glory:                 
LinkedList
object is destroyed? Fix that.
.print()
is tacky. Overload the <<
operator so
you can use <<
on a LinkedList
object,
just like any other type.
Modified: 2017-03-07T12:19                  User: Guest                  Check: HTML CSSEdit History Source |
Apply to CSU |
Contact CSU |
Disclaimer |
Equal Opportunity Colorado State University, Fort Collins, CO 80523 USA © 2015 Colorado State University |