Here are DoubleNode. H header file, textbook copy no problem,
The template & lt; The class T>
The class DoubleNode
{
Public:
T data;
DoubleNode
DoubleNode ()
{
This - & gt; Prev=this - & gt; Next=NULL;
}
DoubleNode (T data, DoubleNode
{
This - & gt; Data=https://bbs.csdn.net/topics/data;
This - & gt; Prev=prev.
This - & gt; Next=next;
}
};
Here are DoubleNode. H header file, the great god, please help to see where there is wrong
#include
using namespace std;
# include "DoubleNode. H"
The template & lt; The class T>
The class CirDoublyList
{
Public:
DoubleNode
CirDoublyList ();
CirDoublyList (T values [], int n);
~ CirDoublyList ();
Bool empty ();
Int the count ();
Boolean operator==(CirDoublyList
Bool equals (DoubleNode
T& Get (int I);
Virtual void set (int I, T, x);
Friend ostream& Operator<<> (ostream& Out, CirDoublyList
DoubleNode
Virtual DoubleNode
T remove (int I);
Void removeAll ();
};
The template & lt; The class T>
CirDoublyList
{
This - & gt; The head=new DoubleNode
This - & gt; The head - & gt; Prev=this - & gt; The head - & gt; Next=this - & gt; The head;
}
The template & lt; The class T>
CirDoublyList
{
This - & gt; The head=new DoubleNode
This - & gt; The head - & gt; Prev=this - & gt; The head - & gt; Next=this - & gt; The head;
for (int i=0; i
}
The template & lt; The class T>
CirDoublyList
{
This - & gt; RemoveAll ();
Delete this - & gt; The head;
}
The template & lt; The class T>
Bool CirDoublyList
{
Return this - & gt; The head - & gt; Next==this - & gt; The head;
}
The template & lt; The class T>
Int CirDoublyList
{
int i=0;
For (DoubleNode
i++;
return i;
}
The template & lt; The class T>
T& CirDoublyList
{
DoubleNode
For (int j=0; P!=this - & gt; Head & amp; & jP=p - & gt; next;
If (i>=0 & amp; & P!=NULL)
The return p - & gt; The data;
Throw out_of_range (" unable to return the value of the I ");
}
The template & lt; The class T>
Void CirDoublyList
{
DoubleNode
For (int j=0; P!=this - & gt; Head & amp; & jP=p - & gt; next;
If (i>=0 & amp; & P!=this - & gt; The head)
p-> Data=https://bbs.csdn.net/topics/x;
The else throw out_of_range (" unable to set the value of the I ");
}
The template & lt; The class T>
Ostream& Operator<<> (ostream& Out, CirDoublyList
{
Out<" (";
For (DoubleNode
{
Out
If (p - & gt; Next!=list. Head)
Out<" , ";
}
Out<" ) \ n ";
Return the out;
}
The template & lt; The class T>
DoubleNode
{
DoubleNode
For (int j=0; The front - & gt; Next!=head & amp; & jThe front=front - & gt; next;
DoubleNode
The front - & gt; Next - & gt; Prev=q;
The front - & gt; Next=q;
The return of q;
}
The template & lt; The class T>
DoubleNode
{
DoubleNode
This - & gt; The head - & gt; Prev - & gt; Next=q;
This - & gt; The head - & gt; Prev=q;
The return of q;
}
The template & lt; The class T>
T CirDoublyList
{
DoubleNode
For (int j=0; P!=this - & gt; Head & amp; & jP=p - & gt; next;
If (i>=0 & amp; & P!=this - & gt; The head)
{
T old=p - & gt; The data;
p-> Prev - & gt; Next=p - & gt; next;
p-> Next - & gt; Prev=p - & gt; Prev.
The delete p;
Return old;
}
Throw out_of_range (" unable to delete the I value ");
}
The template & lt; The class T>
Void CirDoublyList
{
DoubleNode
While (p!=this - & gt; The head)
{
DoubleNode
P=p - & gt; next;
The delete q;
}
This - & gt; The head - & gt; Next=this - & gt; The head - & gt; Prev=this - & gt; The head;
}
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull