36 void changinglisti(node head) ( 37 node *p, *k, *z; 38 k=head; D- int ort, s-0 while (k!-NULL}€ p=head;> int temp =0; while (p->nextNULL){ 39 40 41 42 43 RE if{-p->data > p->next->data) ( temp-p->data; od p->data-p->next->data: p->next->data=temp: 44 45 46 47 48 (0- 3 49 P*p->next: 50 51 k=k->next: 52 53 54 55 Evoid changinglist2 (node *head) { 56 ou teo node p, k, *z; ) 57 k=head; p-head: while (p->next!=NULL){ 58 59 60 k-p: 61 62 E while(z-Sdataz->next->data) ( 63 k=z->next: 64 z->next-z->next->next: 65 free (k) : 66 67 P-p->next: 68 69 71 Bint main (int arge, char *argv[){ 72 char "no; 73 no= (char ") malloc (sizeof (char)) : 74| printf ("Enter Your student number: ") : 75 scant ("s", no) : 76 node root: root-createlist (no); changinglist1 (root); 77 78 79 changinglist2 (root): 80 showlist (root) :

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Solve it

solve the answer according to the values ​​I gave. student no:2012010206083

36 Evoid changinglisti (node *head) { ht
37
node *p, *k, *z;
k=head; D
int ort, s-0
while (k!-NULL)
p=head;>
int temp =0;
38
39
vill
40
41
42
de
43
while (p->next NULL)(
if -p->data > p->next->data) (
temp-p->data;bor
p->data p->next->data;
p->next->data=temp;
44
45
46
TG
47
48
(0-
p-p->next;
49
50
51
k=k->next;
52
53
54
Evoid changinglist2 (node *head) (
0a2 node p, "k, *z: ")
55
56 ou
57
k=head;
58
p-head;
->
59
while (p->next!=NULL) {
k-p: E
z-p; yu
while (z-data-z->next-data) (
60
61
62
63
k=z->next:
64
z->next-z->next->next;
65
free (k):
66
67
p-p->next;
68
69
sk
71
Qint main (int arge, char *argv[]) (
72
char "no;
73
no= (char *) malloc (sizeof (char) ):
74 |
printf ("Enter Your student number:
") :
75
scanf ("a", no) ;
76
node *root:
root-createlist (no);
changinglisti (root);
77
78
79
changinglist2 (root):
80
showlist (root):
81
More questions next page
return 0;
82
Page 4 of 5
Transcribed Image Text:36 Evoid changinglisti (node *head) { ht 37 node *p, *k, *z; k=head; D int ort, s-0 while (k!-NULL) p=head;> int temp =0; 38 39 vill 40 41 42 de 43 while (p->next NULL)( if -p->data > p->next->data) ( temp-p->data;bor p->data p->next->data; p->next->data=temp; 44 45 46 TG 47 48 (0- p-p->next; 49 50 51 k=k->next; 52 53 54 Evoid changinglist2 (node *head) ( 0a2 node p, "k, *z: ") 55 56 ou 57 k=head; 58 p-head; -> 59 while (p->next!=NULL) { k-p: E z-p; yu while (z-data-z->next-data) ( 60 61 62 63 k=z->next: 64 z->next-z->next->next; 65 free (k): 66 67 p-p->next; 68 69 sk 71 Qint main (int arge, char *argv[]) ( 72 char "no; 73 no= (char *) malloc (sizeof (char) ): 74 | printf ("Enter Your student number: ") : 75 scanf ("a", no) ; 76 node *root: root-createlist (no); changinglisti (root); 77 78 79 changinglist2 (root): 80 showlist (root): 81 More questions next page return 0; 82 Page 4 of 5
Write the output of the given c program below when your student number is read from
keyboard to the "no" array in the program.
#include kstdio.ho 1ei iip io
39
1
#include <stdlib.h>
JUI
1
#include"<string.h>
Etypedef struct node(
char data;
3
4
10 (JI
Ini
69
struct node* next;
) node;
node *createlist (char *no)
int s, k-0;
node *head, *p =
3= strlen(no) ;
while ( k<s) ("
if (k==0) {
7
6.
10
a9
11
12
13
iea
ES
14
head= (node *) malloc (sizeof (node) ) :
- בות
nTI
15
p=head;
TTC
16
TX9
54
Tog
ITO
BTS
EI
17
else
18
p->next= (node *) malloc (sizeof (node)):
19
p=p->next;
20
p->data=no[k]; au=d.a*
K
22
k++;
23
p->next-NULL; UM<-0xS
El
24
48
25
retūrn head;
26
Bvoid showlist (node *head){
27
28
node *p:
29
p=head;
Ewhile (p!=NULL){ )) (t N-
printf("c
le
31
", p->data):
32
p=p->next;
33
le
34
00
HIHH
N NN N NNN
N N M m33
Transcribed Image Text:Write the output of the given c program below when your student number is read from keyboard to the "no" array in the program. #include kstdio.ho 1ei iip io 39 1 #include <stdlib.h> JUI 1 #include"<string.h> Etypedef struct node( char data; 3 4 10 (JI Ini 69 struct node* next; ) node; node *createlist (char *no) int s, k-0; node *head, *p = 3= strlen(no) ; while ( k<s) (" if (k==0) { 7 6. 10 a9 11 12 13 iea ES 14 head= (node *) malloc (sizeof (node) ) : - בות nTI 15 p=head; TTC 16 TX9 54 Tog ITO BTS EI 17 else 18 p->next= (node *) malloc (sizeof (node)): 19 p=p->next; 20 p->data=no[k]; au=d.a* K 22 k++; 23 p->next-NULL; UM<-0xS El 24 48 25 retūrn head; 26 Bvoid showlist (node *head){ 27 28 node *p: 29 p=head; Ewhile (p!=NULL){ )) (t N- printf("c le 31 ", p->data): 32 p=p->next; 33 le 34 00 HIHH N NN N NNN N N M m33
Expert Solution
steps

Step by step

Solved in 3 steps with 3 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY