network maintains four index variables to make dom changes. Excuse me, what is the advantage of this kind of algorithm, and why do all choose this kind of algorithm?
what are the disadvantages if I use a simple loop operation algorithm (such as below)?
iterate through the nodes of the newVdom one by one to find its location in the oldVdom, move the corresponding DOM element if it is found, and create a new node to insert if it does not show that it is a new node. If there are any unprocessed nodes in the oldVdom after traversal, these nodes have been deleted in the newVdom, and you can delete them.