Page 1 of 1

[C++]

Posted: Fri Jul 08, 2022 7:27 am
by answerhappygod
[C++]
C 1
C 1 (53.88 KiB) Viewed 34 times
C 2
C 2 (5.59 KiB) Viewed 34 times
- struct node: represents a node in linkedlists - functions createLinkedList: + Receive the size of a linked list (>0) + create a linked list with value from standard input (stdin) a new node is add to the END of the linked list + Return a pointer which points to the first node of the linked list. - Function mergeList: + receive 2 head1, head2 pointers of 2 linked lists + Function mergeList will change the 1st linked list so that the 2nd linked list will be concatenated to the end of the 1st linked list - function main reads the linked list's size, calls function createLinked List to initialize the linked list, then calls function print to print the linked list. Complete the functions mergeList Input: All the inputs from standard input (stdin) with value in (0; 5000) Output: Satisfy the requirements Write a program where:
For example: Test Input 1 Result 5 1 1 3 5 7 9 3 2 5 12 7 9 1 2