{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

LinkedList - Implementation file ListP.cpp for the ADT list...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
// ********************************************************* // Implementation file ListP.cpp for the ADT list. // Pointer-based implementation. // ********************************************************* #include "LinkedList.h" // header file #include <cstddef> // for NULL ListReferenceBased::ListReferenceBased() : numItems(0), head(NULL) {} // end default constructor ListReferenceBased::~ListReferenceBased() { removeAll(); } // end destructor bool ListReferenceBased::isEmpty() const { return numItems == 0; } // end isEmpty int ListReferenceBased::size() const { return numItems; } // end size ListReferenceBased::Node *ListReferenceBased::find(int index) const // -------------------------------------------------- // Locates a specified node in a linked list. // Precondition: index is the number of the // desired node. // Postcondition: Returns a pointer to the desired // node. // -------------------------------------------------- { // count from the beginning of the list Node *curr = head;
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 2

LinkedList - Implementation file ListP.cpp for the ADT list...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon bookmark
Ask a homework question - tutors are online