Question: Q1 A tree is implemented as a BINARY tree by the node's child and sibling pointers. Each node has a name string. Assume: struct node

Q1 A tree is implemented as a BINARY tree by the node's child and sibling pointers.

Each node has a name string.

Assume: struct node *p points at a parent node A.

struct node *q points at a new node.

(1) Write C code to print the names of all children of A:

(2) Write C code to add q as a child of A:

Q2

What's a process? ______________________ What does ksleep() do?___________________ What does kwakeup() do?__________________ How does a process terminate? ___________ What does pid=wait(int *status) do?____________ Processes form a BINARY tree by child, sibling pointers. Assume: PROC *p kfork() a child *q. (1). Write code to insert q into CHILD list of p: _______________ (2). write code to print child list of p: ________________________

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!