Question: Remove Ads TOTALAdblock 1 3 . 7 LAB: Iterable 2 - 3 - 4 tree In this lab, the Tree 2 3 4 class is

Remove Ads
TOTALAdblock
13.7 LAB: Iterable 2-3-4 tree
In this lab, the Tree234 class is extended to support iteration with a range-based for loop. Such support is provided via the implementation of an iterator that can iterate through the tree's keys in ascending order.
An iterator is an object that maintains a pointer to a specific element in a collection and can move to the next element. Ex: A Tree234 iterator points to the tree's minimum key upon construction. The iterator can then move to the second to minimum key, then the third to minimum, and so on. After moving past the tree's last key, the iterator can move no further.
Overview of iterable objects in C++
This lab requires implementation of a simplified iterator that:
implements the dereference operator (**) to return the key that the iterator currently points to,
implements the pre-increment operator (++) to advance to the next key,
supports copy construction and copy assignment, and
supports equality and inequality comparison.
Range-based for loops work on any class that implements the begin() and end0 member functions such that each returns an iterator. So Tree234 implements begin 0 and end 0. Tree234's begin 0 member function returns an instance of Tree234lterator object representing the inclusive starting point of iteration: the tree's minimum key. Tree234's end 0 member function returns an instance of Tree234lterator object representing the exclusive ending point of iteration: one beyond the tree's maximum key.
Step 1: Inspect the Node234.h file
Inspect the Node234.h file. Access Node234.h by clicking on the orange arrow next to main.cpp at the top of the coding window. Node234. his read only and has a complete implementation of a Node234 class for a 2-3-4 tree node. Member variables are protected and so must be accessed through the provided getter and setter functions.
Step 2: Inspect the Tree234Iterator.h file
Inspect the Tree234lterator.h file. The Tree234lterator class is declared, but required member functions are not implemented. The
 Remove Ads TOTALAdblock 13.7 LAB: Iterable 2-3-4 tree In this lab,

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!