class ListNode//non recursive
{
public:
int data;
ListNode * next;
ListNode(ListNode & in)
{
ListNode*src_buff = ∈
ListNode*item = this;
while(src_buff != NULL)
{
item->data = src_buff->data;
int null__ = 0;
ListNode *null_ = reinterpret_cast<ListNode*>(null__);
item->next = new ListNode(*null_);
item = item->next;
src_buff = src_buff->next;
}
}
};
class ListNode//recursive
{
public:
int data;
ListNode * next;
ListNode(ListNode & in)
{
data = in.data;
if (in.next!=NULL)
next = new ListNode ((const ListNode) * in.next);
else
next = NULL;
return;
}
};