#inelude stdio.h #inelude stdlib.h #inelude tine.h typedef struet nade { int data; struct node +naxtPtr; NODE; int addElement (NODE *head, int item)( I Write code here void printlist (NODE head)( I Write code here vaid concatlist(NODE *1ist1, NODE *l1st2)( I Write code here int nain(void)( srand(20); Seed fix. int num; NODE list(2] - (NULL); printf("How nany elanents? (0 - 100): "); scanf("d", anum): for(int j- 0; 1 « 2; j++){ for(int 1- 0; 1 « num; 1++) addElenent (klsst[1], rand() S 100 + 1): for(int 1- 0; 1« 2; 1++)( printf("(List a]\n", 1); printList(alist(1]): concatlist (Alist[@], alist[1]); printf("(Concat]\n"); printList(klist(0]): return e;

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Input code in the "Write code here" sections

#include <stdio.h>
#include <stdlib.h
#include <tine.h>
typedef struct node (
int data;
struct node nextPtr;
}NODE;
int addElemant (NODE **head, int item){
/I Write code here
void printlist (NODE **head) {
/I Write code here
void concatlist(NODE **1ist1, NODE **list2)(
/I Write code here
int main(void)0
srand(20);/1Seed fix.
int num;
NDDE *list[2] - (NULL);
printf("How many elenenta? (8 - 188): ");
scanf("d", &num):
for(int ] - e; j < 2; j+)(
for(int 1 - 8; 1 < num; 1++)
addElenent (Elist[j), rand() S 180 + 1):
for(int 1- e; i « 2; 1++)(
printf("[List dl\n", 1):
printList(8list[1]):
concatlist (alist[@], alist[1]);
printf("[Concat]\n");
printList(klist[@]);
return e;
Transcribed Image Text:#include <stdio.h> #include <stdlib.h #include <tine.h> typedef struct node ( int data; struct node nextPtr; }NODE; int addElemant (NODE **head, int item){ /I Write code here void printlist (NODE **head) { /I Write code here void concatlist(NODE **1ist1, NODE **list2)( /I Write code here int main(void)0 srand(20);/1Seed fix. int num; NDDE *list[2] - (NULL); printf("How many elenenta? (8 - 188): "); scanf("d", &num): for(int ] - e; j < 2; j+)( for(int 1 - 8; 1 < num; 1++) addElenent (Elist[j), rand() S 180 + 1): for(int 1- e; i « 2; 1++)( printf("[List dl\n", 1): printList(8list[1]): concatlist (alist[@], alist[1]); printf("[Concat]\n"); printList(klist[@]); return e;
Create two linked lists, each of which contains five arbitrary numbers.
Make concatList(NODE **list1, NODE *list2) function which
concatenates the two lists. The concatenated list MUST be a linked list.
실행 화면 예시
: 공백
d: 줄바꿈
: 탭
How many elements? (0.-.100):5J
[List 0]J
12.59 98 60.97.J
[List 1]J
82.63 42.41.82
[Concat]e
12.59.98 60 97 82 63.42 41 82
Transcribed Image Text:Create two linked lists, each of which contains five arbitrary numbers. Make concatList(NODE **list1, NODE *list2) function which concatenates the two lists. The concatenated list MUST be a linked list. 실행 화면 예시 : 공백 d: 줄바꿈 : 탭 How many elements? (0.-.100):5J [List 0]J 12.59 98 60.97.J [List 1]J 82.63 42.41.82 [Concat]e 12.59.98 60 97 82 63.42 41 82
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Concept of memory addresses in pointers
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education