mkdir ~/cs171/hw8 cp /home/cs171000/Handouts/hw8/*.java ~/cs171/hw8 cp /home/cs171000/Handouts/hw8/*.class ~/cs171/hw8 
public class Node { double value; // value is used to find nodes in the BST Node left; Node right; } 
public class hw8Node { public String key; // key is used to find nodes in the BST public Integer value; public hw8Node left; public hw8Node right; } 



javac Part1.java java Part1 
(z,40) (x,5) (u,45) (p,10) (m,50) (k,70) (d,30) (c,80) (a,7) ================================ p = (a,7), myParent of p = (d,30) p = (c,80), myParent of p = (a,7) p = (x,5), myParent of p = (p,10) p = (z,40), myParent of p = (x,5) p = (m,50), myParent of p = (m,50) p = (d,30), myParent of p = (m,50) p = (u,45), myParent of p = (x,5) p = (k,70), myParent of p = (d,30) p = (p,10), myParent of p = (m,50) p = null, myParent of p = (k,70) p = null, myParent of p = (u,45) 

Hint: use findNode()
javac Part2.java java Part2 
(z,40) (x,5) (u,45) (p,10) (m,50) (k,70) (d,30) (c,80) (a,7) ================================ key = a, value of key = 7 key = c, value of key = 80 key = x, value of key = 5 key = z, value of key = 40 key = m, value of key = 50 key = d, value of key = 30 key = u, value of key = 45 key = k, value of key = 70 key = p, value of key = 10 key = e, value of key = null key = v, value of key = null 

Note:

javac Part3.java java Part3 
(m,50) ================================ (m,50) (d,30) ================================ (m,50) (k,70) (d,30) ================================ (z,40) (x,5) (u,45) (p,10) (m,50) (k,70) (d,30) (c,80) (a,7) ================================ Updating (m,999) and (a,888): (z,40) (x,5) (u,45) (p,10) (m,999) (k,70) (d,30) (c,80) (a,888) ================================ 

Note:

javac Part4.java java Part4 
(z,90) (x,80) (v,75) (s,70) (m,50) (k,45) (i,40) (h,39) (g,38) (f,30) (e,10) (c,7) (a,5) ================================ *** remove c *** (z,90) (x,80) (v,75) (s,70) (m,50) (k,45) (i,40) (h,39) (g,38) (f,30) (e,10) (a,5) ================================ *** remove e *** (z,90) (x,80) (v,75) (s,70) (m,50) (k,45) (i,40) (h,39) (g,38) (f,30) (a,5) ================================ *** remove s *** (z,90) (x,80) (v,75) (m,50) (k,45) (i,40) (h,39) (g,38) (f,30) (a,5) ================================ *** remove f *** (z,90) (x,80) (v,75) (m,50) (k,45) (i,40) (h,39) (g,38) (a,5) ================================ *** remove all, except i *** (i,40) ================================ *** remove i *** ================================ 
cd ~/cs171/hw8 /home/cs171000/turnin hw8BST.java hw8 