public:
Compares list contents deeply (i.e. in the sense of operator == (const X&,
const X&)). Takes O(min(m,n)) time where m = list1.get_length() and n =
list2.get_length().
friend bool operator == (const List<X>& list1, const List<X>& list2);
friend bool operator != (const List<X>& list1, const List<X>& list2);
A more readable alternative to operator == (const List<X>&, const List<X>&).
friend bool lists_equal(const List<X>* list1, const List<X>* list2);
A more readable alternative to operator == (const X&, const X&). Internally
calls operator == (const X&, const X&) but checks for null pointers first.
friend bool xs_equal(const X* x1, const X* x2)
|
Finds X values in the sense of operator == (const X&, const X&)
Each function takes O(n) time. Argument "element" is a reference
rather than a pointer so that temporaries may be passed
as arguments.
friend Node<X>* find_element_equal(Node<X>* start, const X& element)
friend const Node<X>* find_element_equal_const(const Node<X>* start, const X& element)
|