Term test 2 and Binary Search Tree Functions
The difficulty of term test 2 is similar to test 1. I would
say test 2 was not very difficult but I realized right after walking out Exam
Centre that I made a very stupid mistake. I misunderstood the first question on
the greatest height of a tree and did it wrong, which made me upset, but other
than this, everything should be fine. The other two questions are about
LinkedList and BTNode, which are very similar to the labs we did. At the same
time, I am so grateful that we could bring a cheat sheet to the exam, or I
would have run out of time trying to build the functions on the second and third
question since 50 minutes was not enough for me to finish the test without a
cheat sheet.
Saw the link on Python assert statement in this week’s
reading, planning on reading this later. When I went to Prof Danny’s office
hour during assignment 2 to fix my code, he used assert to debug the code for
me, so I think this would be an useful tool for debugging.
In last week’s lecture, two recursive functions insert and
delete were mentioned and the lab of week 9 also requires implementing these
two functions.
Insert: insert data in binary search tree and return new
root. Insert will ensure this is a binary search tree.
Delete: walks through a binary search tree to delete a node
if exists and return resulting tree.
Because of the test, only one hour of lecture is presented
in this week, so there is not much new to learn.
No comments:
Post a Comment