[C++]
- 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
[C++]
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am