Question: Hi i am taking a java class and i was given this question You can represent an integer with any number of digits by storing
Hi i am taking a java class and i was given this question
You can represent an integer with any number of digits by storing the integer as a linked list of digits. A more efficient representation will store a larger integer (more than just one digit) in each node. Design and implement an ADT for unbounded whole numbers (integers with no limit) in which a number is implemented as a linked list of integers. Each node will hold an integer less than or equal to 999. The number represented is the concatenation of the numbers in all the nodes. For example, if there are four nodes with the four integers 23, 7, 999, and 0 then this represents the number 23,007,999,000. Note that the number in a node is always considered to be three digits long. If it is not three digits long, then leading zeros are added to make it three digits long. Include methods for the usual integer operators to work with your new class.
Note: You cannot use Java's BigInteger class.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
