































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!
































MP_Lists out now!
Learning Objectives
Cur. Location Cur. Data Next ListNode * curr Curr->data Curr->next unsigned index data[index] index++ Some form of (x, y, z)
Cube::Iterator it = myCube.begin(); while (it != myCube.end()) { std::cout << *it << " "; it++; }
class Cube { // ... (Skipping for space) class CubeIt { // ... (Skipping for space) CubeIt& operator++() { ++ix_; if (ix_ == cube_->x_dim) { ix_ = 0; ++iy_; if (iy_ == cube_->y_dim) { iy_ = 0; ++iz_; } } return *this;
Iterators template class List { class ListIterator : public std::iterator { public: ListIterator& operator++(); ListIterator& operator--() bool operator!=(const ListIterator& rhs); const T& operator*(); }; ListIterator begin() const; ListIterator end() const; };
Implementing the mandatory interface enables easy looping!
Trees A non-linear data structure defined recursively as a collection of nodes where each node contains a value and zero or more connected nodes. [In CS 225] a tree is also: