Write C statements for a struct containing name : an array of 32 chars key : an
ID: 3586333 • Letter: W
Question
Write C statements for a struct containing
name : an array of 32 chars
key : an integer
child : pointer to the first child node
sibling : pointer to the next sibling node
parent : pointer to the parent node
A tree is implemented as a BINARY tree by the child and sibling pointers.
Assume: struct node *p points at a parent node A.
struct node *q points at a new node.
struct node *r points at an EXISTING child node of A.
Write C code to ADD q as a child of A.
Write C code to DELETE q from the children of A.
Explanation / Answer
If you post more than one question, as per chegg guidelines I just have to answer the first one.
Ques. Write C statements for a struct ?
struct node{
char arr[32];
int key;
struct node *child;
struct node *sibling;
struct node *parent;
};
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.