This week, we had a test, I had reviewed a lot of stuff.
The most important thing I reviewed is the sample solution of LLNode. I had confused about the sample solution for a time, I did not understand the relation between the current_node and lnk.front. I asked myself: when the current_node move to the next node, why does not the lnk.front move to next one? I thought the lnk.front also assign to its next node if the current_node did.
However, the relation between them is not simple like that after I read the slog of a classmate, his or her blog is: zhexinlai.blogspot.ca. Actually, they works like when the current_node moved to the next node, it seems like walking along the lnk.front so that can get the deep nodes of lnk.front, which completely does not change the value of lnk.front at this step.
Besides of that, we learned the two important functions working on BTNode: insert and delete. The writing idea also is recursion, but it is not hard to understand. First, the function insert ensure that the left side value is less than the right one, so the idea of delete is to using the property of that left side node.value is always less than the right side one that we can avoiding the unnecessary step in the body of the function.
I really hope school can stop the strike, it deeply influenced our study plan because of no lab.
No comments:
Post a Comment