Hi guys, I have searched the entire web:(whew): and I finally made my way back here. My problem is: I have a doubly linked list that stores digits, called HugeNumber, which has an inner class Digit. All my other methods for this problem I have completed(more or less successfully), but am totally stuck on one.The method I can complete is an add method, which takes my hugenumber, and addes it to another hugenumber. It doesn't matter right now where I get my other hugenumber, it can be from the user, or it can be initialzed.

(my inner class Digit is pretty stright forward, no problems there, I think, so I didn't post it).Code:`public HugeNumber(HugeNumber newVal)`

{

// Traverse the input HugeNumber, copying each node to a new list

DigitNode current = newVal.head;

DigitNode temp; // Copy of current node

DigitNode prev; // Previous node for the copy so we can set up the double link

temp = new DigitNode(current.digit, null, tail);

prev = temp;

current = current.getNext();

while (current != null)

{

prev.next = new DigitNode(current.digit, null, tail);

prev = prev.next;

current = current.next;

}

}

/**

* Adds a input HugeNumber to this HugeNumber. It traverses the linked lists,

* adding each digit starting from the least significant digit and working

* up to the most significant digit.

*

* @param otherNum target HugeNumber to add

* @return HugeNumber HugeNumber that represents the sum of the two HugeNumbers

*/

public HugeNumber add(HugeNumber otherNum)

{

HugeNumber newNum = new HugeNumber(); // Create new number

//HERE IS WHERE I DON'T KNOW WHAT TO DO

}

/**

* addDigit adds a new digit, d, as a new most significant

* digit for the list.

* @param d new digit to add as the MSD

*/

public void addDigit(int d)

{

DigitNode newHead = new DigitNode(d, null, head);

if (head != null)

{

head.prev = newHead;

}

head = newHead;

}

/**

* Resets the HugeNumber to a null, empty value

*/

public void resetValue()

{

head = null;

tail = null;

}

/**

* @return String The HugeNumber converted to a string

*/

public String toString()

{

String strVal ="";

DigitNode position = head;

while (position != null)

{

strVal = strVal + position.getDigit( ) + "\n";

position = position.getNext( );

}

return strVal;

}

}

So my problems are with the method, public HugeNumber add(HugeNumber otherNum)

This is what I think I have to do to get the sum, but have no clue how to do it:

1). I have to get the recursive of the two DLL's, and add them that way, (this is correct, right?), but I don't know how to do that.

And if that's the way I do it, how to I:

2). Carry over to the next digit?

My textbook, of course, gives absolutely nothing to help me on this problem. :frusty:

I'm trying to learn JAVA, so if you guys can give me the basic code outline, I'll try and work with that and get back with what I came up with. Thanks a trillion.