Sunday, 15 March 2015

Test 2

On week 9, there was not much new stuff we learned because we had the second term test on Wednesday. On Monday, our professor wrote a function called delete. This function consists several  if statements because it works for binary tree and comparison is required. I personally think this function is advanced. The reason is it took me a long time to just understand the code. In the first look, I was so confused because I couldn't figure out how this function deletes node. It seemed no variable was assigned by new data. But eventually it found the hidden code, it was below the  "else" and new data was from a helper function. That helper function is recursive.
I hope I can learn how to write it shortly.

No comments:

Post a Comment