#include <iostream>
#include <string>
#include <map>
using namespace std;
struct Node
{
int data;
Node* next;
};
void delDuplicate(Node* head)
{
map<int, bool> table;
Node* pre = NULL;
while (head)
{
if (table.count(head->data) == 1)
{
pre->next = head->next;
}
else
{
table[head->data] = true;
pre = head;
}
head = head->next;
}
}
int main()
{
// getchar();
return 0;
}
#include <string>
#include <map>
using namespace std;
struct Node
{
int data;
Node* next;
};
void delDuplicate(Node* head)
{
map<int, bool> table;
Node* pre = NULL;
while (head)
{
if (table.count(head->data) == 1)
{
pre->next = head->next;
}
else
{
table[head->data] = true;
pre = head;
}
head = head->next;
}
}
int main()
{
// getchar();
return 0;
}