- (SSNode *)meargerLink:(SSNode *)nodeHeadOne nodeHeadTwo:(SSNode *)nodeHeadTwo {
SSNode *cur = nil;
SSNode *newHead = nil;
while (nodeHeadOne!= nil && nodeHeadTwo != nil) {
if (nodeHeadOne.value < nodeHeadTwo.value) {
if (newHead == nil) {
newHead = nodeHeadOne;
cur = newHead;
}else {
cur.next = nodeHeadOne;
cur = cur.next;
}
nodeHeadOne = nodeHeadOne.next;
}else {
if (newHead == nil) {
newHead = nodeHeadTwo;
cur = newHead;
}else {
cur.next = nodeHeadTwo;
cur = cur.next;
}
nodeHeadTwo = nodeHeadTwo.next;
}
}
if (nodeHeadOne!= nil) {
cur.next = nodeHeadOne;
}
if (nodeHeadTwo!= nil) {
cur.next = nodeHeadTwo;
}
return newHead;
}