Question: I have this function: ` ` ` template Iterator DoublyLinkedList::end ( ) { Iterator iter; iter.curr = nullptr; / / Point the iterator to nullptr

I have this function: ```template
Iterator DoublyLinkedList::end(){
Iterator iter;
iter.curr = nullptr; // Point the iterator to nullptr (past the end)
iter.pastTheEnd = true; // Set past_the_end to true
return iter;
}. But I need iter.curr to point to the tail, not nullptr. I currently don't have the tail initialized. How can I initialize the tail, and set iter.curr to point to the tail?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!