Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Can you draw the flowchart of this code Can you draw the flowchart of this code 1 12 1 #include 2 #include / 3 struct

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

Can you draw the flowchart of this code

Can you draw the flowchart of this code

1 12 1 #include 2 #include / 3 struct node 4 { 5 int info; 6 struct node *ptr; 7 } first, last, temp, num; 8 int count = %; 9 10 void create() 11- { first = last = NULL; 13 } 14 void kuyrukBuyut() 15 { 16 printf(" Queue buyutu : %d", count); 17 } 18 19 void enq(int data) 20 - { 21 if (last == NULL) 22 { 23 last = (struct node *)malloc(1*sizeof(struct node)); 24 last-ptr = NULL; 25 last-info = data; 26 first = last; 27 } 28 else 29 { 30 temp=(struct node *)malloc(1*sizeof(struct node)); last->ptr = temp; 32 temp->info = data; 33 temp - ptr = NULL; 34 35 last temp; 36 mmmmmm Om stin 2 37 count++; 38 } 39 40 void ekranaBas() 41 { 42 num first; 43 44 if ((num == NULL) && (last == NULL)) 45 { 46 printf("kuyruk Bos"); 47 return; 48 } 49 while (num != last) 50 { 51 printf("%d ", num->info); 52 num = num ptr; 53 } 54 if (num == last) 55 printf("%d", num->info); 56} 57 58 void deg() 59 - { 60 num first; 61 62 if (num == NULL) 63 { 64 printf(" Error: Trying to display elements from empty queue"); 65 return; 66 } 67 else 68 if (num->ptr != NULL) 69 { 70 num = num ->ptr; 71 printf(" Dequed value: %d", first->info); 72 free(first); 3. 72 free (first); 73 first num; 74 } 75 else 76 { 77 printf(" Dequed value : %d", first->info); 78 free(first); 79 first = NULL; 80 last = NULL; 81 } 82 count--; 83 } 84 85 int firstElemen() 86 { 87 if ((first != NULL) && (last != NULL)) 88 return(first-info); 89 else 90 return; 91 } 92 void main() 93 { 94 int numara, sec, e; 95 96 printf(" 1 - Enque 2 - Deque 3 - first element 4 - Exit 5 - Show 6 - Queue buyutu"); 97 98 create(); 99 while (1) 100 { 101 printf(" listeden yapmak islemi seciniz 1'den 7'ye kadar : "); 102 scanf("%d", &sec); 103 if (sec==1) { 104 printf("numara giriniz : "); 105 scanf("%d", &numara); 186 eng (numara); 1e7 { 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133} 134 printf(" listeden yapmak islemi seciniz 1'den 7'ye kadar : "); scanf("%d", &sec); if (sec==1) { printf("numara giriniz : "); scanf("%d", &numara); enq(numara); } else if(sec==2) { deq(); } else if(sec==3){ firstElemen(); if (e != @) printf("first elemen : %d", e); else printf(" kuyrukta hic bir eleman yok , kuyruk bos"); } 4 } else if(sec==4) { exit(); } else if (sec==5){ ekranaBas(); } else if(sec== 6){ kuyrukBuyut(); } else{ printf("hata!!! choice, lutfen dogru bir sayi giriniz "); } 1 12 1 #include 2 #include / 3 struct node 4 { 5 int info; 6 struct node *ptr; 7 } first, last, temp, num; 8 int count = %; 9 10 void create() 11- { first = last = NULL; 13 } 14 void kuyrukBuyut() 15 { 16 printf(" Queue buyutu : %d", count); 17 } 18 19 void enq(int data) 20 - { 21 if (last == NULL) 22 { 23 last = (struct node *)malloc(1*sizeof(struct node)); 24 last-ptr = NULL; 25 last-info = data; 26 first = last; 27 } 28 else 29 { 30 temp=(struct node *)malloc(1*sizeof(struct node)); last->ptr = temp; 32 temp->info = data; 33 temp - ptr = NULL; 34 35 last temp; 36 mmmmmm Om stin 2 37 count++; 38 } 39 40 void ekranaBas() 41 { 42 num first; 43 44 if ((num == NULL) && (last == NULL)) 45 { 46 printf("kuyruk Bos"); 47 return; 48 } 49 while (num != last) 50 { 51 printf("%d ", num->info); 52 num = num ptr; 53 } 54 if (num == last) 55 printf("%d", num->info); 56} 57 58 void deg() 59 - { 60 num first; 61 62 if (num == NULL) 63 { 64 printf(" Error: Trying to display elements from empty queue"); 65 return; 66 } 67 else 68 if (num->ptr != NULL) 69 { 70 num = num ->ptr; 71 printf(" Dequed value: %d", first->info); 72 free(first); 3. 72 free (first); 73 first num; 74 } 75 else 76 { 77 printf(" Dequed value : %d", first->info); 78 free(first); 79 first = NULL; 80 last = NULL; 81 } 82 count--; 83 } 84 85 int firstElemen() 86 { 87 if ((first != NULL) && (last != NULL)) 88 return(first-info); 89 else 90 return; 91 } 92 void main() 93 { 94 int numara, sec, e; 95 96 printf(" 1 - Enque 2 - Deque 3 - first element 4 - Exit 5 - Show 6 - Queue buyutu"); 97 98 create(); 99 while (1) 100 { 101 printf(" listeden yapmak islemi seciniz 1'den 7'ye kadar : "); 102 scanf("%d", &sec); 103 if (sec==1) { 104 printf("numara giriniz : "); 105 scanf("%d", &numara); 186 eng (numara); 1e7 { 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133} 134 printf(" listeden yapmak islemi seciniz 1'den 7'ye kadar : "); scanf("%d", &sec); if (sec==1) { printf("numara giriniz : "); scanf("%d", &numara); enq(numara); } else if(sec==2) { deq(); } else if(sec==3){ firstElemen(); if (e != @) printf("first elemen : %d", e); else printf(" kuyrukta hic bir eleman yok , kuyruk bos"); } 4 } else if(sec==4) { exit(); } else if (sec==5){ ekranaBas(); } else if(sec== 6){ kuyrukBuyut(); } else{ printf("hata!!! choice, lutfen dogru bir sayi giriniz "); }

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional Microsoft SQL Server 2014 Integration Services

Authors: Brian Knight, Devin Knight

1st Edition

1118850904, 9781118850909

More Books

Students also viewed these Databases questions

Question

What challenges do you face in your current role?

Answered: 1 week ago

Question

=+Do you think these assumptions are reasonable?

Answered: 1 week ago