Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

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;

};

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote