Skip to content
Unverified Commit db7f0106 authored by GavinZhengOI's avatar GavinZhengOI Committed by GitHub
Browse files

发现代码一个错误

初学splay,发现有点问题。请管理员仔细审核,因为我也不知道是不是对的QAQ
照理来说,rotate的操作是将子节点(x),转到父节点(y)之上。那么,在完成rotate操作后,y在下,x在上。而更新子树size的操作(代码中的maintain)是通过更改当前节点size为两个子节点之和来实现的。所以应该先更新在下面的y节点,再更新x。文中是不是更新顺序写反了?
parent 0a7c6048
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment