Cần giúp về Danh sách liên kết đơn

Mình đang học LTHĐT bằng C++ và làm đc đến đây r.
Mọi người giúp cho nó chạy với

#include
using namespace std;
class DSLK;
class Node
{
int data;
Node *next;
public:
Node(int _data)
{
data = _data;
next = NULL;
}
~Node();
friend class DSLK;
};
class DSLK
{
Node *head;
Node *tail;
int dem;
public:
DSLK()
{
head = tail = NULL;
dem = 0;
}
~DSLK()
{
destructor();
}
void destructor();
void push_front(int _data);
void printf();
};
void DSLK::destructor()
{
Node *i = head;
while(head)
{
i = i -> next;
delete head;
head = i;
}
head = tail = NULL;
}
void DSLK::push_front(int _data)
{
if(head)
{
Node *temp = new Node(_data);
temp->next = head;
head = temp;
}
else
head = tail = new Node(_data);
}
void DSLK::printf()
{
Node *i=head;
while(i != NULL)
{
cout<<" -> "
<< i->data;
i = i->next;
}
}

main()
{
DSLK a;
a.push_front(5);
a.push_front( 4);
a.printf();
}

bạn format lại code cho tử tế nhé, để nguyên 1 cục thế khó nhìn lắm, không có ai thèm giúp đâu

83% thành viên diễn đàn không hỏi bài tập, còn bạn thì sao?