Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于最长递增子序列的问题 #282

Open
jqroom opened this issue Jun 4, 2020 · 1 comment
Open

关于最长递增子序列的问题 #282

jqroom opened this issue Jun 4, 2020 · 1 comment

Comments

@jqroom
Copy link

jqroom commented Jun 4, 2020

文档里面是得到的新节点在旧节点中index的数组,我觉得这个数据的最长递增子序列的作用是有限的。因为新节点的顺序才是最重要的,现在得到的是旧节点中的顺序,并且最长递增子序列应该是用来优化并减少旧节点中不必要的节点移动。所以我觉得应该是反过来,得到旧节点在新节点里面的index数组,然后求最长递增子序列,减少节点移动次数。

@edison1105
Copy link

文档里面是得到的新节点在旧节点中index的数组,我觉得这个数据的最长递增子序列的作用是有限的。因为新节点的顺序才是最重要的,现在得到的是旧节点中的顺序,并且最长递增子序列应该是用来优化并减少旧节点中不必要的节点移动。所以我觉得应该是反过来,得到旧节点在新节点里面的index数组,然后求最长递增子序列,减少节点移动次数。

是为了在已经渲染的旧节点上做操作。所以要以旧节点为基准,能不动的就不动,减少 DOM 操作。
还有我不要你觉得,我要我觉得 😆😆😆

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants