If we wrote a linked structure to store one type of data, but then we want to us
ID: 3917675 • Letter: I
Question
If we wrote a linked structure to store one type of data, but then we want to use it again in a different program for a different type of data, which of the following is the best way to do it?
Unless the new data type is compatible with the original type, you cannot do this.
If the linked structure is static, then no modification of the code is necessary.
Change the definition of the Node class to include the proper attributes, then update the rest of the code accordingly.
Start over from the beginning and rewrite the linked structure code from scratch to use the new type.
Unless the new data type is compatible with the original type, you cannot do this.
If the linked structure is static, then no modification of the code is necessary.
Change the definition of the Node class to include the proper attributes, then update the rest of the code accordingly.
Start over from the beginning and rewrite the linked structure code from scratch to use the new type.
Explanation / Answer
Answer:
Change the definition of the Node class to include the proper attributes, then update the rest of the code accordingly.
Explanation:
Suppose Node class is defined as Int. We should make it as generic Type so we need Node class changes
Thanks
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.