我现在对此感到非常恼火。我正在为大学学习合并排序,并且正在经历我在网上找到的这种合并排序。但是,我似乎没有得到重复,我想要重复。它的这一点如下,但我已经评论了这一点和东西,它使排序无法正常工作。有什么办法可以保留重复项吗?如果您能保持答案简单,我将不胜感激。谢谢
else
{
// Both are equal.
// Arbitraritly chose to add one of them and make
// sure you skip both!
if(c == NULL)
{
c = a;
}
else
{
c->next = a;
c = c->next;
}
a = a->next;
b = b->next;
}