100% Guaranteed Results


CS515: Computer System Lab 2 Solved
$ 20.99
Category:

Description

5/5 – (1 vote)

1 Description
In this assignment, you need to create a doubly circular linked list where each node is represented as shown in the following figure.

Figure 1: Layout of the node of the linked list
This circular linked list is now used to represent a very large integer number. For an example, if the number is 13242197849762 then the following circular linked list can be used to represent the number.

Figure 2: Layout of the doubly circular linked list
Similarly, you need to create another doubly linked list to represent the second number.
Now perform the following tasks-
• Compare the two numbers and return appropriate message, e.g. “first number is less than the second number” or “first number is greater than the second number” or “both the numbers are same”.
• Add the two numbers and store the sum in another doubly circular linked list
• Subtract the smaller number from the larger number and store the result in another doubly linked list
Your program must contain a printList() function which will take Header node as argument and print the list in the following form-
• by traversing the doubly circular linked list of the input number 13242197849762
• the number should be printed as 1324,21978,49762
Please note that if the header node data value is 0 then it denotes the number 0 and there will be no other nodes with the header node.
Also, you need to take the input from an input file name ip.txt and generate the output in an output file name op.txt.
1
2 Sample Input Output
Contents of ip.txt
8888888888
2000000000
After executing the program,
Contents of op.txt file
Comparison result: first number is greater than the second number
Addition result: 1,08888,88888
Subtraction result:68888,88888
3 Submission
Submit the assignment using the submission link provided in the following course page only. https://www.iitp.ac.in/~samrat/CompSysLab2_CS515/
4 Guidelines
• Do not use any library/package (eg. STL etc) to implement this. Your code must be well documented (use appropriate comments and indentation) and any invalid input must also be handled properly.
• There will be penalty if you are found to take any unfair means during the assignment submission process.
• Copying others’ program and allowing others to copy your program will be penalized equally.
2

Reviews

There are no reviews yet.

Be the first to review “CS515: Computer System Lab 2 Solved”

Your email address will not be published. Required fields are marked *

Related products