There will be TWO default cases which require special treatment. Be sure to handle appropriately. Because of these special cases, the function should return a pointer to the node that should be the root of the BST, perhaps the original root, or some other pointer.
Code in the language of your choice and include a declaration of your data structure.
int p = -1; // GLOBAL variable shared by all processes, initialized once
while (true) {
if (p == -1)
p = mypid;
else
if (p != mypid)
while (p != -1) {} // empty loop body
// CRITICAL SECTION WHERE WORK GETS DONE
// Remainder Section is empty
}
b) Repeat, but assume the following code in the Remainder Section:
p = -1;
switch (varterm) {
case numterm : stmt; stmt; stmt;
case numterm :
case numterm : stmt;
default : stmt; stmt;
}
Notes:
Construct a Backus Naur Form (BNF) grammar for a switch statement in this language. Do not use Extended BNF (EBNF).
Let VERTEX-COVER = {G, k : G is an undirected graph with a vertex cover of k nodes}.
Show that 3SAT ≤P VERTEX-COVER; that is, show that there is a polynomial reduction from 3SAT to VERTEX-COVER.