  }
                    }
                });
                
                // Create new items key map
                const newKeys = newItems.map((item, index) => String(keyFn(item, index)));
                
                // Track operations needed
                const operations = [];
                const usedNodes = new Set();
                
                // Plan all operations first
                newItems.forEach((item, index) => {
                    const key = String(keyFn(item, index