Skip to content
Dr Jack HW Helper
Home
Browse
About
Contact
Academic Integrity
T
Academic Integrity:
tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.
Home
Browse
#
“Write a user-defined data type c++ implimentaion that is known as single link l
“Write a user-defined data type c++ implimentaion that is known as single link l
ID:
1922240
• Letter:
#
Question
“Write a user-defined data type c++ implimentaion that is known as single link list linear having dynamic memory”.
Explanation / Answer
#include …………… …………… …………… …………… struct NODE { int value; struct NODE*next; }; struct NODE*Head; struct NODE*Tail; void create list() { Head=NULL; Tail=NULL; } Void InsertNode( ) { struct NODE *temp; temp=(struct NODE*)malloc(size of NODE); if (head==NULL) head=temp; else tail-->next=temp; tail=temp; tail-->value=n; tail-->next=NULL; } void Traversal() { struct NODE*drag; drag=head; while (drag!=NULL) { coutnext; } } int search Node(int n) { struct NODE *drag; drag=Head; while(drag) { if (drag-->value==n) return1; else drag=drag-->next; } return 0; } int search and Delete(int n) { struct NODE * crnt,*prnt; if (!head) or if (head==NULL) return 0; crnt=head; if(n==head-->value) { head=head-->next; free(crnt); if (head==NULL) tail=NULL; return 1; } while (crnt!=NUll)&&(n!=crnt-->value) { prnt=crnt; crnt=crnt-->next; } if (crnt==NULL) return 0; prnt-->next=crnt-->next; if(crnt==tail) tail=prnt; free (crnt); return 1; } Void main( ) { …………….. …………….. …………….. …………….. }
Related Questions
“We really need to get this new material-handling equipment in operation just af
Question #2493257
“We use derivative instruments to manage risks related to foreign currencies, eq
Question #2339202
“What do underemployed U.S. workers (i.e., those workers who are employed, but n
Question #3171713
“What i Like to Hear” Tracy rushed past executive assistant Sharon Craig on his
Question #398463
“What would you do as a manager if you came across two of your employees reading
Question #418126
“Whatever you do in the face of a crisis is a coping pattern (Italics added). Ev
Question #3455138
“What’s going on in that lab?” asked Kevin Brolsma, chief administrator for Cinc
Question #2777143
“When a strong base is gradually added dropwise to a weak acid, the pH changes a
Question #1060367
Navigate
Browse (All)
Browse #
Subjects
Previous
“Write a user-defined data type c++ implimentaion that is known as single link l
Next
“Write an ARM assembly language program that counts the number of 1’s for any va