Should give what is that table I do not have any table Solved with the explanati
ID: 3849415 • Letter: S
Question
Should give what is that table
I do not have any table
Solved with the explanation please
In a multiprogramming environment, consider we have the following process P1:
#
Instruction
Execution time
1
Assignment
2 ms
2
Fork ()
3 ms
3
Wait (Null)
3 ms
4
2ms
Assume the following:
fork () is executed correctly.
Push time in any queue =2 ms.
Wait time in printer queue =4 ms.
Dispatch time = 1ms.
Complete the following table:
Accumulative
Time
Process
State
Executing
Instruction
Queue
Name
Execution
Time
Dispatch Time
Push
Time
Wait
Time in Q
0
Ready
Ready Q
1
1
#
Instruction
Execution time
1
Assignment
2 ms
2
Fork ()
3 ms
3
Wait (Null)
3 ms
4
2ms
Explanation / Answer
public category Node<T> worth gift within the node.
6
public int value;
7
8
//The respect to the left subtree.
9
public Node left;
10
11
//The respect to the correct subtree.
12
public Node right;
13
14
public Node(int value) price;
16
}
17
18
}
19
20
/**
21
* Represents the Binary Search Tree.
22
*/
23
public category BinarySearchTree the basis of the tree.
26
public Node root;
27
28
public BinarySearchTree insert(int value) come this;
34
}
35
36
insertRec(root, node);
37
come this;
38
}
39
40
non-public void insertRec(Node latestRoot, Node node) else
50
} else else
57
}
58
}
59
60
/**
61
* Returns the minimum worth within the Binary Search Tree.
62
*/
63
public int findMinimum()
67
Node currNode = root;
68
whereas (currNode.left != null)
71
come currNode.value;
72
}
73
74
/**
75
* Returns the utmost worth within the Binary Search Tree
76
*/
77
public int findMaximum()
81
82
Node currNode = root;
83
whereas (currNode.right != null)
86
come currNode.value;
87
}
88
89
/**
90
* Printing the contents of the tree in associate inorder approach.
91
*/
92
public void printInorder()
104
printInOrderRec(currRoot.left);
105
System.out.print(currRoot.value + ", ");
106
printInOrderRec(currRoot.right);
107
}
108
109
/**
110
* Printing the contents of the tree during a Preorder approach.
111
*/
112
public void printPreorder()
124
System.out.print(currRoot.value + ", ");
125
printPreOrderRec(currRoot.left);
126
printPreOrderRec(currRoot.right);
127
}
128
129
/**
130
* Printing the contents of the tree during a Postorder approach.
131
*/
132
public void printPostorder()
144
printPostOrderRec(currRoot.left);
145
printPostOrderRec(currRoot.right);
146
System.out.print(currRoot.value + ", ");
147
148
}
149
}
150
151
public category BinarySearchTreeDemo {
152
153
public static void main(String[] args) {
154
BinarySearchTree bst = new BinarySearchTree();
155
bst .insert(40)
156
.insert(25)
157
.insert(78)
158
.insert(10)
159
.insert(3)
160
.insert(17)
161
.insert(32)
162
.insert(30)
163
.insert(38)
164
.insert(78)
165
.insert(50)
166
.insert(93);
167
System.out.println("Inorder traversal");
168
bst.printInorder();
169
170
System.out.println("Preorder Traversal");
171
bst.printPreorder();
172
173
System.out.println("Postorder Traversal");
174
bst.printPostorder();
175
176
System.out.println("The minimum worth within the BST: " + bst.findMinimum());
177
System.out.println("The most worth within the BST: " + bst.findMaximum());
178
179
}
180
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.