Maurice Tutor

(5)

$15/per page/Negotiable

About Maurice Tutor

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Algebra,Applied Sciences See all
Algebra,Applied Sciences,Biology,Calculus,Chemistry,Economics,English,Essay writing,Geography,Geology,Health & Medical,Physics,Science Hide all
Teaching Since: May 2017
Last Sign in: 398 Weeks Ago, 1 Day Ago
Questions Answered: 66690
Tutorials Posted: 66688

Education

  • MCS,PHD
    Argosy University/ Phoniex University/
    Nov-2005 - Oct-2011

Experience

  • Professor
    Phoniex University
    Oct-2001 - Nov-2016

Category > Computer Science Posted 21 Jul 2017 My Price 7.00

NodeList in Code Fragment

In our implementation of an iterator for class NodeList in Code Fragment 6.7, we defined only the preincrement operator. Provide a definition for a postincrement operator.

Code Fragment 6.7: Class Iterator, realizing an iterator for a doubly linked list.

Our iterator object is called Iterator. To users of class NodeList, it can be accessed by the qualified type name NodeList::Iterator. Its definition, which is presented in Code Fragment 6.7, is placed in the public part of NodeList. An element associated with an iterator can be accessed by overloading the dereferencing operator (“*”). In order to make it possible to compare iterator objects, we overload the equality and inequality operators (“==” and “!=”). We provide the ability to moveforward or backward in the list by providing the increment and decrement operators(“++” and “– –”). We declare NodeList to be a friend, so that it may access theprivate members of Iterator. The private data member consists of a pointer to theassociated node of the list. We also provide a private constructor, which initializesthe node pointer. (The constructor is private so that only NodeList is allowed tocreate new iterators.)

class Iterator {// an iterator for the listpublic: Elem& operator*();// reference to the elementbool operator==(const Iterator& p) const;// compare positionsbool operator!=(const Iterator& p) const; Iterator& operator++();// move to next positionIterator& operator−−();// move to previous positionfriend class NodeList;// give NodeList accessprivate: Node* v;// pointer to the nodeIterator(Node* u);// create from node}; 

Answers

(5)
Status NEW Posted 21 Jul 2017 07:07 AM My Price 7.00

Hel-----------lo -----------Sir-----------/Ma-----------dam----------- ----------- -----------Tha-----------nk -----------You----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------acq-----------uis-----------iti-----------on -----------of -----------my -----------sol-----------uti-----------on.-----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- ca-----------tch-----------

Not Rated(0)